Changeset 467 for branches/eli_branch/services
- Timestamp:
- Feb 19, 2014 2:28:00 AM (10 years ago)
- Location:
- branches/eli_branch
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch
-
branches/eli_branch/services/admins.php
r438 r467 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/PageNumbers.inc.php'; … … 282 282 $app =& App::getInstance(); 283 283 $db =& DB::getInstance(); 284 284 285 285 $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id); 286 286 if ($lock->isLocked() && !$lock->isMine()) { … … 341 341 $app =& App::getInstance(); 342 342 $db =& DB::getInstance(); 343 343 344 344 $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id); 345 345 if ($lock->isLocked() && !$lock->isMine()) { … … 353 353 $qid = $db->query(" 354 354 SELECT " . $auth->getParam('db_username_column') . " 355 FROM " . $auth->getParam('db_table') . " 355 356 WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($id) . "' 356 357 "); … … 386 387 $app =& App::getInstance(); 387 388 $db =& DB::getInstance(); 388 389 389 390 // Remove any stale cached list data. 390 391 $cache->delete('list'); … … 429 430 $app =& App::getInstance(); 430 431 $db =& DB::getInstance(); 431 432 432 433 $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id']); 433 434 if ($lock->isLocked() && !$lock->isMine()) { … … 474 475 global $auth; 475 476 $db =& DB::getInstance(); 476 477 477 478 $where_clause = ''; 478 479 … … 508 509 SELECT 509 510 " . $auth->getParam('db_table') . ".*, 510 " . $auth->getParam('db_table') . "." . $auth->getParam('db_primary_key') . " AS admin_id, 511 " . $auth->getParam('db_table') . "." . $auth->getParam('db_primary_key') . " AS admin_id, 511 512 a1." . $auth->getParam('db_username_column') . " AS added_admin_username, 512 513 a2." . $auth->getParam('db_username_column') . " AS modified_admin_username … … 536 537 return $list; 537 538 } 538 539 539 540 // The list was not cached, so issue the real query. 540 541 $qid = $db->query($sql); -
branches/eli_branch/services/lock.php
r438 r467 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)) { -
branches/eli_branch/services/login.php
r447 r467 32 32 $app->sslOn(); 33 33 34 $frm['username'] = getFormdata('username'); 34 require_once 'codebase/lib/Prefs.inc.php'; 35 $login_prefs = new Prefs('login'); 36 $login_prefs->setDefaults(array('username' => '')); 37 38 if ('' != $login_prefs->get('username')) { 39 $frm['remember_me'] = '1'; 40 } 41 42 $frm['username'] = getFormdata('username', $login_prefs->get('username')); 35 43 $frm['password'] = getFormdata('password'); 36 44 … … 39 47 40 48 if ($auth->login($frm['username'], $frm['password'])) { 49 if (getFormData('remember_me')) { 50 $login_prefs->set('username', getFormData('username')); 51 } else { 52 $login_prefs->set('username', ''); 53 } 41 54 $app->raiseMsg(_("You are now logged in."), MSG_SUCCESS, __FILE__, __LINE__); 42 55 $app->dieBoomerangURL('login'); -
branches/eli_branch/services/logs.php
r438 r467 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. -
branches/eli_branch/services/templates/admin_list.ihtml
r432 r467 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> -
branches/eli_branch/services/templates/log_list.ihtml
r320 r467 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> -
branches/eli_branch/services/templates/login_form.ihtml
r421 r467 17 17 </td> 18 18 </tr> 19 <tr class="sc-form-row"> 20 <td class="sc-right"> </td> 21 <td> 22 <label class="sc-label-secondary"><input type="checkbox" name="remember_me" id="remember_me" value="1"<?php frmChecked($frm['remember_me']) ?> /> <?php echo _("Remember my username"); ?></label> 23 </td> 24 </tr> 19 25 <tr> 20 26 <td> </td> … … 23 29 </table> 24 30 </form> 31 <script type="text/javascript" charset="utf-8"> 32 /* <![CDATA[ */ 33 $(document).ready(function() { 34 if ($('input[name="username"]').val() != '') { 35 $('input[name="password"]').focus(); 36 } else { 37 $('input[name="username"]').focus(); 38 } 39 }); 40 /* ]]> */ 41 </script> -
branches/eli_branch/services/templates/versions_diff.ihtml
r270 r467 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> -
branches/eli_branch/services/templates/versions_view.ihtml
r365 r467 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)) { ?> -
branches/eli_branch/services/versions.php
r438 r467 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.
Note: See TracChangeset
for help on using the changeset viewer.