Exemplo n.º 1
0
         } else {
             $datum[10] = WT_I18N::translate('Never');
         }
         $datum[11] = edit_field_yes_no_inline('user_setting-' . $user_id . '-verified-', $datum[11]);
         $datum[12] = edit_field_yes_no_inline('user_setting-' . $user_id . '-verified_by_admin-', $datum[12]);
         // Add extra column for "delete" action
         if ($user_id != WT_USER_ID) {
             $datum[13] = '<div class="icon-delete" onclick="delete_user(\'' . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs($user_name)) . '\', \'' . WT_Filter::escapeJs($user_id) . '\');"></div>';
         } else {
             // Do not delete ourself!
             $datum[13] = '';
         }
     }
     // Total filtered/unfiltered rows
     $recordsFiltered = WT_DB::prepare("SELECT FOUND_ROWS()")->fetchOne();
     $recordsTotal = User::count();
     Zend_Session::writeClose();
     header('Content-type: application/json');
     echo json_encode(array('draw' => WT_Filter::getInteger('draw'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data));
     exit;
 case 'load1row':
     // Generate an AJAX response for datatables to load expanded row
     $user_id = WT_Filter::getInteger('user_id');
     $user = User::find($user_id);
     Zend_Session::writeClose();
     header('Content-type: text/html; charset=UTF-8');
     echo '<h2>', WT_I18N::translate('Details'), '</h2>';
     echo '<dl>';
     echo '<dt>', WT_I18N::translate('Administrator'), '</dt>';
     echo '<dd>', edit_field_yes_no_inline('user_setting-' . $user_id . '-canadmin', $user->getSetting('canadmin')), '</dd>';
     echo '<dt>', WT_I18N::translate('Password'), '</dt>';
Exemplo n.º 2
0
    // Cannot determine the latest version
    $latest_version = '';
}
// Delete old files (if we can).
$old_files = array();
foreach (old_paths() as $path) {
    if (file_exists($path)) {
        delete_recursively($path);
        // we may not have permission to delete.  Is it still there?
        if (file_exists($path)) {
            $old_files[] = $path;
        }
    }
}
// Total number of users
$total_users = User::count();
// Total number of administrators
$total_administrators = WT_DB::prepare("SELECT COUNT(*) FROM `##user_setting` WHERE setting_name='canadmin' AND setting_value=1")->fetchOne();
// Total numbers of managers
$total_managers = WT_DB::prepare("SELECT gs.setting_value, COUNT(*)" . " FROM `##gedcom_setting` gs" . " JOIN `##user_gedcom_setting` ugs USING (gedcom_id)" . " WHERE ugs.setting_name = 'canedit' AND ugs.setting_value='admin'" . " AND   gs.setting_name ='title'" . " GROUP BY gedcom_id" . " ORDER BY gs.setting_value")->fetchAssoc();
// Number of users who have not verified their email address
$unverified = WT_DB::prepare("SELECT COUNT(*) FROM `##user_setting` WHERE setting_name='verified' AND setting_value=0")->fetchOne();
// Number of users whose accounts are not approved by an administrator
$unapproved = WT_DB::prepare("SELECT COUNT(*) FROM `##user_setting` WHERE setting_name='verified_by_admin' AND setting_value=0")->fetchOne();
// Number of users of each language
$user_languages = WT_DB::prepare("SELECT setting_value, COUNT(*)" . " FROM `##user_setting`" . " WHERE setting_name = 'language'" . " GROUP BY setting_value")->fetchAssoc();
$stats = new WT_Stats(WT_GEDCOM);
?>
<div id="content_container" style="visibility: hidden;">
	<div id="x">
		<h2><?php