当前位置: 首页>>代码示例>>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;未经允许,请勿转载。