Changeset 432
- Timestamp:
- Nov 2, 2013 11:44:56 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/_config.inc.php
r396 r432 39 39 } 40 40 41 // Set include path .42 ini_set('include_path', 43 PATH_SEPARATOR . '/usr/lib/php'44 . PATH_SEPARATOR . COMMON_BASE45 ) ;41 // Set include path for all templates and libraries. 42 ini_set('include_path', join(PATH_SEPARATOR, array( 43 COMMON_BASE, 44 get_include_path(), 45 ))); 46 46 47 47 // Include core libraries. -
trunk/docs/examples/_config.inc.php
r396 r432 82 82 83 83 'display_errors' => true, 84 'error_reporting' => E_ALL & ~E_DEPRECATED & ~E_STRICT, 84 85 85 86 'log_directory' => COMMON_BASE . '/log', -
trunk/lib/Auth_SQL.inc.php
r421 r432 426 426 } 427 427 428 // Convert 'priv' to 'user_type' nomenclature.429 if (isset($user_data['priv'])) {430 $user_data['user_type'] = $user_data['priv'];431 }432 433 428 // Register authenticated session. 434 429 $_SESSION['_auth_sql'][$this->_ns] = array( -
trunk/services/admins.php
r408 r432 66 66 $so->setColumn('last_name', $auth->getParam('db_table') . '.last_name ASC', $auth->getParam('db_table') . '.last_name DESC'); 67 67 $so->setColumn('email', $auth->getParam('db_table') . '.email ASC', $auth->getParam('db_table') . '.email DESC'); 68 $so->setColumn('user_type', $auth->getParam('db_table') . '.user_type ASC', $auth->getParam('db_table') . '.user_type DESC');69 68 $so->setColumn('seconds_online', $auth->getParam('db_table') . '.seconds_online ASC', $auth->getParam('db_table') . '.seconds_online DESC'); 70 69 $so->setColumn('last_login_datetime', $auth->getParam('db_table') . '.last_login_datetime ASC', $auth->getParam('db_table') . '.last_login_datetime DESC'); … … 230 229 } 231 230 232 if (getFormData('user_type') == 'root' && 'root' != $auth->get('user_type')) {233 $fv->addError('user_type', sprintf(_("You do not have clearance to create a user with root privileges."), null));234 }235 236 231 $fv->numericRange('admin_id', -32768, 32767, _("<strong>Admin id</strong> must be a valid number between -32768 and 32767.")); 237 232 … … 249 244 $fv->stringLength('email', 0, 255, _("<strong>Email</strong> must contain less than 256 characters.")); 250 245 $fv->validateEmail('email'); 251 252 $fv->isEmpty('user_type', _("<strong>User type</strong> cannot be blank."));253 $fv->stringLength('user_type', 0, 255, _("<strong>User type</strong> has an invalid selection."));254 246 } 255 247 … … 265 257 'last_name' => '', 266 258 'email' => '', 267 'user_type' => '',268 259 'seconds_online' => '0', 269 260 'last_login_datetime' => '0000-00-00 00:00:00', … … 322 313 'last_name' => '', 323 314 'email' => '', 324 'user_type' => '',325 315 'seconds_online' => '0', 326 316 'last_login_datetime' => '0000-00-00 00:00:00', … … 362 352 // Get the information for this object. 363 353 $qid = $db->query(" 364 SELECT " . $auth->getParam('db_username_column') . " , user_type from " . $auth->getParam('db_table') . "354 SELECT " . $auth->getParam('db_username_column') . " 365 355 WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($id) . "' 366 356 "); 367 if (! list($name , $user_type) = mysql_fetch_row($qid)) {357 if (! list($name) = mysql_fetch_row($qid)) { 368 358 $app->logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__); 369 359 $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); … … 374 364 $qid = $db->query("SELECT COUNT(*) from " . $auth->getParam('db_table') . ""); 375 365 list($num_admins) = mysql_fetch_row($qid); 376 if ('root' == $user_type && 'root' != $auth->get('user_type')) { 377 // Only root users can delete root users! 378 $app->raiseMsg(_("You do not have clearance to delete a root administrator."), MSG_NOTICE, __FILE__, __LINE__); 379 } else if ($num_admins <= 1) { 366 if ($num_admins <= 1) { 380 367 // There must always be at least one admnistrator! 381 368 $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__); … … 410 397 last_name, 411 398 email, 412 user_type,413 399 added_by_user_id, 414 400 added_datetime … … 418 404 '" . $db->escapeString($frm['last_name']) . "', 419 405 '" . $db->escapeString($frm['email']) . "', 420 '" . $db->escapeString($frm['user_type']) . "',421 406 '" . $db->escapeString($auth->get('user_id')) . "', 422 407 NOW() … … 466 451 last_name = '" . $db->escapeString($frm['last_name']) . "', 467 452 email = '" . $db->escapeString($frm['email']) . "', 468 user_type = '" . $db->escapeString($frm['user_type']) . "',469 453 modified_by_user_id = '" . $db->escapeString($auth->get('user_id')) . "', 470 454 modified_datetime = NOW() -
trunk/services/templates/admin_form.ihtml
r296 r432 43 43 </tr> 44 44 <tr class="sc-form-row"> 45 <td class="sc-right"><label for="user_type" class="<?php $fv->err('user_type'); ?>"><?php echo _("User type"); ?></label></td>46 <td>47 <select name="user_type" class="sc-small">48 <?php printSetSelectForm($auth->getParam('db_table'), 'user_type', $frm['user_type'], true); ?>49 </select>50 </td>51 </tr>52 <tr class="sc-form-row">53 45 <td> </td> 54 46 <td><?php printSubmitButtons($frm['submit_buttons']); ?></td> -
trunk/services/templates/admin_list.ihtml
r320 r432 21 21 <th><?php echo $so->printSortHeader('admin_tbl.username', _("Username"), 'ASC'); ?></th> 22 22 <th><?php echo $so->printSortHeader('admin_tbl.first_name', _("First"), 'ASC'); ?> <?php echo $so->printSortHeader('admin_tbl.last_name', _("Last name"), 'ASC'); ?></th> 23 <th><?php echo $so->printSortHeader('admin_tbl.user_type', _("User type"), 'ASC'); ?></th>24 23 <th><?php echo $so->printSortHeader('admin_tbl.seconds_online', _("Min online"), 'ASC'); ?></th> 25 24 <th><?php echo $so->printSortHeader('admin_tbl.last_login_datetime', _("Last login"), 'ASC'); ?></th> 26 25 <th><?php echo $so->printSortHeader('admin_tbl.last_login_ip', _("Remote host"), 'ASC'); ?></th> 27 26 <th><?php echo $so->printSortHeader('admin_tbl.added_datetime', _("Added"), 'ASC'); ?></th> 28 <th><?php echo $so->printSortHeader('admin_tbl.added_by_user_id', _("by admin"), 'ASC'); ?></th>27 <th><?php echo $so->printSortHeader('admin_tbl.added_by_user_id', _("by"), 'ASC'); ?></th> 29 28 <th><?php echo $so->printSortHeader('admin_tbl.modified_datetime', _("Last modified"), 'ASC'); ?></th> 29 <th><?php echo $so->printSortHeader('admin_tbl.modified_by_user_id', _("by"), 'ASC'); ?></th> 30 30 <th> </th> 31 31 </tr> … … 37 37 <td class="sc-nowrap"><?php echo oTxt($list[$i]['username'], true); ?> </td> 38 38 <td class="sc-nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> </td> 39 <td class="sc-nowrap"><?php echo oTxt($list[$i]['user_type'], true); ?> </td>40 39 <td class="sc-nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> </td> 41 40 <td class="sc-nowrap"><?php … … 50 49 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> </td> 51 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> 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> 53 53 </tr>
Note: See TracChangeset
for help on using the changeset viewer.