예제 #1
0
파일: users.php 프로젝트: LOVDnl/LOVD3
 lovd_requireAUTH();
 lovd_isAuthorized('gene', $_AUTH['curates']);
 // Enables LEVEL_COLLABORATOR and LEVEL_CURATOR for object_users.php.
 if ($nID == '00000') {
     $nID = -1;
 } elseif ($nID == $_AUTH['id'] && $_AUTH['level'] == LEVEL_SUBMITTER && isset($_GET['new_submitter'])) {
     // Newly registered? Explain where to submit.
     lovd_showDialog('dialog_new_submitter', 'Now that you\'ve registered', 'Now that you\'ve registered, you can submit new variant data to this database.<BR>You can do so, by clicking the Submit menu tab just above this message.', 'information', array('position' => '{my:"left top",at:"left bottom",of:"#tab_submit"}', 'buttons' => '{"Go there now":function(){window.location.href="' . lovd_getInstallURL() . 'submit";},"Close":function(){$(this).dialog("close");}}'));
 }
 // 2014-03-13; 3.0-10; Users viewing their own profile should see a lot more...
 if ($_AUTH['id'] == $nID && $_AUTH['level'] < LEVEL_CURATOR) {
     $_AUTH['level'] = LEVEL_CURATOR;
 }
 require ROOT_PATH . 'class/object_users.php';
 $_DATA = new LOVD_User();
 $zData = $_DATA->viewEntry($nID);
 $aNavigation = array();
 // Since we're faking the user's level to show some more columns when the user is viewing himself, we must put the check on the ID here.
 if ($_AUTH['id'] != $nID && $_AUTH['level'] > $zData['level']) {
     // Authorized user is logged in. Provide tools.
     $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit user', 1);
     if ($zData['active']) {
         $aNavigation[CURRENT_PATH . '?boot'] = array('', 'Force user log out', 1);
     }
     if ($zData['locked']) {
         $aNavigation[CURRENT_PATH . '?unlock'] = array('check.png', 'Unlock user', 1);
     } else {
         $aNavigation[CURRENT_PATH . '?lock'] = array('status_locked.png', 'Lock user', 1);
         // FIXME; this image is actually too small but it doesn't look too bad.
     }
     $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete user', 1);