Changeset 457


Ignore:
Timestamp:
Jan 20, 2014 9:42:13 PM (10 years ago)
Author:
anonymous
Message:

Removed use of requireAccessClearance(). Adjusted sequence of sslOn() and requireLogin(). Added ACL::requireAllow() method. Added arguments to SortOrder::set(). Changed behavior of Validator::validateStrDate(). Added use of Validator::validateStrDate() to module maker templates.

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/_config.inc.php

    r432 r457  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2727    // Determine common site directory.
    2828    $common_base = realpath($_SERVER['argv'][1]);
    29    
     29
    3030    // First arg is path to current site. Realpath removes trailing /s
    3131    define('COMMON_BASE', $common_base);
  • trunk/bin/module_maker/list_template.cli.php

    r412 r457  
    55 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    66 * Copyright 2001-2012 Strangecode, LLC
    7  * 
     7 *
    88 * This file is part of The Strangecode Codebase.
    99 *
     
    1212 * Free Software Foundation, either version 3 of the License, or (at your option)
    1313 * any later version.
    14  * 
     14 *
    1515 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1616 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1717 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1818 * details.
    19  * 
     19 *
    2020 * You should have received a copy of the GNU General Public License along with
    2121 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    116116            $listrows[] = "<\x3fphp echo '9999-12-31' == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>";
    117117        } else if (preg_match('/datetime/i', $type)) {
    118             $listrows[] = "<\x3fphp echo '0000-00-00 00:00:00' == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>";
     118            $listrows[] = "<\x3fphp echo Validator::validateStrDate(\$list[\$i]['$field']) ? date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])) : ''; \x3f>";
    119119        } else if (preg_match('/date/i', $type)) {
    120             $listrows[] = "<\x3fphp echo '0000-00-00' == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>";
     120            $listrows[] = "<\x3fphp echo Validator::validateStrDate(\$list[\$i]['$field']) ? date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])) : ''; \x3f>";
    121121        } else if (preg_match('/(amount|_rate)/i', $field)) {
    122122            $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>";
     
    140140<\x3fphp \$fv->printErrorMessages(); \x3f>
    141141
    142 <div id="commandbox">
     142<div class="commandbox">
    143143<form action="<\x3fphp echo oTxt(\$_SERVER['PHP_SELF']); \x3f>" method="get">
    144144<\x3fphp \$app->printHiddenSession(false); \x3f>
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r320 r457  
    22<?php $fv->printErrorMessages(); ?>
    33
    4 <div id="commandbox">
     4<div class="commandbox">
    55    <span class="sc-nowrap commandtext"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
    66    <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
  • trunk/css/admin.inc.css

    r455 r457  
    249249
    250250/* Should this be an ID??? */
    251 #commandbox
     251#commandbox, .commandbox
    252252{
    253253    padding: 3px 5px 5px 5px;
     
    264264}
    265265
    266 #commandbox .form {
     266#commandbox .form, .commandbox .form, #commandbox form, .commandbox form, {
    267267    margin-top: 8px;
    268268}
  • trunk/css/admin2.inc.css

    r455 r457  
    211211}
    212212
    213 table.list td, #commandbox table td {
     213table.list td, #commandbox table td, .commandbox table td {
    214214    font-size: 70%;
    215215    padding: 2px 6px 2px 2px;
     
    218218}
    219219
    220 table.list tr:hover, #commandbox table tr:hover {
     220table.list tr:hover, #commandbox table tr:hover, .commandbox table tr:hover {
    221221    background: #FAF8C7;
    222222}
     
    224224/*_____________________ COMMANDS ____________________*/
    225225
    226 /* Should this be an ID??? */
    227 #commandbox
     226/* We were using an ID, now using class. */
     227#commandbox, .commandbox
    228228{
    229229    padding: 3px 5px 5px 5px;
     
    240240}
    241241
    242 #commandbox form {
     242#commandbox form, .commandbox form {
    243243    margin: 8px 0 0 0;
    244244}
  • trunk/lib/ACL.inc.php

    r420 r457  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2323/*
    2424* ACL.inc.php
    25 * 
     25*
    2626* Uses the ARO/ACO/AXO model of Access Control Lists.
    2727* Uses Modified Preorder Tree Traversal to maintain a tree-structure.
    2828* See: http://www.sitepoint.com/print/hierarchical-data-database
    2929* Includes a command-line tool for managing rights (codebase/bin/acl.cli.php).
    30 * 
     30*
    3131*
    3232* @author   Quinn Comendant <quinn@strangecode.com>
     
    4141    // Configuration parameters for this object.
    4242    var $_params = array(
    43        
     43
    4444        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
    4545        'enable_cache' => true,
     
    9494    {
    9595        $app =& App::getInstance();
    96    
     96
    9797        if (isset($params) && is_array($params)) {
    9898            // Merge new parameters with old overriding only those passed.
     
    113113    {
    114114        $app =& App::getInstance();
    115    
     115
    116116        if (isset($this->_params[$param])) {
    117117            return $this->_params[$param];
     
    145145                $app->logMsg(sprintf('Dropping and recreating tables acl_tbl, aro_tbl, aco_tbl, axo_tbl.', null), LOG_INFO, __FILE__, __LINE__);
    146146            }
    147            
     147
    148148            // acl_tbl
    149149            $db->query("
     
    171171                $qid = $db->query("SELECT 1 FROM acl_tbl");
    172172                if (mysql_num_rows($qid) == 0) {
    173                     $qid = $db->query("REPLACE INTO acl_tbl VALUES ('1', '1', '1', 'deny', NOW())");                   
    174                 }               
     173                    $qid = $db->query("REPLACE INTO acl_tbl VALUES ('1', '1', '1', 'deny', NOW())");
     174                }
    175175            }
    176176
     
    202202                    $qid = $db->query("SELECT 1 FROM {$a_o}_tbl WHERE name = 'root'");
    203203                    if (mysql_num_rows($qid) == 0) {
    204                         $qid = $db->query("REPLACE INTO {$a_o}_tbl (name, lft, rgt, added_datetime) VALUES ('root', 1, 2, NOW())");                   
    205                     }                   
     204                        $qid = $db->query("REPLACE INTO {$a_o}_tbl (name, lft, rgt, added_datetime) VALUES ('root', 1, 2, NOW())");
     205                    }
    206206                }
    207207
     
    228228        $app =& App::getInstance();
    229229        $db =& DB::getInstance();
    230        
     230
    231231        $this->initDB();
    232        
     232
    233233        switch ($type) {
    234234        case 'aro' :
     
    246246            break;
    247247        }
    248        
     248
    249249        // If $parent is null, use root object.
    250250        if (is_null($parent)) {
    251251            $parent = 'root';
    252252        }
    253        
     253
    254254        // Ensure node and parent name aren't empty.
    255255        if ('' == trim($name) || '' == trim($parent)) {
     
    257257            return false;
    258258        }
    259        
     259
    260260        // Ensure node is unique.
    261261        $qid = $db->query("SELECT 1 FROM $tbl WHERE name = '" . $db->escapeString($name) . "'");
     
    264264            return false;
    265265        }
    266        
     266
    267267        // Select the rgt of $parent.
    268268        $qid = $db->query("SELECT rgt FROM $tbl WHERE name = '" . $db->escapeString($parent) . "'");
     
    275275        $db->query("UPDATE $tbl SET lft = lft + 2 WHERE lft >= $parent_rgt");
    276276        $db->query("UPDATE $tbl SET rgt = rgt + 2 WHERE rgt >= $parent_rgt");
    277        
     277
    278278        // Insert new node just below parent. Lft is parent's old rgt.
    279279        $db->query("
    280             INSERT INTO $tbl (name, lft, rgt, added_datetime) 
     280            INSERT INTO $tbl (name, lft, rgt, added_datetime)
    281281            VALUES ('" . $db->escapeString($name) . "', $parent_rgt, $parent_rgt + 1, NOW())
    282282        ");
     
    315315        $app =& App::getInstance();
    316316        $db =& DB::getInstance();
    317        
     317
    318318        $this->initDB();
    319319
     
    336336            break;
    337337        }
    338        
     338
    339339        // Ensure node name isn't empty.
    340340        if ('' == trim($name)) {
     
    342342            return false;
    343343        }
    344        
     344
    345345        // Select the lft and rgt of $name to use for selecting children and reordering transversals.
    346346        $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'");
     
    349349            return false;
    350350        }
    351        
     351
    352352        // Remove node and all children of node, as well as acl_tbl links.
    353353        $db->query("
    354             DELETE $tbl, acl_tbl 
     354            DELETE $tbl, acl_tbl
    355355            FROM $tbl
    356356            LEFT JOIN acl_tbl ON ($tbl.$primary_key = acl_tbl.$primary_key)
     
    366366        return true;
    367367    }
    368    
     368
    369369    // Alias functions for the different object types.
    370370    function removeRequestObject($name)
     
    397397        $app =& App::getInstance();
    398398        $db =& DB::getInstance();
    399        
     399
    400400        $this->initDB();
    401401
     
    418418            break;
    419419        }
    420        
     420
    421421        // If $new_parent is null, use root object.
    422422        if (is_null($new_parent)) {
    423423            $new_parent = 'root';
    424424        }
    425        
     425
    426426        // Ensure node and parent name aren't empty.
    427427        if ('' == trim($name) || '' == trim($new_parent)) {
     
    429429            return false;
    430430        }
    431        
     431
    432432        // Select the lft and rgt of $name to use for selecting children and reordering transversals.
    433433        $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'");
     
    436436            return false;
    437437        }
    438        
     438
    439439        // Total number of transversal values (that is, the count of self plus all children times two).
    440440        $total_transversal_value = ($rgt - $lft + 1);
     
    446446            return false;
    447447        }
    448        
     448
    449449        // Ensure the new parent is not a child of the node being moved.
    450450        if ($new_parent_rgt <= $rgt && $new_parent_rgt >= $lft) {
     
    452452            return false;
    453453        }
    454        
     454
    455455        // Collect unique ids of all nodes being moved. The transversal numbers will become duplicated so these will be needed to identify these.
    456456        $qid = $db->query("
     
    472472        // Apply transformation to new parent rgt also.
    473473        $new_parent_rgt = $new_parent_rgt > $rgt ? $new_parent_rgt - $total_transversal_value : $new_parent_rgt;
    474        
     474
    475475        // Update transversal values of moved node and children.
    476476        $db->query("
    477             UPDATE $tbl SET 
     477            UPDATE $tbl SET
    478478                lft = lft - ($lft - $new_parent_rgt),
    479479                rgt = rgt - ($lft - $new_parent_rgt)
     
    488488        return true;
    489489    }
    490    
     490
    491491    // Alias functions for the different object types.
    492492    function moveRequestObject($name, $new_parent=null)
     
    502502        return $this->move($name, $new_parent, 'axo');
    503503    }
    504    
     504
    505505    /*
    506506    * Add an entry to the acl_tbl to allow (or deny) a truple with the specified
     
    528528        $aco = is_null($aco) ? 'root' : $aco;
    529529        $axo = is_null($axo) ? 'root' : $axo;
    530        
     530
    531531        // Flush old cached values.
    532532        $cache_hash = $aro . '|' . $aco . '|' . $axo;
     
    552552        // Access must be 'allow' or 'deny'.
    553553        $allow = 'allow' == $access ? 'allow' : 'deny';
    554        
     554
    555555        $db->query("REPLACE INTO acl_tbl VALUES ('$aro_id', '$aco_id', '$axo_id', '$allow', NOW())");
    556556        $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_INFO, __FILE__, __LINE__);
    557        
     557
    558558        return true;
    559559    }
     
    577577        return $this->grant($aro, $aco, $axo, 'deny');
    578578    }
    579    
     579
    580580    /*
    581581    * Delete an entry from the acl_tbl completely to allow other permissions to cascade down.
     
    610610        $aco = is_null($aco) ? 'root' : $aco;
    611611        $axo = is_null($axo) ? 'root' : $axo;
    612        
     612
    613613        // Flush old cached values.
    614614        $cache_hash = $aro . '|' . $aco . '|' . $axo;
     
    621621            return false;
    622622        }
    623        
     623
    624624        $qid = $db->query("
    625625            DELETE acl_tbl
     
    632632
    633633        $app->logMsg(sprintf('Deleted %s acl_tbl links: %s -> %s -> %s', mysql_affected_rows($db->getDBH()), $aro, $aco, $axo), LOG_INFO, __FILE__, __LINE__);
    634        
     634
    635635        return true;
    636636    }
    637    
     637
    638638    /*
    639639    * Calculates the most specific cascading privilege found for a requested
    640     * ARO -> ACO -> AXO entry. Returns FALSE if the entry is denied. By default, 
     640    * ARO -> ACO -> AXO entry. Returns FALSE if the entry is denied. By default,
    641641    * all entries are denied, unless some point in the hierarchy is set to "allow."
    642642    *
     
    654654        $app =& App::getInstance();
    655655        $db =& DB::getInstance();
    656        
     656
    657657        $this->initDB();
    658658
     
    661661        $aco = is_null($aco) || '' == trim($aco) ? 'root' : $aco;
    662662        $axo = is_null($axo) || '' == trim($axo) ? 'root' : $axo;
    663        
     663
    664664        $cache_hash = $aro . '|' . $aco . '|' . $axo;
    665665        if ($this->cache->exists($cache_hash) && true === $this->getParam('enable_cache')) {
     
    687687            $this->cache->set($cache_hash, $access);
    688688        }
    689        
     689
    690690        if ('allow' == $access) {
    691691            $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     
    697697    }
    698698
     699    /*
     700    * Bounce user if they are denied access. Because this function calls dieURL() it must be called before any other HTTP header output.
     701    *
     702    * @access   public
     703    * @param    string $aro Identifier of an existing ARO object.
     704    * @param    string $aco Identifier of an existing ACO object (or null to use root).
     705    * @param    string $axo Identifier of an existing AXO object (or null to use root).
     706    * @param    string $message The text description of a message to raise.
     707    * @param    int    $type    The type of message: MSG_NOTICE,
     708    *                           MSG_SUCCESS, MSG_WARNING, or MSG_ERR.
     709    * @param    string $file    __FILE__.
     710    * @param    string $line    __LINE__.
     711    * @author   Quinn Comendant <quinn@strangecode.com>
     712    * @version  1.0
     713    * @since    20 Jan 2014 12:09:03
     714    */
     715    function requireAllow($aro, $aco=null, $axo=null, $message='', $type=MSG_NOTICE, $file=null, $line=null)
     716    {
     717        $app =& App::getInstance();
     718
     719        if (!$this->check($aro, $aco, $axo)) {
     720            $message = '' == trim($message) ? sprintf(_("You have insufficient privileges to view <em>%s %s</em>"), $aco, $axo) : $message;
     721            $app->raiseMsg($message, $type, $file, $line);
     722            $app->dieBoomerangURL();
     723        }
     724    }
     725
    699726} // End class.
    700727
  • trunk/lib/SortOrder.inc.php

    r452 r457  
    139139     *                               for example, for an alphabetical sort)
    140140     */
    141     function set($sort = null, $order = null)
     141    function set($sort=null, $order=null, $save_value=true)
    142142    {
    143143        // Set new sort value.
    144144        if (isset($sort)) {
    145145            $this->sort_by = $sort;
    146             $this->prefs->set('sort_by', $this->sort_by);
     146            if ($save_value) {
     147                $this->prefs->set('sort_by', $this->sort_by);
     148            }
    147149        }
    148150
     
    150152        if (isset($order)) {
    151153            $this->order = $order;
    152             $this->prefs->set('sort_order', $this->order);
     154            if ($save_value) {
     155                $this->prefs->set('sort_order', $this->order);
     156            }
    153157        }
    154158    }
  • trunk/lib/Utilities.inc.php

    r454 r457  
    6565    $d = ob_get_contents();
    6666    ob_end_clean();
    67     return $serialize ? preg_replace('/\s+/m', '', $d) : $d;
     67    return $serialize ? preg_replace('/\s+/m', ' ', $d) : $d;
    6868}
    6969
  • trunk/lib/Validator.inc.php

    r415 r457  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2424 * Validator.inc.php
    2525 *
    26  * The Validator class provides a methods for validating input against different criteria. 
     26 * The Validator class provides a methods for validating input against different criteria.
    2727 * All functions return true if the input passes the test.
    2828 *
     
    192192            return VALIDATE_EMAIL_REGEX_FAIL;
    193193        }
    194        
     194
    195195        // We have a match! Here are the captured subpatterns, on which further tests are run.
    196         // The part before the @. 
     196        // The part before the @.
    197197        $local = $e_parts[2];
    198198
    199         // The part after the @. 
     199        // The part after the @.
    200200        // If domain is an IP [XXX.XXX.XXX.XXX] strip off the brackets.
    201201        $domain = $e_parts[3]{0} == '[' ? mb_substr($e_parts[3], 1, -1) : $e_parts[3];
     
    225225    {
    226226        $app =& App::getInstance();
    227        
    228         if ('' == trim($val)) {
     227
     228        if (is_string($val) && '' === trim($val)) {
    229229            // Don't be too bothered about empty strings.
    230230            return true;
     
    232232
    233233        $timestamp = strtotime($val);
    234         // Return values change between php4 and php5.
    235         if ('' != trim($val) && ($timestamp === -1 || $timestamp === false)) {
     234        if (!$timestamp || $timestamp < 1) {
    236235            return false;
    237236        } else {
     
    239238        }
    240239    }
    241 
    242240
    243241    /**
     
    279277                 break;
    280278         }
    281          
     279
    282280         if ('' != $regex && !preg_match($regex, $cc_num)) {
    283281             // Invalid format.
     
    324322            return false;
    325323        }
    326        
     324
    327325        if (is_array($_FILES[$form_name]['name'])) {
    328326            foreach($_FILES[$form_name]['name'] as $f) {
     
    336334            }
    337335        }
    338        
     336
    339337        return true;
    340338    }
  • trunk/services/admins.php

    r441 r457  
    2727// require_once dirname(__FILE__) . '/_config.inc.php';
    2828
     29$app->sslOn();
    2930$auth->requireLogin();
    30 $app->sslOn();
    3131
    3232require_once 'codebase/lib/PageNumbers.inc.php';
  • trunk/services/lock.php

    r396 r457  
    2828require_once 'codebase/lib/Lock.inc.php';
    2929
     30$app->sslOn();
    3031$auth->requireLogin();
    31 $app->sslOn();
    3232
    3333if (getFormData('boomerang', false)) {
  • trunk/services/logs.php

    r396 r457  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2727// require_once dirname(__FILE__) . '/_config.inc.php';
    2828
     29$app->sslOn();
    2930$auth->requireLogin();
    30 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG);
    31 $app->sslOn();
    3231
    3332require_once 'codebase/lib/PageNumbers.inc.php';
     
    6463));
    6564if (getFormData('log', false)) {
    66     $tmp_prefs->set('log_file', getFormData('log'));   
     65    $tmp_prefs->set('log_file', getFormData('log'));
    6766}
    6867
     
    8079switch (getFormData('op')) {
    8180case 'delete' :
    82 //     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
    8381    deleteLog($tmp_prefs->get('log_file'));
    8482    $tmp_prefs->set('log_file', $app->getParam('log_filename'));
     
    9290
    9391case 'clear' :
    94 //     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
    9592    clearLog($tmp_prefs->get('log_file'));
    9693    if ($app->validBoomerangURL('app_log')) {
     
    103100
    104101case 'archive' :
    105 //     $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);
    106102    if (archiveLog($tmp_prefs->get('log_file'))) {
    107103        // Now flush current log.
  • trunk/services/templates/admin_list.ihtml

    r432 r457  
    22<?php $fv->printErrorMessages(); ?>
    33
    4 <div id="commandbox">
     4<div class="commandbox">
    55    <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add Administrator"); ?></a></span>
    66    <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
     
    3838        <td class="sc-nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> &nbsp;</td>
    3939        <td class="sc-nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> &nbsp;</td>
    40         <td class="sc-nowrap"><?php 
     40        <td class="sc-nowrap"><?php
    4141            if ($auth->isLoggedIn($list[$i]['admin_id'])) {
    4242                ?><strong><?php echo date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) ?></strong><?php
    4343            } else {
    44                 echo '0000-00-00 00:00:00' == $list[$i]['last_login_datetime'] ? '' : date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime']));
     44                echo Validator::validateStrDate($list[$i]['last_login_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) : '';
    4545            }
    4646        ?> &nbsp;</td>
    4747        <td class="sc-nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> &nbsp;</td>
    48         <td class="sc-nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['added_datetime'] ? '' : date($app->getParam('date_format'), strtotime($list[$i]['added_datetime'])); ?> &nbsp;</td>
     48        <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['added_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['added_datetime'])) : ''; ?> &nbsp;</td>
    4949        <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> &nbsp;</td>
    50         <td class="sc-nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['modified_datetime'] ? '' : date($app->getParam('date_format'), strtotime($list[$i]['modified_datetime'])); ?> &nbsp;</td>
     50        <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['modified_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['modified_datetime'])) : ''; ?> &nbsp;</td>
    5151        <td class="sc-nowrap"><?php echo oTxt($list[$i]['modified_admin_username'], true); ?> &nbsp;</td>
    5252        <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onclick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a> &nbsp;</td>
  • trunk/services/templates/log_list.ihtml

    r320 r457  
    11<form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
    22<?php $app->printHiddenSession(false); ?>
    3 <div id="commandbox">
     3<div class="commandbox">
    44<?php if (is_array($logs) && !empty($logs)) { ?>
    55    <table>
  • trunk/services/templates/versions_diff.ihtml

    r270 r457  
    1 <div id="commandbox">
     1<div class="commandbox">
    22<?php if (!getFormData('current', false)) { ?>
    33    <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
  • trunk/services/templates/versions_view.ihtml

    r365 r457  
    1 <div id="commandbox">
     1<div class="commandbox">
    22<span class="sc-nowrap commanditem"><a href="<?php echo $app->ohref(oTxt($_SERVER['PHP_SELF'])); ?>"><?php echo _("Back to the Versions List"); ?></a></span>
    33<?php if (!getFormData('current', false)) { ?>
  • trunk/services/versions.php

    r396 r457  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2727// require_once dirname(__FILE__) . '/_config.inc.php';
    2828
     29$app->sslOn();
    2930$auth->requireLogin();
    30 $app->sslOn();
    3131
    3232require_once 'codebase/lib/Version.inc.php';
     
    3838
    3939// Since we're using the singleton pattern we can instantiate a Version object earlier with custom parameters.
    40 $version =& Version::getInstance($auth);   
     40$version =& Version::getInstance($auth);
    4141
    4242// Query arguments to retain their values between page requests.
  • trunk/tests/Auth_SQLTest.php

    r396 r457  
    256256        $this->assertType('array', $result);
    257257    }
    258 
    259 //     function test_inclearancezone()
    260 //     {
    261 //         $result = $this->Auth_SQL->inclearancezone(PARAM);
    262 //         $expected = EXPECTED_VAL;
    263 //         $this->assertEquals($expected, $result);
    264 //     }
    265 //
    266 //     function test_requireaccessclearance()
    267 //     {
    268 //         $result = $this->Auth_SQL->requireaccessclearance(PARAM);
    269 //         $expected = EXPECTED_VAL;
    270 //         $this->assertEquals($expected, $result);
    271 //     }
    272 
    273258}
    274259// Running the test.
Note: See TracChangeset for help on using the changeset viewer.