Ignore:
Timestamp:
Sep 15, 2014 9:44:27 PM (10 years ago)
Author:
anonymous
Message:

Beginning the process of adapting codebase to foundation styles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/admins.php

    r479 r497  
    3434require_once 'codebase/lib/FormValidator.inc.php';
    3535require_once 'codebase/lib/SortOrder.inc.php';
    36 require_once 'codebase/lib/TemplateGlue.inc.php';
     36require_once 'codebase/lib/HTML.inc.php';
    3737require_once 'codebase/lib/Prefs.inc.php';
    3838require_once 'codebase/lib/Lock.inc.php';
     
    229229    }
    230230
    231     $fv->numericRange('admin_id', -32768, 32767, _("<strong>Admin id</strong> must be a valid number between -32768 and 32767."));
     231    $fv->numericRange('admin_id', 0, 32767, _("<strong>Admin id</strong> must be a valid number between 0 and 32767."));
    232232
    233233    $fv->isEmpty('username', _("<strong>Username</strong> cannot be blank."));
     
    235235
    236236    $fv->isEmpty('userpass', _("<strong>Passwords</strong> cannot be blank."));
    237     $fv->stringLength('userpass', 6, 36, _("<strong>Passwords</strong> must be between 6 and 36 characters long."));
     237    $fv->stringLength('userpass', 8, 36, _("<strong>Passwords</strong> must be between 8 and 36 characters long."));
    238238
    239239    $fv->stringLength('first_name', 0, 255, _("<strong>First name</strong> must contain less than 256 characters."));
     
    242242
    243243    $fv->isEmpty('email', _("<strong>Email</strong> cannot be blank."));
    244     $fv->stringLength('email', 0, 255, _("<strong>Email</strong> must contain less than 256 characters."));
    245244    $fv->validateEmail('email');
    246245}
     
    267266        'new_op' => 'insert',
    268267        'submit_buttons' => array(
    269             'submit' => _("Add Administrator"),
    270             'repeat' => _("Add &amp; repeat"),
    271             'cancel' => _("Cancel"),
     268            array('name' => 'submit', 'value' => _("Add Administrator"), 'class' => 'small button', 'accesskey' => 's'),
     269            array('name' => 'repeat', 'value' => _("Add &amp; repeat"), 'class' => 'small button secondary', 'accesskey' => 'r'),
     270            array('name' => 'cancel', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'),
    272271        ),
    273272    );
     
    280279    global $auth;
    281280    global $lock;
     281    global $locally_carried_queries;
    282282    $app =& App::getInstance();
    283283    $db =& DB::getInstance();
     
    324324        'old_username' => $frm['username'],
    325325        'submit_buttons' => array(
    326             'submit' => _("Save changes"),
    327             'repeat' => _("Save &amp; edit next"),
    328             'reset' => _("Reset"),
    329             'cancel' => _("Cancel"),
     326            array('name' => 'submit', 'value' => _("Save changes"), 'class' => 'small button', 'accesskey' => 's'),
     327            array('name' => 'repeat', 'value' => _("Save & edit next"), 'class' => 'small button secondary', 'accesskey' => 'e'),
     328            array('name' => 'reset', 'value' => _("Reset"), 'class' => 'small button secondary', 'accesskey' => 'r'),
     329            array('name' => 'cancel', 'value' => _("Cancel"), 'class' => 'small button secondary', 'accesskey' => 'c'),
    330330        ),
    331     ), $frm, array('userpass' => '****************'));
     331    ), $frm, array('userpass' => '•••••••••••••••'));
    332332
    333333    return $frm;
     
    339339    global $lock;
    340340    global $cache;
     341    global $locally_carried_queries;
    341342    $app =& App::getInstance();
    342343    $db =& DB::getInstance();
     
    367368    if ($num_admins <= 1) {
    368369        // There must always be at least one admnistrator!
    369         $app->raiseMsg(_("You cannot delete the only administrator in the database. There must be at least one to log in and create other users."), MSG_NOTICE, __FILE__, __LINE__);
     370        $app->raiseMsg(_("You cannot delete the only user in the database. There must be at least one to log in and create other users."), MSG_NOTICE, __FILE__, __LINE__);
    370371    } else if ($auth->get('user_id') == $id) {
    371372        // Do not delete yourself!
     
    418419    $version->create($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $last_insert_id, $frm['username']);
    419420
    420     $app->raiseMsg(sprintf(_("The Administrator <em>%s</em> has been added."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
     421    $app->raiseMsg(sprintf(_("The user <em>%s</em> has been added."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
    421422
    422423    return $last_insert_id;
     
    461462    $version->create($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id'], $frm['username']);
    462463
    463     $app->raiseMsg(sprintf(_("The Administrator <em>%s</em> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
     464    $app->raiseMsg(sprintf(_("The user <em>%s</em> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
    464465
    465466    // Unlock record.
Note: See TracChangeset for help on using the changeset viewer.