コード例 #1
0
ファイル: genes.php プロジェクト: LOVDnl/LOVD3
 lovd_errorPrint();
 if (ACTION == 'authorize') {
     // Show viewList() of users that are NO curator or collaborator at this moment.
     require ROOT_PATH . 'class/object_users.php';
     $_DATA = new LOVD_User();
     lovd_showInfoTable('The following users are currently not a curator for this gene. Click on a user to select him/her as Curator or Collaborator.', 'information');
     if ($aCurators) {
         // Create search string that hides the users currently selected to be curator or collaborator.
         $_GET['search_id'] = '!' . implode(' !', array_keys($aCurators));
     } else {
         // We must have something non-empty here, otherwise the JS fails when selecting users.
         $_GET['search_id'] = '!0';
     }
     $_GET['page_size'] = 10;
     $_DATA->setRowLink('Genes_AuthorizeUser', 'javascript:lovd_passAndRemoveViewListRow("{{ViewListID}}", "{{ID}}", {id: "{{ID}}", name: "{{zData_name}}", level: "{{zData_level}}"}, lovd_authorizeUser); return false;');
     $_DATA->viewList('Genes_AuthorizeUser', array('id', 'status_', 'last_login_', 'created_date_'), true);
     // Create known viewListID for lovd_unauthorizeUser().
     // Show curators, to sort and to select whether or not they can edit.
     print '      <BR><BR>' . "\n\n";
     lovd_showInfoTable('All users below have access to all data (public and non-public) of the ' . $sID . ' gene database. If you don\'t want to give the user access to <I>edit</I> any of the data that is not their own, deselect the "Allow edit" checkbox. Please note that users with level Manager or higher, cannot be restricted in their right to edit all information in the database.<BR>Users without edit rights are called Collaborators. Users having edit rights are called Curators; they receive email notifications of new submission and are shown on the gene\'s home page by default. You can disable that below by deselecting the "Shown" checkbox next to their name. To sort the list of curators for this gene, click and drag the <IMG src="gfx/drag_vertical.png" alt="" width="5" height="13"> icon up or down the list. Release the mouse button in the preferred location.', 'information');
 } else {
     lovd_showInfoTable('To sort the list of curators for this gene, click and drag the <IMG src="gfx/drag_vertical.png" alt="" width="5" height="13"> icon up or down the list. Release the mouse button in the preferred location. If you do not want a user to be shown on the list of curators on the gene homepage and on the top of the screen, deselect the checkbox on the right side of his/her name.', 'information');
 }
 // Form & table.
 print '      <TABLE class="sortable_head" style="width : 552px;"><TR><TH width="15">&nbsp;</TH><TH>Name</TH>';
 if (ACTION == 'authorize') {
     print '<TH width="100" style="text-align:right;">Allow edit</TH><TH width="75" style="text-align:right;">Shown</TH><TH width="30">&nbsp;</TH>';
 } else {
     print '<TH width="75" style="text-align:right;">Shown</TH>';
 }
 print '</TR></TABLE>' . "\n" . '      <FORM action="' . $_PE[0] . '/' . $sID . '?' . ACTION . '" method="post">' . "\n" . '        <UL id="curator_list" class="sortable" style="margin-top : 0px; width : 550px;">' . "\n";
コード例 #2
0
ファイル: users.php プロジェクト: LOVDnl/LOVD3
    }
    list($aColleagues, $sColTable) = lovd_colleagueTableHTML($nID, $sUserListID, $aColleagues, $bAllowGrantEdit);
    $_T->printHeader();
    $_T->printTitle();
    lovd_errorPrint();
    lovd_showInfoTable('To share access with other users, find the user in the list below, click on
                       the user to add him to the selection. Then click <B>save</B> to save the
                       changes.', 'information');
    // Set number of items per page for viewlist.
    $_GET['page_size'] = 10;
    // Set filter for viewlist to hide current colleagues and the user being viewed.
    $_GET['search_userid'] = '!' . $nID;
    foreach ($aColleagues as $aColleague) {
        $_GET['search_userid'] .= ' !' . $aColleague['id'];
    }
    // Show viewlist to select new users to share access with.
    $_DATA = new LOVD_User();
    $_DATA->setRowLink('users_share_access', 'javascript:lovd_passAndRemoveViewListRow("{{ViewListID}}", "{{ID}}", {id: "{{ID}}", name: "{{zData_name}}"}, lovd_addUserShareAccess); return false;');
    // The columns hidden here are also specified (enforced) in ajax/viewlist.php to make sure Submitters can't hack their way into the users table.
    $_DATA->viewList($sUserListID, array('username', 'status_', 'last_login_', 'created_date_', 'curates', 'level_'), true);
    lovd_showInfoTable('<B>' . $zData['name'] . ' (' . $nID . ')</B> shares access to all
                       data owned by him with the users listed below.', 'information');
    print '<FORM action="users/' . $nID . '?share_access" method="post">' . "\n";
    // Array which will make up the form table.
    print $sColTable . "\n";
    $aForm = array(array('POST', '', '', '', '0%', '0', '100%'), array('', '', 'print', 'Enter your password for authorization'), array('', '', 'password', 'password', 20), array('', '', 'print', '<INPUT type="submit" value="Save access permissions">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit" value="Cancel" onclick="window.location.href=\'' . lovd_getInstallURL() . $_PE[0] . '/' . $nID . '\'; return false;" style="border : 1px solid #FF4422;">'));
    lovd_viewForm($aForm);
    print '</FORM>';
    $_T->printFooter();
    exit;
}