Exemple #1
0
 *
 * LOVD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LOVD.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
define('ROOT_PATH', './');
define('TAB_SELECTED', 'setup');
require ROOT_PATH . 'inc-init.php';
if ($_AUTH) {
    // If authorized, check for updates.
    require ROOT_PATH . 'inc-upgrade.php';
}
// URL: /logs
// View all log entries.
define('PAGE_TITLE', 'View system log entries');
$_T->printHeader();
$_T->printTitle();
lovd_requireAUTH(LEVEL_MANAGER);
require ROOT_PATH . 'class/object_logs.php';
lovd_includeJS('inc-js-logs.php');
$_DATA = new LOVD_Log();
// Define menu, to delete multiple logs in one go.
print '      <UL id="viewlistMenu_Logs" class="jeegoocontext jeegooviewlist">' . "\n" . '        <LI class="icon"><A click="lovd_AJAX_viewListSubmit(\'Logs\', function(){$.get(\'ajax/delete_log.php?id=selected\', function(sResponse){if(sResponse.substring(0,1) == \'1\'){alert(\'Successfully deleted \' + sResponse.substring(2) + \' log entries.\');lovd_AJAX_viewListSubmit(\'Logs\');}}).fail(function(){alert(\'Log entries could not be deleted.\');});});"><SPAN class="icon" style="background-image: url(gfx/cross.png);"></SPAN>Delete selected entries</A></LI>' . "\n" . '      </UL>' . "\n\n";
$_DATA->viewList('Logs', array(), false, false, true);
// Don't change viewListID, the log's prepareData() and ajax/delete_log.php are referring to it.
$_T->printFooter();
Exemple #2
0
        // Viewing himself!
        $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Update your registration', 1);
        $aNavigation['download/all/mine'] = array('menu_save.png', 'Download all my data', 1);
    } elseif ($_AUTH['level'] >= LEVEL_MANAGER) {
        // Managers and up, not viewing own account, not higher level than other user.
        $aNavigation['download/all/user/' . $nID] = array('menu_save.png', 'Download all this user\'s data', 1);
    }
    if ($_AUTH['id'] == $nID || $_AUTH['level'] > $zData['level']) {
        $aNavigation[CURRENT_PATH . '?share_access'] = array('', 'Share access to ' . ($_AUTH['id'] == $nID ? 'your' : 'user\'s') . ' entries with other users', 1);
    }
    lovd_showJGNavigation($aNavigation, 'Users');
    if ($_AUTH['level'] >= LEVEL_MANAGER) {
        print '<BR><BR>' . "\n\n";
        $_T->printTitle('Log entries by this user', 'H4');
        require ROOT_PATH . 'class/object_logs.php';
        $_DATA = new LOVD_Log();
        $_GET['page_size'] = 10;
        $_GET['search_userid'] = $nID;
        $_DATA->viewList('Logs_for_Users_VE', array('user_', 'del'), true);
    }
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 1 && in_array(ACTION, array('create', 'register'))) {
    // URL: /users?create
    // URL: /users?register
    // Create a new user, or self-register a new submitter.
    define('LOG_EVENT', 'User' . ucfirst(ACTION));
    if (ACTION == 'create') {
        define('PAGE_TITLE', 'Create a new user account');
        // Require manager clearance.