/** * Initialize */ public function init() { parent::init(); foreach (cogear()->gears as $gear) { if (is_array($gear->access)) { foreach ($gear->access as $rule => $rights) { $name = $gear->gear . '.' . $rule; // Array of user roles if (is_array($rights)) { if (in_array(role(), $rights)) { $this->rights->{$name} = TRUE; } else { $this->rights->{$name} = FALSE; } } else { if (is_string($rights)) { $callback = new Callback(array($gear, $rights)); if ($callback->check()) { $this->rights->{$name} = $callback; } } elseif (is_bool($rights)) { $this->rights->{$name} = $rights; } } } } } }
/** * Загрузка скриптов */ public function load() { $this->toolbar = Core_ArrayObject::transform($this->toolbar); $folder = cogear()->redactor->folder . DS . 'redactor' . DS; $options = new Core_ArrayObject(); event('redactor.options', $options); $options->lang = config('i18n.lang', 'ru'); $options->shortcuts = TRUE; $options->minHeight = 300; $options->buttons = array('formatting', 'alignment', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'table', 'link', 'image', '|', 'fontcolor', 'backcolor', '|', 'horizontalrule', '|', 'html'); // $options->imageUpload = l('/redactor/upload/'); $options->fixed = TRUE; $options->observeImages = TRUE; $options->convertLinks = TRUE; $options->cleanup = FALSE; $options->focus = TRUE; $options->convertDivs = FALSE; role() == 1 && ($options->fixedTop = 40); js($folder . $options->lang . '.js', 'after'); // $this->toolbar->markupSet->uasort('Core_ArrayObject::sortByOrder'); // $(document).ready(function(){ css($folder . 'redactor.css'); js($folder . 'redactor.min.js', 'after'); inline_js("\$('[name={$this->name}]').redactor(" . $options->toJSON() . ")", 'after'); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if ($request->user() and role(3) == true) { return $next($request); } abort(404); }
/** * Access * * @param string $rule * @param object $data */ public function access($rule, $data = NULL) { switch ($rule) { case 'edit': if (role() == 1) { return TRUE; } if ($data instanceof User_Object) { if ($data->id == $this->user->id) { return TRUE; } } elseif ($this->user->id == $this->router->getSegments(2)) { return TRUE; } break; case 'edit.login': case 'edit.email': if (role() == 1) { return TRUE; } break; case 'delete': if (role() == 1) { return TRUE; } break; } return FALSE; }
/** * Access * * @param type $rule * @param type $data */ public function access($rule, $data = NULL) { switch ($rule) { case 'edit': if (role() == 1) { return TRUE; } if ($data) { if (event('access.post.edit', $data)->check()) { } } break; case 'drafts': if ($data && ($user = user($data, 'login'))) { if ($user->id == $this->user->id) { return TRUE; } } else { if (user()->isLogged()) { return TRUE; } } break; case 'delete': if (role() == 1) { return TRUE; } break; case 'hide': if ($data instanceof Post_Object && $data->aid == user()->id or role() == 1) { return TRUE; } break; case 'menu': return TRUE; break; case 'ajax': if (Ajax::is()) { return TRUE; } break; } return FALSE; }
<h2><a href="<?php echo $pageUrl; ?> "><?php echo $playwright; ?> </a></h2> </header> </div> </li> <?php } ?> <?php if (!null == role('Director', $creatives, false)) { if (isCompanyMember($director)) { $className = "company-member"; $pageUrl = site_url() . "/company/" . strtolower(str_replace(' ', '-', $director)); } else { $className = "guest-artist"; $pageUrl = site_url() . "/creative/" . strtolower(str_replace(' ', '-', $director)); } ?> <li class="director <?php echo $className; ?> "> <div class="tr-card-overlay"> <header> <h5>Directed by</h5>
.small-box > .small-box-footer { text-align: left; } </style> <div class="content-wrapper bg-main"> <section class="content-header"> <h1> <span id="credit_status" onclick="document.location = currentUrl() + '?option=descript'" style="cursor: pointer;"><?php echo "Credit Status"; ?> </span> <?php if (role() == ADMIN) { ?> <a href="<?php echo base_url(ADMIN_PATH . 'creditstatus/monitoringService/' . $userId); ?> " class="btn btn-link">Credit Monitoring Services</a> <?php } ?> </h1> <ol class="breadcrumb"> <li><a href="<?php echo base_url(ADMIN_PATH); ?>
</option> <?php } ?> </select> </div> </div> </div> <?php } ?> <?php if (in_array(role(), array(BROKER, ADMIN))) { ?> <div class="row"> <div class="form-group col-md-4"> <div class="input-group"> <label for="brokerProspects"> Broker Prospects : </label><br/> <select id="brokerProspects" multiple="multiple" name="brokerProspects[]"> <?php foreach ($brokerProspects as $brokerProspect) { ?> <option value="<?php echo $brokerProspect->email; ?>
<i class="fa fa-arrow-circle-right"></i> </button> </div> </form> </div> </div> </section> <?php } ?> <?php if (in_array(role(), array())) { ?> <section class="col-lg-5 connectedSortable"> <div class="box box-solid bg-light-blue-gradient"> <div class="box-header"> <!-- tools box --> <div class="pull-right box-tools"> <button class="btn btn-primary btn-sm daterange pull-right" data-toggle="tooltip" title="Date range"> <i
function buildListUsers() { //Build the users of the selected list. global $debug, $message, $success, $Dbc, $returnThis; $output = ''; try { if (empty($_POST['listId'])) { throw new Adrlist_CustomException('', '$_POST[\'listId\'] is empty.'); } elseif (!is_numeric($_POST['listId'])) { throw new Adrlist_CustomException('', '$_POST[\'listId\'] is not numeric.'); } //Get the user's list role. $listInfo = getListInfo($_SESSION['userId'], $_POST['listId']); if ($listInfo === false || $listInfo['listRoleId'] < 3) { //The user must be a Manager (3) or higher to view list users. throw new Adrlist_CustomException("Your role does not allow you to edit this list.", ''); } //Select the existing users. $listUsersCountStmt = "SELECT\n\tCOUNT(users.userId) AS 'count'\nFROM\n\tusers\nJOIN\n\tuserListSettings ON userListSettings.userId = users.userId AND\n\tuserListSettings.listId = ?\nWHERE\n\tusers.userId != ?"; $listUsersStmt = "SELECT\n\tusers.userId AS 'userId',\n\tCONCAT_WS(' ',users.firstName,users.lastName) AS 'name',\n\tusers.primaryEmail AS 'primaryEmail',\n\tuserListSettings.listRoleId AS 'listRoleId',\n\tuserListSettings.dateAdded AS 'dateAdded'\nFROM\n\tusers\nJOIN\n\tuserListSettings ON userListSettings.userId = users.userId AND\n\tuserListSettings.listId = ?\nWHERE\n\tusers.userId != ?"; /*GROUP BY users.primaryEmail*/ $listUsersEndStmt = "\nORDER BY\n\tCONCAT_WS(' ',users.firstName,users.lastName), users.primaryEmail"; //Select the users with pending invitations. $pendingUsersCountStmt = "SELECT\n\tCOUNT(email) AS 'count'\nFROM\n\tinvitations\nWHERE\n\tlistId = ? AND\n\trespondDate IS NULL AND\n\temail NOT IN (SELECT users.primaryEmail FROM users)"; $pendingUsersStmt = "SELECT\n\tinvitationId AS 'invitationId',\n\temail AS 'email',\n\tlistRoleId AS 'listRoleId',\n\tsentDate AS 'sentDate',\n\tsenderId AS 'senderId'\nFROM\n\tinvitations\nWHERE\n\tlistId = ? AND\n\trespondDate IS NULL AND\n\temail NOT IN (SELECT users.primaryEmail FROM users)"; $pendingUsersEndStmt = "\nORDER BY\n\temail"; if (!empty($_POST['searchVal']) && !empty($_POST['searchFor']) && $_POST['searchFor'] == 'listUsers') { $searchListUsers = true; $searchVal = '%' . trim($_POST['searchVal']) . '%'; $listUsersSearchQuery = " AND\n\t(users.firstName LIKE ? || users.lastName LIKE ? || users.primaryEmail LIKE ?)"; $listUsersStmt = $listUsersStmt . $listUsersSearchQuery . $listUsersEndStmt; $listUsersParams = array($_POST['listId'], $_SESSION['userId'], $searchVal, $searchVal, $searchVal); $listUsersCountStmt .= $listUsersSearchQuery; } else { $searchListUsers = false; $listUsersStmt .= $listUsersEndStmt; $listUsersParams = array($_POST['listId'], $_SESSION['userId']); } if (!empty($_POST['searchVal']) && !empty($_POST['searchFor']) && $_POST['searchFor'] == 'pendingListUsers') { $searchPendingListUsers = true; $searchVal = '%' . trim($_POST['searchVal']) . '%'; $pendingUsersSearchQuery = " AND\nemail LIKE ?"; $pendingUsersStmt = $pendingUsersStmt . $pendingUsersSearchQuery . $pendingUsersEndStmt; $pendingUsersParams = array($_POST['listId'], $searchVal); $pendingUsersCountStmt .= $pendingUsersSearchQuery; } else { $searchPendingListUsers = false; $pendingUsersStmt = $pendingUsersStmt . $pendingUsersEndStmt; $pendingUsersParams = array($_POST['listId']); } $listUsersCountStmt = $Dbc->prepare($listUsersCountStmt); $listUsersCountStmt->execute($listUsersParams); $row = $listUsersCountStmt->fetch(PDO::FETCH_ASSOC); $itemCount = $row['count']; $pagination = new Adrlist_Pagination('buildListUsers', 'listUsers', $itemCount, 'Search Users', $searchListUsers); $pagination->addSearchParameters(array('listId' => $_POST['listId'], 'searchFor' => 'listUsers')); list($offset, $limit) = $pagination->offsetLimit(); $listUsersStmt = $Dbc->prepare($listUsersStmt . " LIMIT {$offset}, {$limit}"); $listUsersStmt->execute($listUsersParams); $pendingUsersCountStmt = $Dbc->prepare($pendingUsersCountStmt); $pendingUsersCountStmt->execute($pendingUsersParams); $row = $pendingUsersCountStmt->fetch(PDO::FETCH_ASSOC); $itemCount = $row['count']; $pendingPagination = new Adrlist_Pagination('buildListUsers', 'pendingListUsers', $itemCount, 'Search Pending Users', $searchPendingListUsers); $pendingPagination->addSearchParameters(array('listId' => $_POST['listId'], 'searchFor' => 'pendingListUsers')); list($pendingOffset, $pendingLimit) = $pendingPagination->offsetLimit(); $pendingUsersStmt = $Dbc->prepare($pendingUsersStmt . " LIMIT {$pendingOffset}, {$pendingLimit}"); $pendingUsersStmt->execute($pendingUsersParams); $listInfo = getListInfo($_SESSION['userId'], $_POST['listId']); $listUsersCount = 0; $listUsersArray = array(); $listUsersHiddenRow = array(); while ($row = $listUsersStmt->fetch(PDO::FETCH_ASSOC)) { $listUsersCount++; $name = '<button class="ui-btn ui-mini ui-btn-icon-right ui-icon-carat-r ui-btn-inline ui-corner-all" toggle="existingUser' . $row['userId'] . '">' . $row['name'] . '</button>'; $email = '<a href="mailto:' . $row['primaryEmail'] . '">' . breakEmail($row['primaryEmail'], 30) . '</a>'; $date = $row['dateAdded'] != '0000-00-00 00:00:00' ? Adrlist_Time::utcToLocal($row['dateAdded']) : 'n/a'; $listUsersArray[$row['userId']] = array($name, $date); //The user rowActions. $userActions = ''; if ($listInfo['listRoleId'] <= 3 && $row['listRoleId'] >= 3) { //List managers cannot change the role of managers or owners. $role = role($row['listRoleId']); } else { $additionalAttributes = array('class' => 'changeListRole', 'userId' => $row['userId'], 'listId' => $_POST['listId']); $role = buildRoles('changeListRole' . $row['userId'], $row['listRoleId'], array(0, 1, 2, 3), $additionalAttributes); } if ($listInfo['listRoleId'] >= 3) { $userActions .= '<div class="ui-field-contain"><label for="existingRole' . $row['userId'] . '">List Role ' . faqLink(24) . '</label>' . $role . '</div>'; $userActions .= $row['listRoleId'] < 3 || $listInfo['listRoleId'] == 4 ? '<button class="removeUserFromList ui-btn ui-btn-inline ui-corner-all ui-mini" listId="' . $_POST['listId'] . '" userId="' . $row['userId'] . '" listName="' . $listInfo['listName'] . '"><i class="fa fa-times" ></i>Remove User</button>' : ''; } $listUsersHiddenRow[$row['userId']] = array('existingUser' . $row['userId'], $userActions); } //Build pending list users. $pendingListUsersCount = 0; $pendingUsersArray = array(); $pendingUsersHiddenRow = array(); while ($pendingRow = $pendingUsersStmt->fetch(PDO::FETCH_ASSOC)) { $pendingListUsersCount++; $name = '<button class="ui-btn ui-mini ui-btn-icon-right ui-icon-carat-r ui-btn-inline ui-corner-all" toggle="pendingUser' . $pendingRow['invitationId'] . '">' . $pendingRow['email'] . '</button>'; $email = '<a href="mailto:' . $pendingRow['email'] . '">' . breakEmail($pendingRow['email'], 40) . '</a>'; $sentDate = $pendingRow['sentDate'] != '0000-00-00 00:00:00' ? Adrlist_Time::utcToLocal($pendingRow['sentDate']) : 'n/a'; $pendingUsersArray[$pendingRow['invitationId']] = array($name, $sentDate); //The pending list user rowActions. $userActions = ''; if ($listInfo['listRoleId'] == 3 && $pendingRow['listRoleId'] >= 3) { //Managers cannot change the role of other managers. $role = role($pendingRow['listRoleId']); } else { $additionalAttributes = array('class' => 'changePendingRole', 'invitationId' => $pendingRow['invitationId'], 'adrtype' => 'list', 'typeid' => $_POST['listId']); $role = buildRoles('', $pendingRow['listRoleId'], array(0, 1, 2, 3), $additionalAttributes); } if ($listInfo['listRoleId'] >= 3) { $userActions .= '<div class="ui-field-contain"><label for="pendingRole' . $pendingRow['invitationId'] . '">List Role ' . faqLink(24) . '</label>' . $role . '</div> <button adrType="list" class="removeInvitation ui-btn ui-btn-inline ui-corner-all ui-mini" invitationId="' . $pendingRow['invitationId'] . '" typeId="' . $_POST['listId'] . '"><i class="fa fa-times" ></i>Remove User</button>'; } $pendingUsersHiddenRow[$pendingRow['invitationId']] = array('pendingUser' . $pendingRow['invitationId'], $userActions); } //Build list users. $output .= '<div class="textCenter textLarge"> <i class="fa fa-file-o" ></i><span class="bold">' . $listInfo['listName'] . '</span> Users </div>'; if (empty($listUsersCount)) { pdoError(__LINE__, $listUsersStmt, $listUsersParams, true); $output .= '<div class="break red" style="padding:5px 0px 10px 0px;"> There are no users. </div>'; } if ($searchListUsers) { $results = intThis($listUsersCount); $output .= '<div class="break red">'; $output .= $results == 1 ? $results . ' result' : $results . ' results'; $output .= ' for "' . $_POST['searchVal'] . '".</div>'; } $listUsersTitleArray = array(array('Name'), array('Shared On', 1)); $buildListUsers = new Adrlist_BuildRows('existingListUsers', $listUsersTitleArray, $listUsersArray); $buildListUsers->addHiddenRows($listUsersHiddenRow); $output .= $pagination->output('listUsersViewOptions') . $buildListUsers->output(); $output .= '<div class="hr3" style="margin:2em 0;"></div>'; //Build pending users. $output .= '<div class="break textCenter textLarge" style="margin:1em 0 0 0"> Pending Users </div>'; if (empty($pendingListUsersCount)) { pdoError(__LINE__, $pendingUsersStmt, $pendingUsersParams, true); $output .= '<div class="break red" style="padding:5px 0px 10px 0px;"> There are no pending users. </div>'; } if ($searchPendingListUsers) { $results = intThis($pendingListUsersCount); $output .= '<div class="break red">'; $output .= $results == 1 ? $results . ' result' : $results . ' results'; $output .= ' for "' . $_POST['searchVal'] . '".</div>'; } $pendingUsersTitleArray = array(array('Pending User'), array('Shared On', 1)); $buildPendingUsers = new Adrlist_BuildRows('pendingListUsers', $pendingUsersTitleArray, $pendingUsersArray); $buildPendingUsers->addHiddenRows($pendingUsersHiddenRow); $output .= $pendingPagination->output('pendingListUsersViewOptions') . $buildPendingUsers->output(); if (MODE == 'buildListUsers') { $success = true; $returnThis['output'] = $output; } } catch (Adrlist_CustomException $e) { } catch (PDOException $e) { error(__LINE__, '', '<pre>' . $e . '</pre>'); } if (MODE == 'buildListUsers') { returnData(); } else { return $output; } }
<div class="bg-soon"> <h3> </h3> <p> </p> </div> </div> <p class="bcu1 small-box-footer" style="color: black; background: rgb(207, 133, 15)"><strong> Banks & Credit Unions</strong></p> </div> </div> <?php } ?> <?php if (in_array(role(), array(CLIENT, ADMIN))) { ?> <?php if (array_intersect($membership, array(BROKER_SILVER, BROKER_GOLD, BROKER_PLATINUM))) { ?> <div class="col-lg-3 col-xs-6" style="cursor:pointer" id="credit"> <?php } else { ?> <div class="col-lg-3 col-xs-6" style="cursor:pointer; opacity: 0.3;" id="credit"> <?php } ?> <div class="small-box">
/** * Хук инициализации шестерёнки * * @param object $Gear */ public function hookGearInit($Gear) { if (cogear()->gears->Role && role() === 1 && $Gear->checkUpdate()) { info(t('Шестерёнка <b>%s</b> требует обновления. <a href="%s" class="btn btn-primary btn-mini">Обновить</a>', $Gear->name, l('/admin/gears/update/' . $Gear->gear))); } }
<li class="<?php echo activate(3, 'tradeline_benefits'); ?> "> <a href="<?php echo base_url() . 'administrator/content/tradelineBenefits/' . $this->session->userdata("tradelineBenefits")->id; ?> "><i class='fa fa-star'></i><?php echo $this->session->userdata("tradelineBenefits")->name; ?> </a> </li> <?php if (in_array(role(), array(BROKER, CLIENT)) and array_intersect(memberships(), array(CLIENT_SILVER, CLIENT_GOLD, CLIENT_PLATINUM, BROKER_SILVER, BROKER_GOLD, BROKER_PLATINUM))) { ?> <li class="<?php echo activate(3, 'market'); ?> "> <a href="<?php echo base_url() . 'administrator/line/market?option=descript'; ?> "><i class='fa fa-shopping-cart'></i>Tradelines Marketplace</a> </li> <?php } ?>
/** * Хук футера */ public function hookFooter() { if (!$this->Install && role() == 1) { echo template('Theme/templates/widgets/edit.link')->render(); } }
<div class="form-group col-md-6"> <?php echo form_label('Phone : ', 'phone'); ?> <a href="#" id="phone" data-type="text"> <?php echo $prospect->personal_phone; ?> </a> </div> </div> </div> </div> </div> <?php if (role() == BROKER) { ?> <div class="col-md-12"> <form method="post" action="<?php echo base_url() . 'administrator/prospect/addProspectNotes/' . $prospect->id; ?> "> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title">Notes</h3> </div> <div class="box-body"> <div class="row"> <div class="form-group col-md-12"> <textarea style="width: 100%" name="note"></textarea>
<p class="small-box-footer" style="color: black; background: rgb(207, 133, 15)"> <strong> Marketing Resources</strong> </p> </div> </div> <?php } ?> <!-----------Credit Resources-------------------> <?php if (in_array(role(), array(BROKER))) { ?> <?php if (array_intersect($membership, array(BROKER_PLATINUM))) { ?> <div class="col-lg-3 col-xs-6" onclick="document.location='#'" style="cursor:pointer"> <?php } else { ?> <div class="col-lg-3 col-xs-6" onclick="document.location='#'" style="cursor:pointer; opacity: 0.3;"> <?php
<!--вміст--> <td width='640' valign='top'> <?php if (isset($_GET['lang'])) { $lang = selLang($_GET['lang']); if (!strstr($_SERVER['HTTP_REFERER'], 'lang')) { header("Location: {$_SERVER['HTTP_REFERER']}"); } } //del all rating if (!empty($_GET['delrating']) and $_SESSION['status'] == '3') { delAllRating($_GET['delrating']); } //role edit if (isset($_GET['sendrole']) and isset($_SESSION['status']) and $_SESSION['status'] == '3' and $_GET['user'] != 'root') { role($_GET['user'], $_GET['role']); } //exit and ref-profile if (isset($_SESSION['name'])) { include "exit.php"; } if (isset($_SESSION['error'])) { echo $_SESSION['error']; } //content title and text if (empty($_GET) and empty($_FILES)) { $indextitle = delList(); foreach ($indextitle as $title) { if ($lang['lang'] == 'en') { echo "<h4><a href='index.php?id=" . $title['id'] . "'>" . $title['titleen'] . "</a></h4>"; $indextext = getTexten($title['id']);
"><?php echo $line->disqualified; ?> </a> </td> <td> <a href="#" id="reason" data-type="text" data-pk="<?php $line->id; ?> "><?php echo $line->reason; ?> </a> </td> <?php if (in_array(role(), array(ADMIN))) { ?> <td><a href="#" id="submit" data="<?php echo singleQuote(array('id' => $line->id)); ?> "><span class="glyphicon glyphicon-trash"></span></a></td> <?php } ?> </tr> <?php } ?> </tbody>