• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Current_User类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Current_User的典型用法代码示例。如果您正苦于以下问题:PHP Current_User类的具体用法?PHP Current_User怎么用?PHP Current_User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Current_User类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute(CommandContext $context)
 {
     if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'bed_structure')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to remove a bed.');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
     $viewCmd = CommandFactory::getCommand('EditRoomView');
     $viewCmd->setRoomId($context->get('roomId'));
     $bedId = $context->get('bedId');
     $roomId = $context->get('roomId');
     if (!isset($roomId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing room ID.');
         $viewCmd->redirect();
     }
     if (!isset($bedId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing bed ID.');
         $viewCmd->redirect();
     }
     # Try to delete the bed
     try {
         HMS_Bed::deleteBed($bedId);
     } catch (Exception $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'There was an error deleting the bed: ' . $e->getMessage());
         $viewCmd->redirect();
     }
     NQ::simple('hms', hms\NotificationView::SUCCESS, 'Bed successfully deleted.');
     $viewCmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:29,代码来源:DeleteBedCommand.php


示例2: execute

 /**
  * The main function for executing the command.
  */
 public function execute()
 {
     // Retrieve the values from the request
     $umbrellaId = $_REQUEST['umbrellaId'];
     // Retrieve other important values and objects
     $username = \Current_User::getUsername();
     $permissions = \AppSync\UmbrellaAdminFactory::getUmbrellaAdmin($username, $umbrellaId);
     // If the permissions array is empty then the user does not have permission to use this command
     // throw an error back to the front end.
     if (sizeof($permissions) == 0) {
         echo '<div style="display: none;">User does not have permission to access this data.</div>';
         exit;
     }
     // Attempt to retrieve the portals and do a fuzzy search of them for the searchString
     try {
         $portals = \AppSync\PortalFactory::getPortals();
         $searchString = $_REQUEST['searchString'];
         $umbrella = $_REQUEST['umbrellaId'];
         $portList = $this->portalFuzzySearch($searchString, $umbrella, $portals);
         echo $this->encodePortals($portList);
     } catch (\Exception $e) {
         echo '<div style="display: none;">' . $e->getMessage() . '</div>';
     }
     exit;
 }
开发者ID:csdetschjr,项目名称:OrgSyncAdmin,代码行数:28,代码来源:GetSearchSuggestions.php


示例3: process

 public static function process()
 {
     if (!Current_User::authorized('analytics')) {
         Current_User::disallow();
     }
     $panel = self::cpanel();
     if (isset($_REQUEST['command'])) {
         $command = $_REQUEST['command'];
     } else {
         $command = $panel->getCurrentTab();
     }
     switch ($command) {
         case 'list':
             $panel->setContent(self::listTrackers());
             break;
         case 'new':
             $panel->setContent(self::newTracker());
             break;
         case 'create':
             $panel->setContent(self::createTracker());
             break;
         case 'edit':
             $panel->setContent(self::editTracker());
             break;
         case 'delete':
             $panel->setContent(self::deleteTracker());
             break;
         case 'save_tracker':
             $panel->setContent(self::saveTracker());
             break;
     }
     Layout::add(PHPWS_ControlPanel::display($panel->display()));
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:33,代码来源:Analytics.php


示例4: execute

 public function execute(CommandContext $context)
 {
     // Check permissions
     if (!Current_User::allow('hms', 'checkin')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to checkin students.');
     }
     $term = Term::getSelectedTerm();
     $bannerId = $context->get('bannerId');
     $hallId = $context->get('hallId');
     $errorCmd = CommandFactory::getCommand('ShowCheckinStart');
     if (!isset($bannerId) || is_null($bannerId) || $bannerId == '') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing Banner ID.');
         $errorCmd->redirect();
     }
     if (!isset($hallId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing residence hall ID.');
         $errorCmd->redirect();
     }
     // Check the Banner ID
     if (preg_match("/[\\d]{9}/", $bannerId) == false) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Imporperly formatted Banner ID.');
         $errorCmd->redirect();
     }
     // Try to lookup the student in Banner
     try {
         $student = StudentFactory::getStudentByBannerId($bannerId, $term);
     } catch (StudentNotFoundException $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Could not locate a student with that Banner ID.');
         $errorCmd->redirect();
     }
     // Make sure the student is assigned in the current term
     $assignment = HMS_Assignment::getAssignmentByBannerId($bannerId, $term);
     if (!isset($assignment) || is_null($assignment)) {
         NQ::simple('hms', hms\NotificationView::ERROR, $student->getName() . ' is not assigned for ' . Term::toString($term) . '. Please contact the University Housing Assignments Office at 828-262-6111.');
         $errorCmd->redirect();
     }
     // Make sure the student's assignment matches the hall the user selected
     $bed = $assignment->get_parent();
     $room = $bed->get_parent();
     $floor = $room->get_parent();
     $hall = $floor->get_parent();
     if ($hallId != $hall->getId()) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Wrong hall! ' . $student->getName() . ' is assigned to ' . $assignment->where_am_i());
         $errorCmd->redirect();
     }
     // Load any existing check-in
     $checkin = CheckinFactory::getLastCheckinByBannerId($bannerId, $term);
     // If there is a checkin for the same bed, and the difference between the current time and the checkin time is
     // greater than 48 hours, then show an error.
     if (!is_null($checkin)) {
         $checkoutDate = $checkin->getCheckoutDate();
         if ($checkin->getBedId() == $bed->getId() && !isset($checkoutDate) && time() - $checkin->getCheckinDate() > Checkin::CHECKIN_TIMEOUT) {
             NQ::simple('hms', hms\NotificationView::ERROR, $student->getName() . ' has already checked in to ' . $assignment->where_am_i());
             $errorCmd->redirect();
         }
     }
     $view = new CheckinFormView($student, $assignment, $hall, $floor, $room, $checkin);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:60,代码来源:ShowCheckinFormCommand.php


示例5: test

 public static function test($value, $show_recursive = FALSE)
 {
     if (DEITY_ONLY_TEST && (!isset($_SESSION['User']) || !class_exists('Current_User') || !Current_User::isDeity())) {
         return;
     }
     if (empty($value)) {
         $value = PHPWS_Debug::emptyVal($value);
     }
     switch (1) {
         case is_object($value):
             return PHPWS_Debug::testObject($value, 1, $show_recursive);
             break;
         case is_array($value):
             return 'Array' . PHPWS_Debug::testArray($value, 1, $show_recursive);
             break;
         case is_bool($value):
             if ($value) {
                 return '<pre>bool(TRUE)</pre>';
             } else {
                 return '<pre>bool(FALSE)</pre>';
             }
         case is_numeric($value):
             return '<pre>' . $value . '</pre>';
         case is_string($value):
             return '<pre>' . preg_replace('/\\n|(\\r\\n)/', '\\n', htmlspecialchars($value)) . '</pre>';
             break;
         default:
             return '<pre>' . $value . '</pre>';
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:30,代码来源:Debug.php


示例6: execute

 public function execute(CommandContext $context)
 {
     if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'floor_view')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to edit floors.');
     }
     // Check for a hall ID
     $floorId = $context->get('floor');
     if (!isset($floorId)) {
         throw new InvalidArgumentException('Missing floor ID.');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
     PHPWS_Core::initModClass('hms', 'HMS_Floor.php');
     PHPWS_Core::initModClass('hms', 'FloorView.php');
     $floor = new HMS_Floor($floorId);
     if ($floor->term != Term::getSelectedTerm()) {
         $floorCmd = CommandFactory::getCommand('SelectFloor');
         $floorCmd->setTitle('Edit a Floor');
         $floorCmd->setOnSelectCmd(CommandFactory::getCommand('EditFloorView'));
         $floorCmd->redirect();
     }
     $hall = $floor->get_parent();
     $floorView = new FloorView($hall, $floor);
     $context->setContent($floorView->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:25,代码来源:EditFloorViewCommand.php


示例7: execute

 public function execute(CommandContext $context)
 {
     if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'roommate_maintenance')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to create/edit roommate groups.');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Roommate.php');
     $id = $context->get('id');
     if (is_null($id)) {
         throw new InvalidArgumentException('Missing roommate group id.');
     }
     $viewCmd = CommandFactory::getCommand('EditRoommateGroupsView');
     try {
         $roommate = new HMS_Roommate($id);
         $roommate->delete();
     } catch (Exception $e) {
         NQ::simple('hms', hms\NotificationView::SUCCESS, 'Error deleting roommate group: ' . $e->getMessage());
         $viewCmd->redirect();
     }
     // Log the success
     $notes = "{$roommate->getRequestor()} requested {$roommate->getRequestee()}";
     HMS_Activity_Log::log_activity($roommate->getRequestor(), ACTIVITY_ADMIN_REMOVED_ROOMMATE, UserStatus::getUsername(), $notes);
     HMS_Activity_Log::log_activity($roommate->getRequestee(), ACTIVITY_ADMIN_REMOVED_ROOMMATE, UserStatus::getUsername(), $notes);
     NQ::simple('hms', hms\NotificationView::SUCCESS, 'Roommate group successfully deleted.');
     $viewCmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:26,代码来源:DeleteRoommateGroupCommand.php


示例8: execute

 public function execute(CommandContext $context)
 {
     // Check permissions
     if (!Current_User::allow('hms', 'checkin')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to checkin students.');
     }
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     $bannerId = $context->get('banner_id');
     $hallId = $context->get('residence_hall_hidden');
     $errorCmd = CommandFactory::getCommand('ShowCheckoutStart');
     // TODO
     if (!isset($bannerId) || is_null($bannerId) || $bannerId == '') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing Banner ID.');
         $errorCmd->redirect();
     }
     if (!isset($hallId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing residence hall ID.');
         $errorCmd->redirect();
     }
     // Everything checks out, so redirect to the form
     $cmd = CommandFactory::getCommand('ShowCheckoutForm');
     // TODO
     $cmd->setBannerId($bannerId);
     $cmd->setHallId($hallId);
     $cmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:28,代码来源:StartCheckoutSubmitCommand.php


示例9: execute

 /**
  * Exec
  *
  * @param CommandContext $context
  * @throws InvalidArgumentExection
  */
 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'reports')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do no have permission to run reports.');
     }
     $reportId = $context->get('reportId');
     if (!isset($reportId) || is_null($reportId)) {
         throw new InvalidArgumentExection('Missing report id.');
     }
     // Instantiate the report controller with the requested report id
     PHPWS_Core::initModClass('hms', 'ReportFactory.php');
     $report = ReportFactory::getReportById($reportId);
     // Check to make sure the file exists
     if (!file_exists($report->getCsvOutputFilename())) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Could not open report file.');
         PHPWS_Error::log('Could not open report file ' . $report->getCsvOutputFilename(), 'hms');
         $reportCmd = CommandFactory::getCommand('ShowReportDetail');
         $reportCmd->setReportClass($report->getClass());
         $reportCmd->redirect();
     }
     $pdf = file_get_contents($report->getCsvOutputFilename());
     // Hoepfully force the browser to open a 'save as' dialogue
     header('Content-Type: text/csv');
     header('Cache-Control: public, must-revalidate, max-age=0');
     // HTTP/1.1
     header('Pragma: public');
     header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     // Date in the past
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Content-Length: ' . strlen($pdf));
     header('Content-Disposition: attachment; filename="' . basename($report->getCsvOutputFilename()) . '";');
     echo $pdf;
     exit;
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:41,代码来源:ShowReportCsvCommand.php


示例10: execute

 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'room_structure')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to add a room.');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
     PHPWS_Core::initModClass('hms', 'HMS_Floor.php');
     PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     PHPWS_Core::initModClass('hms', 'AddRoomView.php');
     $floor_id = $context->get('floor');
     $tpl = array();
     # Setup the title and color of the title bar
     $tpl['TITLE'] = 'Add Room';
     # Check to make sure we have a floor and hall.
     $floor = new HMS_Floor($floor_id);
     if (!$floor) {
         $tpl['ERROR_MSG'] = 'There was an error getting the floor object. Please contact ESS.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/add_room.tpl');
     }
     $hall = $floor->get_parent();
     if (!$hall) {
         $tpl['ERROR_MSG'] = 'There was an error getting the hall object. Please contact ESS.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/add_room.tpl');
     }
     # Check Permissions
     if (!Current_User::allow('hms', 'room_structure')) {
         HMS_Floor::show_edit_floor($floor_id, NULL, 'You do not have permission to add rooms.');
     }
     $view = new AddRoomView($floor);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:34,代码来源:ShowAddRoomCommand.php


示例11: execute

 public function execute(CommandContext $context)
 {
     if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'view_activity_log')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to view the activity log.');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Activity_Log.php');
     PHPWS_Core::initModClass('hms', 'ActivityLogView.php');
     $actee = $context->get('actee');
     $actor = $context->get('actor');
     $notes = $context->get('notes');
     $exact = $context->get('exact');
     $begin = $context->get('begin');
     $end = $context->get('end');
     if (!is_null($begin) && !is_null($end) && $end <= $begin) {
         unset($_REQUEST['begin_year'], $_REQUEST['begin_month'], $_REQUEST['begin_day'], $_REQUEST['end_year'], $_REQUEST['end_month'], $_REQUEST['end_day']);
         $begin = null;
         $end = null;
         NQ::simple('hms', hms\NotificationView::WARNING, 'Invalid date range. The search results will not be filtered by date.');
     }
     $activityMap = HMS_Activity_Log::getActivityMapping();
     $activities = array();
     foreach ($activityMap as $i => $t) {
         $act = $context->get("a{$i}");
         if (!is_null($act)) {
             $activities[] = $i;
         }
     }
     $activityLogView = new ActivityLogView($actee, $actor, $notes, $exact, $begin, $end, $activities);
     $context->setContent($activityLogView->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:31,代码来源:ShowActivityLogCommand.php


示例12: __construct

 public function __construct($asu_username, $term)
 {
     $this->asu_username = $asu_username;
     $this->term = $term;
     $this->created_on = time();
     $this->created_by = Current_User::getUsername();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:7,代码来源:HMS_Eligibility_Waiver.php


示例13: __construct

 public function __construct()
 {
     parent::__construct();
     // Check permissions
     if (UserStatus::isAdmin()) {
         if (Current_User::allow('hms', 'learning_community_maintenance')) {
             $this->addCommandByName('Add/Edit Communities', 'ShowEditRlc');
         }
         if (Current_User::allow('hms', 'view_rlc_applications')) {
             $this->addCommandByName('Assign Applicants to RLCs', 'ShowAssignRlcApplicants');
             $this->addCommandByName('View Denied Applications', 'ShowDeniedRlcApplicants');
         }
         if (Current_User::allow('hms', 'learning_community_maintenance')) {
             $this->addCommandByName('Send RLC Email Invites', 'ShowSendRlcInvites');
         }
         if (Current_User::allow('hms', 'view_rlc_members')) {
             $this->addCommandByName('View RLC Members by RLC', 'ShowSearchByRlc');
             $this->addCommandByName('View RLC Assignments', 'ViewRlcAssignments');
         }
         if (Current_User::allow('hms', 'email_rlc_rejections')) {
             // Using JSConfirm, ask user if the _really_ want to send the emails
             $onConfirmCmd = CommandFactory::getCommand('SendRlcRejectionEmails');
             $cmd = CommandFactory::getCommand('JSConfirm');
             $cmd->setLink('Send RLC Rejection Emails');
             $cmd->setTitle('Send RLC Rejection Emails');
             $cmd->setQuestion('Send notification emails to denied RLC applicants for selected term?');
             $cmd->setOnConfirmCommand($onConfirmCmd);
             $this->addCommand('Send RLC Rejection Emails', $cmd);
         }
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:31,代码来源:RLCMenu.php


示例14: display

 public function display()
 {
     // permissions...
     if (!\Current_User::isDeity()) {
         \NQ::simple('intern', NotifyUI::ERROR, 'You cannot edit administrators.');
         return false;
     }
     // set up some stuff for the page template
     $tpl = array();
     // create the list of admins
     $adminList = Admin::getAdminPager();
     // get the list of departments
     $depts = Department::getDepartmentsAssoc();
     // make the form for adding a new admin
     $form = new \PHPWS_Form('add_admin');
     $form->addSelect('department_id', $depts);
     $form->setLabel('department_id', 'Department');
     $form->addText('username');
     $form->setLabel('username', 'Username');
     $form->addCheck('all');
     $form->setLabel('all', 'All Departments');
     $form->addSubmit('submit', 'Create Admin');
     $form->setAction('index.php?module=intern&action=edit_admins');
     $form->addHidden('add', 1);
     // TODO: Add Javascript autocomplete for usernames.
     javascript('jquery');
     javascript('jquery_ui');
     javascriptMod('intern', 'admin');
     $tpl['PAGER'] = $adminList;
     $form->mergeTemplate($tpl);
     return \PHPWS_Template::process($form->getTemplate(), 'intern', 'edit_admin.tpl');
 }
开发者ID:jlbooker,项目名称:InternshipInventory,代码行数:32,代码来源:AdminUI.php


示例15: checkRequiredFields

 public function checkRequiredFields(Internship $i)
 {
     if (!$i->isSecondaryPart()) {
         // Check the course subject
         $courseSubj = $i->getSubject();
         if (!isset($courseSubj) || $courseSubj == '' || $courseSubj->id == 0) {
             throw new MissingDataException("Please select a course subject.");
         }
         // Check the course number
         $courseNum = $i->getCourseNumber();
         if (!isset($courseNum) || $courseNum == '') {
             throw new MissingDataException("Please enter a course number.");
         }
         // Check the course section number
         $sectionNum = $i->getCourseSection();
         if (!isset($sectionNum) || $sectionNum == '') {
             throw new MissingDataException("Please enter a course section number.");
         }
         // Check the course credit hours field
         $creditHours = $i->getCreditHours();
         if (!isset($creditHours) || $creditHours == '') {
             throw new MissingDataException("Please enter the number of course credit hours.");
         }
         if (!\Current_User::isDeity() && $creditHours <= 0) {
             throw new MissingDataException("The number of course credit hours should be greater than zero.");
         }
     }
 }
开发者ID:jeffrafter,项目名称:InternshipInventory,代码行数:28,代码来源:UndergradRegistration.php


示例16: execute

 /**
  * Shows the requested report's HTML output.
  * 
  * @param CommandContext $context
  * @throws InvalidArgumentExection
  */
 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'reports')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do no have permission to run reports.');
     }
     $reportId = $context->get('reportId');
     if (!isset($reportId) || is_null($reportId)) {
         throw new InvalidArgumentExection('Missing report id.');
     }
     // Instantiate the report controller with the requested report id
     PHPWS_Core::initModClass('hms', 'ReportFactory.php');
     $report = ReportFactory::getReportById($reportId);
     Layout::addPageTitle($report->getFriendlyName());
     $detailCmd = CommandFactory::getCommand('ShowReportDetail');
     $detailCmd->setReportClass($report->getClass());
     $content = '<div> ' . $detailCmd->getLink('&laquo; back') . ' </div>';
     $content .= file_get_contents($report->getHtmlOutputFilename());
     if ($content === FALSE) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Could not open report file.');
         PHPWS_Error::log('Could not open report file ' . $report->getCsvOutputFilename(), 'hms');
         $reportCmd = CommandFactory::getCommand('ShowReportDetail');
         $reportCmd->setReportClass($report->getClass());
         $reportCmd->redirect();
     }
     $context->setContent($content);
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:33,代码来源:ShowReportHtmlCommand.php


示例17: execute

 /**
  * The main function for executing the command.
  */
 public function execute()
 {
     $returnData = array('username' => \Current_User::getUsername(), 'deity' => \Current_User::isDeity(), 'view' => \Current_User::allow('appsync', 'view'), 'purge' => \Current_User::allow('appsync', 'purge'));
     // Echo the values back to the front end after encoding them.
     echo json_encode($returnData);
     exit;
 }
开发者ID:csdetschjr,项目名称:OrgSyncAdmin,代码行数:10,代码来源:AjaxGetUserPermissions.php


示例18: main

 public function main()
 {
     $auth = Current_User::getAuthorization();
     if (!Current_User::isLogged() || !$auth->local_user) {
         PHPWS_Core::errorPage('403');
     }
     $result = $this->init();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         Layout::add(PHPWS_ControlPanel::display(dgettext('users', 'The is a problem with My Page.')));
         return;
     } elseif (!$result) {
         Layout::add(PHPWS_ControlPanel::display(dgettext('users', 'No modules are registered to My Page.')));
         return;
     }
     $panel = My_Page::cpanel();
     $module = $panel->getCurrentTab();
     if (!$this->moduleIsRegistered($module)) {
         Layout::add(dgettext('users', 'This module is not registered with My Page'));
         return;
     }
     $content = My_Page::userOption($module);
     if (PHPWS_Error::isError($content)) {
         $content = $content->getMessage();
     }
     Layout::add(PHPWS_ControlPanel::display($content));
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:27,代码来源:My_Page.php


示例19: showFP

function showFP()
{
    $db = new PHPWS_DB('ps_page');
    $db->addWhere('front_page', 1);
    if ($db->isTableColumn('deleted')) {
        $db->addWhere('deleted', 0);
    }
    Key::restrictView($db, 'pagesmith');
    $db->loadClass('pagesmith', 'PS_Page.php');
    $result = $db->getObjects('PS_Page');
    if (!PHPWS_Error::logIfError($result) && !empty($result)) {
        PHPWS_Core::initModClass('pagesmith', 'PageSmith.php');
        foreach ($result as $page) {
            $content = $page->view();
            if ($content && !PHPWS_Error::logIfError($content)) {
                if (Current_User::allow('pagesmith', 'edit_page', $page->id)) {
                    $content .= sprintf('<p class="pagesmith-edit">%s</p>', $page->editLink());
                }
                Layout::add($content, 'pagesmith', 'view_' . $page->id, TRUE);
            }
        }
    } else {
        return null;
    }
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:25,代码来源:runtime.php


示例20: show

 public function show()
 {
     Layout::addPageTitle("Hall Notification Edit");
     $tpl = array();
     $submitCmd = CommandFactory::getCommand('ReviewHallNotificationMessage');
     $form = new PHPWS_Form('email_content');
     $submitCmd->initForm($form);
     if (Current_User::allow('hms', 'anonymous_notifications')) {
         $form->addCheck('anonymous');
         $form->setMatch('anonymous', $this->anonymous);
         $form->setLabel('anonymous', 'Send Anonymously');
     }
     $form->addText('subject', !is_null($this->subject) ? $this->subject : '');
     $form->setLabel('subject', 'Subject');
     $form->addCssClass('subject', 'form-control');
     $form->setSize('subject', 35);
     $form->setExtra('subject', 'autofocus');
     $form->addTextarea('body', !is_null($this->body) ? $this->body : '');
     $form->addCssClass('body', 'form-control');
     $form->setLabel('body', 'Message:');
     if (!empty($this->halls)) {
         $form->addHidden('hall', $this->halls);
     }
     if (!empty($this->floors)) {
         $form->addHidden('floor', $this->floors);
     }
     return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/hall_notification_email_page.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:28,代码来源:ShowHallNotificationEditView.php



注:本文中的Current_User类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CustomCriteriaLeaf类代码示例发布时间:2022-05-23
下一篇:
PHP Current类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap