Ignore:
Timestamp:
Feb 19, 2014 2:28:00 AM (10 years ago)
Author:
anonymous
Message:

Merged in changes from trunk to finish Eli's branch.

Location:
branches/eli_branch
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch

  • branches/eli_branch/services/admins.php

    r438 r467  
    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/PageNumbers.inc.php';
     
    282282    $app =& App::getInstance();
    283283    $db =& DB::getInstance();
    284    
     284
    285285    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id);
    286286    if ($lock->isLocked() && !$lock->isMine()) {
     
    341341    $app =& App::getInstance();
    342342    $db =& DB::getInstance();
    343    
     343
    344344    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id);
    345345    if ($lock->isLocked() && !$lock->isMine()) {
     
    353353    $qid = $db->query("
    354354        SELECT " . $auth->getParam('db_username_column') . "
     355        FROM " . $auth->getParam('db_table') . "
    355356        WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($id) . "'
    356357    ");
     
    386387    $app =& App::getInstance();
    387388    $db =& DB::getInstance();
    388    
     389
    389390    // Remove any stale cached list data.
    390391    $cache->delete('list');
     
    429430    $app =& App::getInstance();
    430431    $db =& DB::getInstance();
    431    
     432
    432433    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id']);
    433434    if ($lock->isLocked() && !$lock->isMine()) {
     
    474475    global $auth;
    475476    $db =& DB::getInstance();
    476    
     477
    477478    $where_clause = '';
    478479
     
    508509        SELECT
    509510            " . $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,
    511512            a1." . $auth->getParam('db_username_column') . " AS added_admin_username,
    512513            a2." . $auth->getParam('db_username_column') . " AS modified_admin_username
     
    536537        return $list;
    537538    }
    538    
     539
    539540    // The list was not cached, so issue the real query.
    540541    $qid = $db->query($sql);
  • branches/eli_branch/services/lock.php

    r438 r467  
    2828require_once 'codebase/lib/Lock.inc.php';
    2929
     30$app->sslOn();
    3031$auth->requireLogin();
    31 $app->sslOn();
    3232
    3333if (getFormData('boomerang', false)) {
  • branches/eli_branch/services/login.php

    r447 r467  
    3232$app->sslOn();
    3333
    34 $frm['username'] = getFormdata('username');
     34require_once 'codebase/lib/Prefs.inc.php';
     35$login_prefs = new Prefs('login');
     36$login_prefs->setDefaults(array('username' => ''));
     37
     38if ('' != $login_prefs->get('username')) {
     39    $frm['remember_me'] = '1';
     40}
     41
     42$frm['username'] = getFormdata('username', $login_prefs->get('username'));
    3543$frm['password'] = getFormdata('password');
    3644
     
    3947
    4048    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        }
    4154        $app->raiseMsg(_("You are now logged in."), MSG_SUCCESS, __FILE__, __LINE__);
    4255        $app->dieBoomerangURL('login');
  • branches/eli_branch/services/logs.php

    r438 r467  
    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.
  • branches/eli_branch/services/templates/admin_list.ihtml

    r432 r467  
    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>
  • branches/eli_branch/services/templates/log_list.ihtml

    r320 r467  
    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>
  • branches/eli_branch/services/templates/login_form.ihtml

    r421 r467  
    1717        </td>
    1818    </tr>
     19    <tr class="sc-form-row">
     20        <td class="sc-right">&nbsp;</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>
    1925    <tr>
    2026        <td>&nbsp;</td>
     
    2329</table>
    2430</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">
    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>
  • branches/eli_branch/services/templates/versions_view.ihtml

    r365 r467  
    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)) { ?>
  • branches/eli_branch/services/versions.php

    r438 r467  
    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.
Note: See TracChangeset for help on using the changeset viewer.