Exemplo n.º 1
0
function viewInvitations()
{
    global $debug, $message, $success;
    $output = '	<div class="textLeft" id="viewInvitationsReturn">';
    $class = 'rowAlt';
    $getInvitationsQuery = "SELECT\n\tfolders.folderName AS 'folderName',\n\tinvitations.invitationId AS 'invitationId',\n\tinvitations.folderRoleId AS 'folderRoleId',\n\tinvitations.email AS 'email',\n\tinvitations.listRoleId AS 'listRoleId',\n\tDATE_FORMAT(invitations.sentDate, '%b %e, %Y %l:%i %p') AS 'sentDate',\n\tDATE_FORMAT(invitations.responded, '%b %e, %Y %l:%i %p') AS 'responded',\n\tlists.listName AS 'listName'\nFROM\n\tinvitations\nLEFT JOIN\n\tlists ON lists.listId = invitations.listId\nJOIN\n\tfolders ON folders.folderId = invitations.folderId AND\n\tinvitations.senderId = '" . $_SESSION['userId'] . "'\nORDER BY\n\t(SELECT userSiteSettings.folderLinksOrderBy FROM userSiteSettings WHERE userSiteSettings.userId = '" . $_SESSION['userId'] . "')";
    if ($result = mysql_query($getInvitationsQuery)) {
        if (mysql_affected_rows() == 0) {
            $message .= 'You haven\'t sent any invitations.';
            pdoError(__LINE__, $getInvitationsQuery, '$getInvitationsQuery', 1);
        } else {
            $output .= '	<div class="break relative" style="width:100%">
		<div class="rowTitle" style="width:140px; padding-left:5px"><br>
Email</div>
		<div class="rowTitle" style="width:120px">Invited to Folder</div>
		<div class="rowTitle" style="width:80px">Folder Role</div>
		<div class="rowTitle" style="width:130px"><br>
Invited to ADR List</div>
		<div class="rowTitle" style="width:80px">List Role</div>
		<div class="rowTitle" style="width:110px"><br>
Sent</div>
		<div class="rowTitle" style="width:110px"><br>
Responded</div>
	</div>';
            while ($row = mysql_fetch_assoc($result)) {
                if ($class == 'rowWhite') {
                    $class = 'rowAlt';
                } else {
                    $class = 'rowWhite';
                }
                $responded = empty($row['responded']) ? 'No response' : $row['responded'];
                $listName = empty($row['listName']) ? '&nbsp;' : $row['listName'];
                $output .= '	<div class="break relative ' . $class . '">
		<div class="row" style="width:140px; padding-left:5px"><img alt="" class="left" height="16" id="deleteInvitation' . $row['invitationId'] . '" onClick="" src="' . LINKIMAGES . '/xRed.png" width="16"> ' . breakEmail($row['email'], 16) . '</div>
		<div class="row" style="width:120px">' . $row['folderName'] . '</div>
		<div class="row" style="width:80px;">' . roles($row['folderRoleId']) . '</div>
		<div class="row" style="width:130px">' . $listName . '</div>
		<div class="row" style="width:80px">' . roles($row['listRoleId']) . '</div>
		<div class="row textSmall" style="width:110px">' . $row['sentDate'] . '</div>
		<div class="row textSmall" style="width:110px">' . $responded . '</div>
	</div>
';
            }
            $output .= '		</table>
</div>';
            $success = true;
            $returnThis['returnViewInvitations'] = $output;
        }
    } else {
        error(__LINE__);
        pdoError(__LINE__, $getInvitationsQuery, '$getInvitationsQuery');
    }
    if (MODE == 'viewInvitations') {
        returnData();
    } else {
        return $output;
    }
}
Exemplo n.º 2
0
/**
 * Processes event permissions from the role configuration array. Triggered by the 'ready','system' event.
 * This is to make sure that all plugins' init functions have been executed, and all event handlers have already been initialized
 * @return void
 */
function roles_events_permissions()
{
    $role = roles_get_role();
    if (!$role instanceof ElggRole) {
        return;
    }
    return roles()->setupEvents($role);
}
Exemplo n.º 3
0
 /**
  * 
  * Checks if this role is a reserved role
  * @return boolean True if the current role is a reserved role
  */
 public function isReservedRole()
 {
     return roles()->isReservedRoleName($this->name);
 }
Exemplo n.º 4
0
function is($roles)
{
    $currentUserRoles = roles();
    # When input is string
    if (is_string($roles)) {
        if (in_array($roles, $currentUserRoles)) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
Exemplo n.º 5
0
/**
 * Checks if a permission rule should be executed for the current context
 *
 * @param string  $permission_details The permission rule configuration
 * @param boolean $strict             If strict context matching should be used.
 * 							          If true, only the last context will be checked for the rule matching.
 * 							          If false, any context value in the context stack will be considered.
 * @return bool True if the rule should be executed, false otherwise
 */
function roles_check_context($permission_details, $strict = false)
{
    return roles()->checkContext($permission_details, $strict);
}
Exemplo n.º 6
0
 public function _validate_role($role)
 {
     if (!$role || !in_array($role, roles())) {
         $this->form_validation->set_message('_validate_role', 'Please select a valid %s.');
         return FALSE;
     }
     if ($role !== ROLE_SUPERUSER) {
         $this->form_validation->set_message('_validate_role', 'Please select at least one module.');
         $modules = $this->input->post('modules');
         if (is_array($modules)) {
             $permitted_modules = array_filter($modules, function ($var) {
                 return in_array($var, modules());
             });
             if (empty($permitted_modules)) {
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     }
     return TRUE;
 }
Exemplo n.º 7
0
define('DB_NAME', 'dream');
define('DB_USER', 'da');
define('DB_PASSWORD', 'dream-admin2015');
include 'DBF.php';
include 'functions.php';
include '../controller/recruiting.php';
if (notNull($_POST['action'])) {
    switch ($_POST['action']) {
        case "1":
            if (notNull($_POST['checksum']) && notNull($_POST['query'])) {
                echo query($_POST['checksum'], str_replace("#", "=", $_POST['query']));
            }
            break;
        case "2":
            if (notNull($_POST['query'])) {
                echo roles(str_replace("#", "=", $_POST['query']));
            }
            break;
        case "add_raider":
            if (notNull($_POST)) {
                addRaider($_POST);
            }
            break;
        case "add_article":
            if (notNull($_POST)) {
                addArticle($_POST);
            }
            break;
        case "edit_article":
            if (notNull($_POST)) {
                editArticle($_POST);