Changeset 241
- Timestamp:
- Apr 4, 2007 4:54:25 AM (17 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FormValidator.inc.php
r178 r241 209 209 function isEmpty($form_name, $msg='') 210 210 { 211 $this->notEmpty($form_name, $msg ='');211 $this->notEmpty($form_name, $msg); 212 212 } 213 213 -
trunk/lib/Prefs.inc.php
r201 r241 204 204 $app =& App::getInstance(); 205 205 if (array_key_exists($key, $_SESSION['_prefs'][$this->_ns]['persistent'])) { 206 $app->logMsg(sprintf('Found %s in persistent', $key), LOG_DEBUG, __FILE__, __LINE__); 206 207 return $_SESSION['_prefs'][$this->_ns]['persistent'][$key]; 207 208 } else if (array_key_exists($key, $_SESSION['_prefs'][$this->_ns]['defaults'])) { 209 $app->logMsg(sprintf('Found %s in defaults', $key), LOG_DEBUG, __FILE__, __LINE__); 208 210 return $_SESSION['_prefs'][$this->_ns]['defaults'][$key]; 209 211 } else { … … 238 240 * as $auth->clear(), such as when logging out. 239 241 */ 240 function clear() 241 { 242 $_SESSION['_prefs'][$this->_ns] = array( 243 'loaded' => false, 244 'load_datetime' => '1970-01-01', 245 'defaults' => array(), 246 'persistent' => array(), 247 ); 242 function clear($focus='all') 243 { 244 switch ($focus) { 245 case 'all' : 246 $_SESSION['_prefs'][$this->_ns] = array( 247 'loaded' => false, 248 'load_datetime' => '1970-01-01', 249 'defaults' => array(), 250 'persistent' => array(), 251 ); 252 break; 253 254 case 'defaults' : 255 $_SESSION['_prefs'][$this->_ns]['defaults'] = array(); 256 break; 257 258 case 'persistent' : 259 $_SESSION['_prefs'][$this->_ns]['persistent'] = array(); 260 break; 261 } 248 262 } 249 263 … … 282 296 283 297 // Clear existing cache. 284 $this->clear( );298 $this->clear('persistent'); 285 299 286 300 // Retrieve all prefs for this user and namespace. … … 296 310 } 297 311 298 $app->logMsg(sprintf('Loaded %s prefs from database.', sizeof($_SESSION['_prefs'][$this->_ns]['persistent'])), LOG_DEBUG, __FILE__, __LINE__);312 $app->logMsg(sprintf('Loaded %s prefs from database.', mysql_num_rows($qid)), LOG_DEBUG, __FILE__, __LINE__); 299 313 300 314 // Data loaded only once per session. -
trunk/lib/Utilities.inc.php
r240 r241 329 329 * 330 330 * @param string $file File in include path. 331 * @param mixded $stat Which statistic to return (or null to return all). 331 332 * @return mixed Value of requested key from fstat(), or false on error. 332 333 * @author Quinn Comendant <quinn@strangecode.com> 333 334 * @since 03 Dec 2005 14:23:26 334 335 */ 335 function statIncludePath($file, $stat )336 function statIncludePath($file, $stat=null) 336 337 { 337 338 // Open file pointer read-only using include path. … … 341 342 fclose($fp); 342 343 // Return specified stats. 343 return $stats[$stat];344 return is_null($stat) ? $stats : $stats[$stat]; 344 345 } else { 345 346 return false; … … 733 734 $app =& App::getInstance(); 734 735 735 $add_members = '/ var/mailman/bin/add_members';736 $add_members = '/usr/lib/mailman/bin/add_members'; 736 737 if (is_executable($add_members) && is_readable($add_members)) { 737 738 $welcome_msg = $send_welcome_message ? 'y' : 'n'; 738 exec(sprintf( '/bin/echo %s | /usr/bin/sudo %s -r - --welcome-msg=%s --admin-notify=n %s', escapeshellarg($email), escapeshellarg($add_members), $welcome_msg, escapeshellarg($list)), $stdout, $return_code);739 exec(sprintf("/bin/echo '%s' | /usr/bin/sudo %s -r - --welcome-msg=%s --admin-notify=n '%s'", escapeshellarg($email), escapeshellarg($add_members), $welcome_msg, escapeshellarg($list)), $stdout, $return_code); 739 740 if (0 == $return_code) { 740 741 $app->logMsg(sprintf('Mailman add member success for list: %s, user: %s', $list, $email, $stdout), LOG_INFO, __FILE__, __LINE__); … … 764 765 $app =& App::getInstance(); 765 766 766 $remove_members = '/ var/mailman/bin/remove_members';767 $remove_members = '/usr/lib/mailman/bin/remove_members'; 767 768 if (is_executable($remove_members) && is_readable($remove_members)) { 768 769 $userack = $send_user_ack ? '' : '--nouserack'; 769 exec(sprintf( '/usr/bin/sudo %s %s --noadminack %s %s', escapeshellarg($remove_members), $userack, escapeshellarg($list), escapeshellarg($email)), $stdout, $return_code);770 exec(sprintf("/usr/bin/sudo %s %s --noadminack '%s' '%s'", escapeshellarg($remove_members), $userack, escapeshellarg($list), escapeshellarg($email)), $stdout, $return_code); 770 771 if (0 == $return_code) { 771 772 $app->logMsg(sprintf('Mailman remove member success for list: %s, user: %s', $list, $email, $stdout), LOG_INFO, __FILE__, __LINE__);
Note: See TracChangeset
for help on using the changeset viewer.