當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionUtil類代碼示例

本文整理匯總了PHP中SessionUtil的典型用法代碼示例。如果您正苦於以下問題:PHP SessionUtil類的具體用法?PHP SessionUtil怎麽用?PHP SessionUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SessionUtil類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: FlashChatBridge_user_showChat

function FlashChatBridge_user_showChat()
{
    // perform permission check
    if (!SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_READ)) {
        return LogUtil::registerPermissionError();
    }
    $popup = FormUtil::getPassedValue('popup', false);
    // Security check
    $render =& pnRender::getInstance('FlashChatBridge', false);
    $UserVars = pnUserGetVars(SessionUtil::getVar('uid'));
    $client_type = FormUtil::getPassedValue('client_type', 'standard');
    $settings = pnModGetVar('FlashChatBridge');
    $settings['init_user'] = $UserVars['uname'];
    $settings['init_password'] = $UserVars['pass'];
    if ($settings['autosize'] == 1) {
        $settings['width'] = "100%";
        $settings['height'] = "100%";
    }
    if ($popup) {
        $settings['width'] = "100%";
        $settings['height'] = "100%";
        $render->assign('settings', $settings);
        $chat = $render->fetch("flashchatbridge_user_chat_{$client_type}.htm");
        $render->assign('chat', $chat);
        echo $render->fetch('flashchatbridge_user_popup.htm');
        exit;
    } else {
        $render->assign('settings', $settings);
        return $render->fetch("flashchatbridge_user_chat_{$client_type}.htm");
    }
}
開發者ID:tempbottle,項目名稱:FlashChatBridge,代碼行數:31,代碼來源:pnuser.php

示例2: index

 public function index()
 {
     echo "{" + "name" + ":" + "huangzhen" + "," + "age" + ":" + "23" + "}";
     if ('6' == SessionUtil::get('user_id')) {
         echo 'fuck';
     }
 }
開發者ID:Diaosir,項目名稱:ziku,代碼行數:7,代碼來源:test_c.php

示例3: handleForm

 public function handleForm(Context $context, $action)
 {
     if ($action == "createReservation") {
         if (isset($_POST['equip_id']) && $_POST['equip_id'] != "" && (isset($_POST['start_date']) && $_POST['start_date'] != "") && (isset($_POST['length']) && $_POST['length'] != "")) {
             $equipId = $_POST['equip_id'];
             $equip = EquipmentDao::getEquipmentByID($equipId);
             if ($equip != null) {
                 if (SessionUtil::getUserlevel() >= $equip->minUserLevel) {
                     $startDate = $_POST['start_date'];
                     $endDate = DateUtil::incrementDate($startDate, $_POST['length']);
                     $reservations = ReservationDao::getReservationsForEquipmentByDate($equipId, $startDate, $endDate);
                     if (count($reservations) == 0) {
                         $user = UserDao::getUserByUsername(SessionUtil::getUsername());
                         $reservation = ReservationDao::createReservation($user->id, $equipId, $_POST['length'], $startDate, $endDate, $_POST['user_comment']);
                         EmailUtil::sendNewReservationNotices($user, $reservation);
                     } else {
                         $context->addError("Reservations already exist during selected dates ({$startDate} and {$endDate}).");
                     }
                 } else {
                     $context->addError("Cannot reserve equipment (User Level).");
                 }
             } else {
                 $context->addError("No such equipment.");
             }
         } else {
             $context->addError("Required Field Left Blank.");
         }
     } else {
         $context->addError("Incorrect Action.");
     }
 }
開發者ID:ramielrowe,項目名稱:Reservation-System-V2,代碼行數:31,代碼來源:PlaceReservationHandler.php

示例4: __toString

 public function __toString()
 {
     if (SessionUtil::getUserlevel() >= RES_USERLEVEL_ADMIN) {
         return "<a href=\"./index.php?pageid=editUser&userid=" . $this->id . "\">" . $this->name . "</a>";
     }
     return $this->name;
 }
開發者ID:ramielrowe,項目名稱:Reservation-System-V2,代碼行數:7,代碼來源:User.php

示例5: __construct

 public function __construct($className_, $tableName)
 {
     $this->className = $className_;
     $this->tableName = $tableName;
     $sessionUtil = SessionUtil::getInstance();
     $this->companySeq = $sessionUtil->getAdminLoggedInCompanySeq();
 }
開發者ID:munishsethi777,項目名稱:jmpkng,代碼行數:7,代碼來源:BeanDataStore.php

示例6: handleForm

 public function handleForm($context, $action)
 {
     if ($action == "createAd") {
         if (isset($_POST['start']) && $_POST['start'] != "" && (isset($_POST['size']) && $_POST['size'] != "") && (isset($_POST['name']) && $_POST['name'] != "") && (isset($_POST['url']) && $_POST['url'] != "")) {
             $start = $_POST['start'];
             $dayOfWeek = date("D", strtotime($start));
             if ($dayOfWeek == "Mon") {
                 $splitStart = explode("/", $start);
                 $mysqlStart = $splitStart[2] . "-" . $splitStart[0] . "-" . $splitStart[1];
                 if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) {
                     $filename = $this->saveSampleImage($context, $_FILES['image'], SessionUtil::getUsername());
                     if ($filename != "") {
                         WebAdDao::createWebAd($_POST['name'], $mysqlStart, $_POST['size'], $filename, $_POST['url']);
                     } else {
                         $context->addError("Error Uploading File, Please Try Again.");
                     }
                 } else {
                     $context->addError("No File Uploaded.");
                 }
             } else {
                 $context->addError("Starting Date Not a Monday.");
             }
         } else {
             $context->addError("Required Field Left Blank.");
         }
     } else {
         $context->addError("Incorrect Action.");
     }
 }
開發者ID:ramielrowe,項目名稱:Reservation-System-V2,代碼行數:29,代碼來源:CreateAdHandler.php

示例7: getCheckinRow

 private function getCheckinRow(Reservation $reservation)
 {
     if (SessionUtil::getUserlevel() == RES_USERLEVEL_ADMIN) {
         return "<tr>\n\t\t\t\t\t\n\t\t\t\t\t<form action=\"./index.php?pageid=viewReservation\" method=\"POST\">\n\t\t\t\t\t<td class=\"centeredcellbold\">\n\t\t\t\t\t" . $this->getCheckinCell($reservation) . "\n\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t\t<form action=\"./index.php?pageid=viewReservation\" method=\"POST\" onSubmit=\"return confirm('Are you sure you want to delete this reservation?')\">\n\t\t\t\t\t<td class=\"centeredcellbold\">\n\t\t\t\t\t\t<input type=\"hidden\" value=\"delete\" name=\"action\">\n\t\t\t\t\t\t<input type=\"hidden\" value=\"" . $reservation->id . "\" name=\"resid\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"Delete\">\n\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t\t<form action=\"./index.php?pageid=viewReservation\" method=\"POST\">\n\t\t\t\t\t<td class=\"centeredcellbold\">\n\t\t\t\t\t\t<input type=\"hidden\" value=\"" . $reservation->id . "\" name=\"resid\">\n\t\t\t\t\t\t<select name=\"status\">\n\t\t\t\t\t\t\t<option value=\"" . RES_STATUS_CONFIRMED . "\">Approve</option>\n\t\t\t\t\t\t\t<option value=\"" . RES_STATUS_DENIED . "\">Deny</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"centeredcellbold\">\n\t\t\t\t\t\t<input type=\"hidden\" value=\"updateStatus\" name=\"action\">\n\t\t\t\t\t\t<input type=\"hidden\" value=\"" . $reservation->id . "\" name=\"resid\">\n\t\t\t\t\t\t<input type=\"submit\" value=\"Update\">\n\t\t\t\t\t</td>\n\t\t\t\t\t</form>\n\t\t\t\t\t\n\t\t\t\t</tr>";
     } else {
         return "";
     }
 }
開發者ID:ramielrowe,項目名稱:Reservation-System-V2,代碼行數:8,代碼來源:ViewReservationBody.php

示例8: generateHTML

 public function generateHTML()
 {
     if (SessionUtil::getUserlevel() >= $this->getMinimumUserLevel()) {
         return $this->layout->generateHTML();
     } else {
         return $this->userLevelErrorLayout->generateHTML();
     }
 }
開發者ID:ramielrowe,項目名稱:Web-Ads,代碼行數:8,代碼來源:Page.php

示例9: onKernelRequestSessionExpire

 public function onKernelRequestSessionExpire(GetResponseEvent $event)
 {
     if (\SessionUtil::hasExpired()) {
         // Session has expired, display warning
         $response = new Response(\ModUtil::apiFunc('ZikulaUsersModule', 'user', 'expiredsession'), 403);
         $this->setResponse($event, $response);
     }
 }
開發者ID:rmaiwald,項目名稱:core,代碼行數:8,代碼來源:SessionExpireListener.php

示例10: contentMainEditExpandAll

 public static function contentMainEditExpandAll($belowPageId = null)
 {
     $expandedPageIds = SessionUtil::getVar('contentExpandedPageIds', array());
     foreach (Content_Util::contentMainEditGetPagesList($belowPageId) as $page) {
         $expandedPageIds[$page['id']] = 1;
     }
     SessionUtil::setVar('contentExpandedPageIds', $expandedPageIds);
 }
開發者ID:robbrandt,項目名稱:Content,代碼行數:8,代碼來源:Util.php

示例11: generateHTML

 function generateHTML()
 {
     $user = UserDao::getUserByUsername(SessionUtil::getUsername());
     $changePasswordRows = "";
     if (Config::login_type == LOGIN_TYPE_DB) {
         $changePasswordRows = "\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td class=\"centeredcellbold\">Change Password</td>\n\t\t\t\t<td class=\"centeredcellbold\">Current Password</td>\n\t\t\t\t<td class=\"centeredcellbold\">New Password</td>\n\t\t\t\t<td class=\"centeredcellbold\">Confirm Password</td>\n\t\t\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t\t<form action=\"./index.php?pageid=savepassword\" method=\"POST\"><td class=\"centeredcellbold\"><input type=\"submit\" value=\"Save Password\"></td>\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"curpass\"></td>\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"newpass\"></th>\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"confpass\"></td></form>\n\t\t\t\n\t\t\t\t</tr>";
     }
     return "<center><h3>My Account</h3>" . $this->context->getErrorHTML() . "</center>\n\t\t\t\n\t\t\t<table class=\"myaccount\">\n\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t\t<td colspan=4 class=\"header\">Edit User Information</td>\n\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\n\t\t\t\t\t<td class=\"centeredcellbold\">Username</td>\n\t\t\t\t\t<td colspan=3 class=\"centeredcell\">" . $user->username . "</td>\n\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\n\t\t\t\t<tr>\n\t\t\n\t\t\t\t\t<td class=\"centeredcellbold\">Name</th>\n\t\t\t\t\t<td colspan=3 class=\"centeredcell\">" . $user->name . "</td>\n\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\n\t\t\t\t" . $changePasswordRows . "\n\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t\n\t\t\t\t\t<form action=\"./index.php?pageid=saveemail\" method=\"POST\">\n\t\t\t\t\t<td colspan=1 class=\"centeredcellbold\">Email</th><td colspan=3 class=\"centeredcell\"><input type=\"text\" name=\"email\" size=30 value=\"" . $user->email . "\"><input type=\"submit\" value=\"Save Email\"></td></form>\n\t\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\n\t\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t\t<td colspan=1 class=\"centeredcellbold\">Warnings</th>\n\t\t\t\t\t<td class=\"centeredcellbold\" colspan=3><a href=\"./index.php?pageid=viewMyWarnings\">" . WarningDao::getWarningCountForUserByType($user->id, RES_WARNING_ACTIVE) . "(" . WarningDao::getWarningCountForUser($user->id) . ")</a></td>\n\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t</table>";
 }
開發者ID:ramielrowe,項目名稱:Reservation-System-V2,代碼行數:9,代碼來源:MyAccountBody.php

示例12: sessionExpired

 /**
  * Event: 'frontcontroller.predispatch'.
  *
  * @param GenericEvent $event
  *
  * @return void
  */
 public function sessionExpired(GenericEvent $event)
 {
     if (\SessionUtil::hasExpired()) {
         // Session has expired, display warning
         header('HTTP/1.0 403 Access Denied');
         $return = \ModUtil::apiFunc('UsersModule', 'user', 'expiredsession');
         \System::shutdown();
     }
 }
開發者ID:planetenkiller,項目名稱:core,代碼行數:16,代碼來源:SystemListener.php

示例13: __construct

 function __construct()
 {
     // Set Token
     if (SessionUtil::session('token')) {
         $this->token = SessionUtil::session('token');
     }
     //Set the loggedIn
     $this->loggedIn = SessionUtil::session('loggedIn');
 }
開發者ID:pman117,項目名稱:qdinka,代碼行數:9,代碼來源:SessionClass.php

示例14: sessionExpired

 /**
  * Event: 'frontcontroller.predispatch'.
  *
  * @param Zikula_Event $event
  *
  * @return void
  */
 public function sessionExpired(Zikula_Event $event)
 {
     if (SessionUtil::hasExpired()) {
         // Session has expired, display warning
         header('HTTP/1.0 403 Access Denied');
         echo ModUtil::apiFunc('Users', 'user', 'expiredsession');
         Zikula_View_Theme::getInstance()->themefooter();
         System::shutdown();
     }
 }
開發者ID:projectesIF,項目名稱:Sirius,代碼行數:17,代碼來源:SystemListeners.php

示例15: handleClientDesign

 public function handleClientDesign(Context $context)
 {
     $insertDate = explode('/', $_POST['insertdate']);
     $mysqlFormattedDate = $insertDate[2] . "-" . $insertDate[1] . "-" . $insertDate[0];
     $clientId = ClientDao::getClientByLogin(LoginDao::getLoginByUsername(SessionUtil::getUsername()))->getID();
     $filename = $this->saveSampleImage($context, $_FILES['sampleimage'], $clientId);
     if ($filename != "") {
         InsertionOrderDao::createForClientWithImage(ClientDao::getClientByLogin(LoginDao::getLoginByUsername(SessionUtil::getUsername()))->getID(), $mysqlFormattedDate, $_POST['design'], $_POST['color'], $_POST['columns'], $_POST['height'], $_POST['inserts'], $_POST['placements'], $filename);
     }
 }
開發者ID:ramielrowe,項目名稱:RU-Ad-System,代碼行數:10,代碼來源:CreateInsertionHandler.php


注:本文中的SessionUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。