Changeset 457
- Timestamp:
- Jan 20, 2014 9:42:13 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/_config.inc.php
r432 r457 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 27 27 // Determine common site directory. 28 28 $common_base = realpath($_SERVER['argv'][1]); 29 29 30 30 // First arg is path to current site. Realpath removes trailing /s 31 31 define('COMMON_BASE', $common_base); -
trunk/bin/module_maker/list_template.cli.php
r412 r457 5 5 * For details visit the project site: <http://trac.strangecode.com/codebase/> 6 6 * Copyright 2001-2012 Strangecode, LLC 7 * 7 * 8 8 * This file is part of The Strangecode Codebase. 9 9 * … … 12 12 * Free Software Foundation, either version 3 of the License, or (at your option) 13 13 * any later version. 14 * 14 * 15 15 * The Strangecode Codebase is distributed in the hope that it will be useful, but 16 16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 18 18 * details. 19 * 19 * 20 20 * You should have received a copy of the GNU General Public License along with 21 21 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 116 116 $listrows[] = "<\x3fphp echo '9999-12-31' == \$list[\$i]['$field'] ? '' : date(\$app->getParam('date_format'), strtotime(\$list[\$i]['$field'])); \x3f>"; 117 117 } 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>"; 119 119 } 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>"; 121 121 } else if (preg_match('/(amount|_rate)/i', $field)) { 122 122 $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>"; … … 140 140 <\x3fphp \$fv->printErrorMessages(); \x3f> 141 141 142 <div id="commandbox">142 <div class="commandbox"> 143 143 <form action="<\x3fphp echo oTxt(\$_SERVER['PHP_SELF']); \x3f>" method="get"> 144 144 <\x3fphp \$app->printHiddenSession(false); \x3f> -
trunk/bin/module_maker/skel/adm_list.ihtml
r320 r457 2 2 <?php $fv->printErrorMessages(); ?> 3 3 4 <div id="commandbox">4 <div class="commandbox"> 5 5 <span class="sc-nowrap commandtext"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span> 6 6 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form"> -
trunk/css/admin.inc.css
r455 r457 249 249 250 250 /* Should this be an ID??? */ 251 #commandbox 251 #commandbox, .commandbox 252 252 { 253 253 padding: 3px 5px 5px 5px; … … 264 264 } 265 265 266 #commandbox .form {266 #commandbox .form, .commandbox .form, #commandbox form, .commandbox form, { 267 267 margin-top: 8px; 268 268 } -
trunk/css/admin2.inc.css
r455 r457 211 211 } 212 212 213 table.list td, #commandbox table td {213 table.list td, #commandbox table td, .commandbox table td { 214 214 font-size: 70%; 215 215 padding: 2px 6px 2px 2px; … … 218 218 } 219 219 220 table.list tr:hover, #commandbox table tr:hover {220 table.list tr:hover, #commandbox table tr:hover, .commandbox table tr:hover { 221 221 background: #FAF8C7; 222 222 } … … 224 224 /*_____________________ COMMANDS ____________________*/ 225 225 226 /* Should this be an ID???*/227 #commandbox 226 /* We were using an ID, now using class. */ 227 #commandbox, .commandbox 228 228 { 229 229 padding: 3px 5px 5px 5px; … … 240 240 } 241 241 242 #commandbox form {242 #commandbox form, .commandbox form { 243 243 margin: 8px 0 0 0; 244 244 } -
trunk/lib/ACL.inc.php
r420 r457 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 23 23 /* 24 24 * ACL.inc.php 25 * 25 * 26 26 * Uses the ARO/ACO/AXO model of Access Control Lists. 27 27 * Uses Modified Preorder Tree Traversal to maintain a tree-structure. 28 28 * See: http://www.sitepoint.com/print/hierarchical-data-database 29 29 * Includes a command-line tool for managing rights (codebase/bin/acl.cli.php). 30 * 30 * 31 31 * 32 32 * @author Quinn Comendant <quinn@strangecode.com> … … 41 41 // Configuration parameters for this object. 42 42 var $_params = array( 43 43 44 44 // If false nothing will be cached or retrieved. Useful for testing realtime data requests. 45 45 'enable_cache' => true, … … 94 94 { 95 95 $app =& App::getInstance(); 96 96 97 97 if (isset($params) && is_array($params)) { 98 98 // Merge new parameters with old overriding only those passed. … … 113 113 { 114 114 $app =& App::getInstance(); 115 115 116 116 if (isset($this->_params[$param])) { 117 117 return $this->_params[$param]; … … 145 145 $app->logMsg(sprintf('Dropping and recreating tables acl_tbl, aro_tbl, aco_tbl, axo_tbl.', null), LOG_INFO, __FILE__, __LINE__); 146 146 } 147 147 148 148 // acl_tbl 149 149 $db->query(" … … 171 171 $qid = $db->query("SELECT 1 FROM acl_tbl"); 172 172 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 } 175 175 } 176 176 … … 202 202 $qid = $db->query("SELECT 1 FROM {$a_o}_tbl WHERE name = 'root'"); 203 203 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 } 206 206 } 207 207 … … 228 228 $app =& App::getInstance(); 229 229 $db =& DB::getInstance(); 230 230 231 231 $this->initDB(); 232 232 233 233 switch ($type) { 234 234 case 'aro' : … … 246 246 break; 247 247 } 248 248 249 249 // If $parent is null, use root object. 250 250 if (is_null($parent)) { 251 251 $parent = 'root'; 252 252 } 253 253 254 254 // Ensure node and parent name aren't empty. 255 255 if ('' == trim($name) || '' == trim($parent)) { … … 257 257 return false; 258 258 } 259 259 260 260 // Ensure node is unique. 261 261 $qid = $db->query("SELECT 1 FROM $tbl WHERE name = '" . $db->escapeString($name) . "'"); … … 264 264 return false; 265 265 } 266 266 267 267 // Select the rgt of $parent. 268 268 $qid = $db->query("SELECT rgt FROM $tbl WHERE name = '" . $db->escapeString($parent) . "'"); … … 275 275 $db->query("UPDATE $tbl SET lft = lft + 2 WHERE lft >= $parent_rgt"); 276 276 $db->query("UPDATE $tbl SET rgt = rgt + 2 WHERE rgt >= $parent_rgt"); 277 277 278 278 // Insert new node just below parent. Lft is parent's old rgt. 279 279 $db->query(" 280 INSERT INTO $tbl (name, lft, rgt, added_datetime) 280 INSERT INTO $tbl (name, lft, rgt, added_datetime) 281 281 VALUES ('" . $db->escapeString($name) . "', $parent_rgt, $parent_rgt + 1, NOW()) 282 282 "); … … 315 315 $app =& App::getInstance(); 316 316 $db =& DB::getInstance(); 317 317 318 318 $this->initDB(); 319 319 … … 336 336 break; 337 337 } 338 338 339 339 // Ensure node name isn't empty. 340 340 if ('' == trim($name)) { … … 342 342 return false; 343 343 } 344 344 345 345 // Select the lft and rgt of $name to use for selecting children and reordering transversals. 346 346 $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'"); … … 349 349 return false; 350 350 } 351 351 352 352 // Remove node and all children of node, as well as acl_tbl links. 353 353 $db->query(" 354 DELETE $tbl, acl_tbl 354 DELETE $tbl, acl_tbl 355 355 FROM $tbl 356 356 LEFT JOIN acl_tbl ON ($tbl.$primary_key = acl_tbl.$primary_key) … … 366 366 return true; 367 367 } 368 368 369 369 // Alias functions for the different object types. 370 370 function removeRequestObject($name) … … 397 397 $app =& App::getInstance(); 398 398 $db =& DB::getInstance(); 399 399 400 400 $this->initDB(); 401 401 … … 418 418 break; 419 419 } 420 420 421 421 // If $new_parent is null, use root object. 422 422 if (is_null($new_parent)) { 423 423 $new_parent = 'root'; 424 424 } 425 425 426 426 // Ensure node and parent name aren't empty. 427 427 if ('' == trim($name) || '' == trim($new_parent)) { … … 429 429 return false; 430 430 } 431 431 432 432 // Select the lft and rgt of $name to use for selecting children and reordering transversals. 433 433 $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'"); … … 436 436 return false; 437 437 } 438 438 439 439 // Total number of transversal values (that is, the count of self plus all children times two). 440 440 $total_transversal_value = ($rgt - $lft + 1); … … 446 446 return false; 447 447 } 448 448 449 449 // Ensure the new parent is not a child of the node being moved. 450 450 if ($new_parent_rgt <= $rgt && $new_parent_rgt >= $lft) { … … 452 452 return false; 453 453 } 454 454 455 455 // Collect unique ids of all nodes being moved. The transversal numbers will become duplicated so these will be needed to identify these. 456 456 $qid = $db->query(" … … 472 472 // Apply transformation to new parent rgt also. 473 473 $new_parent_rgt = $new_parent_rgt > $rgt ? $new_parent_rgt - $total_transversal_value : $new_parent_rgt; 474 474 475 475 // Update transversal values of moved node and children. 476 476 $db->query(" 477 UPDATE $tbl SET 477 UPDATE $tbl SET 478 478 lft = lft - ($lft - $new_parent_rgt), 479 479 rgt = rgt - ($lft - $new_parent_rgt) … … 488 488 return true; 489 489 } 490 490 491 491 // Alias functions for the different object types. 492 492 function moveRequestObject($name, $new_parent=null) … … 502 502 return $this->move($name, $new_parent, 'axo'); 503 503 } 504 504 505 505 /* 506 506 * Add an entry to the acl_tbl to allow (or deny) a truple with the specified … … 528 528 $aco = is_null($aco) ? 'root' : $aco; 529 529 $axo = is_null($axo) ? 'root' : $axo; 530 530 531 531 // Flush old cached values. 532 532 $cache_hash = $aro . '|' . $aco . '|' . $axo; … … 552 552 // Access must be 'allow' or 'deny'. 553 553 $allow = 'allow' == $access ? 'allow' : 'deny'; 554 554 555 555 $db->query("REPLACE INTO acl_tbl VALUES ('$aro_id', '$aco_id', '$axo_id', '$allow', NOW())"); 556 556 $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_INFO, __FILE__, __LINE__); 557 557 558 558 return true; 559 559 } … … 577 577 return $this->grant($aro, $aco, $axo, 'deny'); 578 578 } 579 579 580 580 /* 581 581 * Delete an entry from the acl_tbl completely to allow other permissions to cascade down. … … 610 610 $aco = is_null($aco) ? 'root' : $aco; 611 611 $axo = is_null($axo) ? 'root' : $axo; 612 612 613 613 // Flush old cached values. 614 614 $cache_hash = $aro . '|' . $aco . '|' . $axo; … … 621 621 return false; 622 622 } 623 623 624 624 $qid = $db->query(" 625 625 DELETE acl_tbl … … 632 632 633 633 $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 635 635 return true; 636 636 } 637 637 638 638 /* 639 639 * 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, 641 641 * all entries are denied, unless some point in the hierarchy is set to "allow." 642 642 * … … 654 654 $app =& App::getInstance(); 655 655 $db =& DB::getInstance(); 656 656 657 657 $this->initDB(); 658 658 … … 661 661 $aco = is_null($aco) || '' == trim($aco) ? 'root' : $aco; 662 662 $axo = is_null($axo) || '' == trim($axo) ? 'root' : $axo; 663 663 664 664 $cache_hash = $aro . '|' . $aco . '|' . $axo; 665 665 if ($this->cache->exists($cache_hash) && true === $this->getParam('enable_cache')) { … … 687 687 $this->cache->set($cache_hash, $access); 688 688 } 689 689 690 690 if ('allow' == $access) { 691 691 $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__); … … 697 697 } 698 698 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 699 726 } // End class. 700 727 -
trunk/lib/SortOrder.inc.php
r452 r457 139 139 * for example, for an alphabetical sort) 140 140 */ 141 function set($sort = null, $order = null)141 function set($sort=null, $order=null, $save_value=true) 142 142 { 143 143 // Set new sort value. 144 144 if (isset($sort)) { 145 145 $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 } 147 149 } 148 150 … … 150 152 if (isset($order)) { 151 153 $this->order = $order; 152 $this->prefs->set('sort_order', $this->order); 154 if ($save_value) { 155 $this->prefs->set('sort_order', $this->order); 156 } 153 157 } 154 158 } -
trunk/lib/Utilities.inc.php
r454 r457 65 65 $d = ob_get_contents(); 66 66 ob_end_clean(); 67 return $serialize ? preg_replace('/\s+/m', ' ', $d) : $d;67 return $serialize ? preg_replace('/\s+/m', ' ', $d) : $d; 68 68 } 69 69 -
trunk/lib/Validator.inc.php
r415 r457 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 24 24 * Validator.inc.php 25 25 * 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. 27 27 * All functions return true if the input passes the test. 28 28 * … … 192 192 return VALIDATE_EMAIL_REGEX_FAIL; 193 193 } 194 194 195 195 // 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 @. 197 197 $local = $e_parts[2]; 198 198 199 // The part after the @. 199 // The part after the @. 200 200 // If domain is an IP [XXX.XXX.XXX.XXX] strip off the brackets. 201 201 $domain = $e_parts[3]{0} == '[' ? mb_substr($e_parts[3], 1, -1) : $e_parts[3]; … … 225 225 { 226 226 $app =& App::getInstance(); 227 228 if ( ''== trim($val)) {227 228 if (is_string($val) && '' === trim($val)) { 229 229 // Don't be too bothered about empty strings. 230 230 return true; … … 232 232 233 233 $timestamp = strtotime($val); 234 // Return values change between php4 and php5. 235 if ('' != trim($val) && ($timestamp === -1 || $timestamp === false)) { 234 if (!$timestamp || $timestamp < 1) { 236 235 return false; 237 236 } else { … … 239 238 } 240 239 } 241 242 240 243 241 /** … … 279 277 break; 280 278 } 281 279 282 280 if ('' != $regex && !preg_match($regex, $cc_num)) { 283 281 // Invalid format. … … 324 322 return false; 325 323 } 326 324 327 325 if (is_array($_FILES[$form_name]['name'])) { 328 326 foreach($_FILES[$form_name]['name'] as $f) { … … 336 334 } 337 335 } 338 336 339 337 return true; 340 338 } -
trunk/services/admins.php
r441 r457 27 27 // require_once dirname(__FILE__) . '/_config.inc.php'; 28 28 29 $app->sslOn(); 29 30 $auth->requireLogin(); 30 $app->sslOn();31 31 32 32 require_once 'codebase/lib/PageNumbers.inc.php'; -
trunk/services/lock.php
r396 r457 28 28 require_once 'codebase/lib/Lock.inc.php'; 29 29 30 $app->sslOn(); 30 31 $auth->requireLogin(); 31 $app->sslOn();32 32 33 33 if (getFormData('boomerang', false)) { -
trunk/services/logs.php
r396 r457 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 27 27 // require_once dirname(__FILE__) . '/_config.inc.php'; 28 28 29 $app->sslOn(); 29 30 $auth->requireLogin(); 30 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG);31 $app->sslOn();32 31 33 32 require_once 'codebase/lib/PageNumbers.inc.php'; … … 64 63 )); 65 64 if (getFormData('log', false)) { 66 $tmp_prefs->set('log_file', getFormData('log')); 65 $tmp_prefs->set('log_file', getFormData('log')); 67 66 } 68 67 … … 80 79 switch (getFormData('op')) { 81 80 case 'delete' : 82 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);83 81 deleteLog($tmp_prefs->get('log_file')); 84 82 $tmp_prefs->set('log_file', $app->getParam('log_filename')); … … 92 90 93 91 case 'clear' : 94 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);95 92 clearLog($tmp_prefs->get('log_file')); 96 93 if ($app->validBoomerangURL('app_log')) { … … 103 100 104 101 case 'archive' : 105 // $auth->requireAccessClearance(ZONE_ADMIN_APPLOG_FUNC_RESET);106 102 if (archiveLog($tmp_prefs->get('log_file'))) { 107 103 // Now flush current log. -
trunk/services/templates/admin_list.ihtml
r432 r457 2 2 <?php $fv->printErrorMessages(); ?> 3 3 4 <div id="commandbox">4 <div class="commandbox"> 5 5 <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add Administrator"); ?></a></span> 6 6 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form"> … … 38 38 <td class="sc-nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> </td> 39 39 <td class="sc-nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> </td> 40 <td class="sc-nowrap"><?php 40 <td class="sc-nowrap"><?php 41 41 if ($auth->isLoggedIn($list[$i]['admin_id'])) { 42 42 ?><strong><?php echo date($app->getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) ?></strong><?php 43 43 } 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'])) : ''; 45 45 } 46 46 ?> </td> 47 47 <td class="sc-nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> </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'])); ?> </td>48 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['added_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['added_datetime'])) : ''; ?> </td> 49 49 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> </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'])); ?> </td>50 <td class="sc-nowrap"><?php echo Validator::validateStrDate($list[$i]['modified_datetime']) ? date($app->getParam('date_format'), strtotime($list[$i]['modified_datetime'])) : ''; ?> </td> 51 51 <td class="sc-nowrap"><?php echo oTxt($list[$i]['modified_admin_username'], true); ?> </td> 52 52 <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> </td> -
trunk/services/templates/log_list.ihtml
r320 r457 1 1 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form"> 2 2 <?php $app->printHiddenSession(false); ?> 3 <div id="commandbox">3 <div class="commandbox"> 4 4 <?php if (is_array($logs) && !empty($logs)) { ?> 5 5 <table> -
trunk/services/templates/versions_diff.ihtml
r270 r457 1 <div id="commandbox">1 <div class="commandbox"> 2 2 <?php if (!getFormData('current', false)) { ?> 3 3 <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"> 2 2 <span class="sc-nowrap commanditem"><a href="<?php echo $app->ohref(oTxt($_SERVER['PHP_SELF'])); ?>"><?php echo _("Back to the Versions List"); ?></a></span> 3 3 <?php if (!getFormData('current', false)) { ?> -
trunk/services/versions.php
r396 r457 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 27 27 // require_once dirname(__FILE__) . '/_config.inc.php'; 28 28 29 $app->sslOn(); 29 30 $auth->requireLogin(); 30 $app->sslOn();31 31 32 32 require_once 'codebase/lib/Version.inc.php'; … … 38 38 39 39 // 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); 41 41 42 42 // Query arguments to retain their values between page requests. -
trunk/tests/Auth_SQLTest.php
r396 r457 256 256 $this->assertType('array', $result); 257 257 } 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 273 258 } 274 259 // Running the test.
Note: See TracChangeset
for help on using the changeset viewer.