$sql .= 'ORDER BY 1 ASC'; } if ($length > 0) { $sql .= " LIMIT " . $start . ',' . $length; } // This becomes a JSON list, not a JSON array, so we need numeric keys. $data = WT_DB::prepare($sql)->execute($args)->fetchAll(PDO::FETCH_NUM); // Reformat the data for display foreach ($data as &$datum) { $site_access_rule_id = $datum[7]; $user_agent = $datum[4]; $datum[0] = edit_field_inline('site_access_rule-ip_address_start-' . $site_access_rule_id, $datum[0]); $datum[2] = edit_field_inline('site_access_rule-ip_address_end-' . $site_access_rule_id, $datum[2]); $datum[4] = edit_field_inline('site_access_rule-user_agent_pattern-' . $site_access_rule_id, $datum[4]); $datum[5] = select_edit_control_inline('site_access_rule-rule-' . $site_access_rule_id, array('allow' => WT_I18N::translate('allow'), 'deny' => WT_I18N::translate('deny'), 'robot' => WT_I18N::translate('robot')), null, $datum[5]); $datum[6] = edit_field_inline('site_access_rule-comment-' . $site_access_rule_id, $datum[6]); $datum[7] = '<i class="icon-delete" onclick="if (confirm(\'' . WT_Filter::escapeHtml(WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($user_agent))) . '\')) { document.location=\'' . WT_SCRIPT_NAME . '?action=delete&site_access_rule_id=' . $site_access_rule_id . '\'; }"></i>'; } // Total filtered/unfiltered rows $recordsFiltered = WT_DB::prepare("SELECT FOUND_ROWS()")->fetchOne(); $recordsTotal = WT_DB::prepare("SELECT COUNT(*) FROM `##site_access_rule` WHERE rule <> 'unknown'")->fetchOne(); header('Content-type: application/json'); echo json_encode(array('draw' => WT_Filter::getInteger('draw'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data)); exit; case 'load_unknown': Zend_Session::writeClose(); // AJAX callback for datatables $search = WT_Filter::get('search'); $search = $search['value']; $start = WT_Filter::getInteger('start'); $length = WT_Filter::getInteger('length');
echo '<dt>', WT_I18N::translate('Visible to other users when online'), '</dt>'; echo '<dd>', edit_field_yes_no_inline('user_setting-' . $user_id . '-visibleonline', $user->getSetting('visibleonline')), '</dd>'; echo '<dt>', WT_I18N::translate('Comments'), '</dt>'; echo '<dd>', edit_field_inline('user_setting-' . $user_id . '-comment', $user->getSetting('comment')), '</dd>'; echo '<dt>', WT_I18N::translate('My page'), '</dt>'; echo '<dd><a href="#" onclick="modalDialog(\'index_edit.php?user_id=' . $user_id . '\', \'', WT_I18N::translate('Change the blocks on this page'), '\');">', WT_I18N::translate('Change the blocks on this page'), '</a></dd>'; // Masquerade as others users - but not other administrators if (!Auth::isAdmin($user)) { echo '<dt>', WT_I18N::translate('Masquerade as this user'), '</dt>'; echo '<dd><a href="#" onclick="return masquerade(', $user_id, ')">', WT_I18N::translate('masquerade'), '</a></dd>'; } echo '</dl>'; // Column One - details echo '<div id="access">', '<h2>', WT_I18N::translate('Family tree access and settings'), '</h2>', '<table><tr>', '<th>', WT_I18N::translate('Family tree'), '</th>', '<th>', WT_I18N::translate('Default individual'), help_link('default_individual'), '</th>', '<th>', WT_I18N::translate('Individual record'), help_link('useradmin_gedcomid'), '</th>', '<th>', WT_I18N::translate('Role'), help_link('role'), '</th>', '<th>', WT_I18N::translate('Restrict to immediate family'), help_link('RELATIONSHIP_PATH_LENGTH'), '</th>', '</tr>'; foreach (WT_Tree::getAll() as $tree) { echo '<tr><td>', $tree->tree_title_html, '</td><td>', edit_field_inline('user_gedcom_setting-' . $user_id . '-' . $tree->tree_id . '-rootid', $tree->userPreference($user_id, 'rootid')), '</td><td>', edit_field_inline('user_gedcom_setting-' . $user_id . '-' . $tree->tree_id . '-gedcomid', $tree->userPreference($user_id, 'gedcomid')), '</td><td>', select_edit_control_inline('user_gedcom_setting-' . $user_id . '-' . $tree->tree_id . '-canedit', $ALL_EDIT_OPTIONS, null, $tree->userPreference($user_id, 'canedit')), '</td><td>', select_edit_control_inline('user_gedcom_setting-' . $user_id . '-' . $tree->tree_id . '-RELATIONSHIP_PATH_LENGTH', array(0 => WT_I18N::translate('no'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10), null, $tree->userPreference($user_id, 'RELATIONSHIP_PATH_LENGTH')), '</td></tr>'; } echo '</table>'; exit; case 'createuser': if (!WT_Filter::checkCsrf()) { $action = 'createform'; } elseif (User::findByIdentifier($username)) { WT_FlashMessages::addMessage(WT_I18N::translate('Duplicate user name. A user with that user name already exists. Please choose another user name.')); $action = 'createform'; } elseif (User::findByIdentifier($emailaddress)) { WT_FlashMessages::addMessage(WT_I18N::translate('Duplicate email address. A user with that email already exists.')); $action = 'createform'; } elseif ($pass1 != $pass2) { WT_FlashMessages::addMessage(WT_I18N::translate('Passwords do not match.')); $action = 'createform';
<?php echo WT_I18N::translate('To use a Google mail account, use the following settings: server=smtp.gmail.com, port=587, security=tls, username=xxxxx@gmail.com, password=[your gmail password]'); ?> </p> </div> <div id="login"> <table> <tr> <td> <dl> <dt><?php echo WT_I18N::translate('Login URL'), help_link('LOGIN_URL'); ?> </dt> <dd><?php echo edit_field_inline('site_setting-LOGIN_URL', WT_Site::preference('LOGIN_URL'), $controller); ?> </dd> <dt><?php echo WT_I18N::translate('Welcome text on login page'), help_link('WELCOME_TEXT_AUTH_MODE'); ?> </dt> <dd><?php echo select_edit_control_inline('site_setting-WELCOME_TEXT_AUTH_MODE', $WELCOME_TEXT_AUTH_MODE_OPTIONS, null, WT_Site::preference('WELCOME_TEXT_AUTH_MODE'), $controller); ?> </dd> <dt><?php echo WT_I18N::translate('Custom welcome text'), ' — ', WT_LOCALE, help_link('WELCOME_TEXT_AUTH_MODE_CUST'); ?>