Changeset 241


Ignore:
Timestamp:
Apr 4, 2007 4:54:25 AM (17 years ago)
Author:
quinn
Message:

Q - Fixed a few non-fatal but still annoying bugs.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FormValidator.inc.php

    r178 r241  
    209209    function isEmpty($form_name, $msg='')
    210210    {
    211         $this->notEmpty($form_name, $msg='');
     211        $this->notEmpty($form_name, $msg);
    212212    }
    213213
  • trunk/lib/Prefs.inc.php

    r201 r241  
    204204        $app =& App::getInstance();
    205205        if (array_key_exists($key, $_SESSION['_prefs'][$this->_ns]['persistent'])) {
     206            $app->logMsg(sprintf('Found %s in persistent', $key), LOG_DEBUG, __FILE__, __LINE__);
    206207            return $_SESSION['_prefs'][$this->_ns]['persistent'][$key];
    207208        } else if (array_key_exists($key, $_SESSION['_prefs'][$this->_ns]['defaults'])) {
     209            $app->logMsg(sprintf('Found %s in defaults', $key), LOG_DEBUG, __FILE__, __LINE__);
    208210            return $_SESSION['_prefs'][$this->_ns]['defaults'][$key];
    209211        } else {
     
    238240     * as $auth->clear(), such as when logging out.
    239241     */
    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        }
    248262    }
    249263   
     
    282296       
    283297        // Clear existing cache.
    284         $this->clear();
     298        $this->clear('persistent');
    285299       
    286300        // Retrieve all prefs for this user and namespace.
     
    296310        }
    297311       
    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__);
    299313       
    300314        // Data loaded only once per session.
  • trunk/lib/Utilities.inc.php

    r240 r241  
    329329 *
    330330 * @param   string  $file   File in include path.
     331 * @param   mixded  $stat   Which statistic to return (or null to return all).
    331332 * @return  mixed   Value of requested key from fstat(), or false on error.
    332333 * @author  Quinn Comendant <quinn@strangecode.com>
    333334 * @since   03 Dec 2005 14:23:26
    334335 */
    335 function statIncludePath($file, $stat)
     336function statIncludePath($file, $stat=null)
    336337{
    337338    // Open file pointer read-only using include path.
     
    341342        fclose($fp);
    342343        // Return specified stats.
    343         return $stats[$stat];
     344        return is_null($stat) ? $stats : $stats[$stat];
    344345    } else {
    345346        return false;
     
    733734    $app =& App::getInstance();
    734735   
    735     $add_members = '/var/mailman/bin/add_members';
     736    $add_members = '/usr/lib/mailman/bin/add_members';
    736737    if (is_executable($add_members) && is_readable($add_members)) {
    737738        $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);
    739740        if (0 == $return_code) {
    740741            $app->logMsg(sprintf('Mailman add member success for list: %s, user: %s', $list, $email, $stdout), LOG_INFO, __FILE__, __LINE__);
     
    764765    $app =& App::getInstance();
    765766   
    766     $remove_members = '/var/mailman/bin/remove_members';
     767    $remove_members = '/usr/lib/mailman/bin/remove_members';
    767768    if (is_executable($remove_members) && is_readable($remove_members)) {
    768769        $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);
    770771        if (0 == $return_code) {
    771772            $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.