当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::getUser方法代码示例

本文整理汇总了PHP中Session::getUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::getUser方法的具体用法?PHP Session::getUser怎么用?PHP Session::getUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Session的用法示例。


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

示例1: editContest

 static function editContest($contest, $data)
 {
     $data = Filter::filterArray($data);
     $contest->edit($data);
     $contestdao = new ContestDao();
     return $contestdao->update($contest, Session::getUser());
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:7,代码来源:ContestManager.php

示例2: editResource

 static function editResource($resourceID, $data)
 {
     $resource = self::loadResource($resourceID);
     $resource->edit($data);
     $resourcedao = new ResourceDao();
     return $resourcedao->update($resource, Session::getUser());
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:7,代码来源:ResourceManager.php

示例3: process

 public function process()
 {
     global $db;
     $sql = 'UPDATE users SET `group` = :group, email = :email, organization = :organizer, usernameSteam = :usernameSteam WHERE id = :id';
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':id', $this->getElementValue('uid'));
     $stmt->bindValue(':email', $this->getElementValue('email'));
     $stmt->bindValue(':usernameSteam', $this->getElementValue('usernameSteam'));
     if (Session::getUser()->hasPriv('EDIT_USER')) {
         $stmt->bindValue(':organizer', $this->getElementValue('organizer'));
         $stmt->bindValue(':group', $this->getElementValue('group'));
         $stmt->execute();
         $newPassword = $this->getElementValue('password');
         if (!empty($newPassword)) {
             $this->changePassword($newPassword);
         }
         redirect('viewUser.php?id=' . $this->getElementValue('uid'), 'User edited.');
     } else {
         $user = $this->getUser();
         $stmt->bindValue(':organizer', $user['organization']);
         $stmt->bindValue(':group', $user['group']);
         $stmt->execute();
         Session::getUser()->getData('username', false);
         redirect('account.php?', 'Updated profile');
     }
 }
开发者ID:jamesread,项目名称:lanlist.org,代码行数:26,代码来源:FormEditUser.php

示例4: process

 public function process()
 {
     if (Session::isLoggedIn()) {
         Session::getUser()->setData('location', $this->getElementValue('location'));
     }
     setcookie('mylocation', $this->getElementValue('location'));
 }
开发者ID:jamesread,项目名称:lanlist.org,代码行数:7,代码来源:FormSetLocation.php

示例5: process

 public function process()
 {
     global $db;
     $sql = 'INSERT INTO organizers (title, websiteUrl, published, blurb, created) VALUES (:title, :websiteUrl, :published, :blurb, :created) ';
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':title', $this->getElementValue('title'));
     $stmt->bindValue(':websiteUrl', $this->getElementValue('websiteUrl'));
     $stmt->bindValue(':blurb', $this->getElementValue('blurb'));
     $stmt->bindValue(':created', date(DATE_ATOM));
     if (Session::getUser()->hasPriv('CREATE_ORGANIZERS')) {
         $stmt->bindValue(':published', 1);
         $stmt->execute();
         redirect('account.php', 'Organizer created.');
     } else {
         $stmt->bindValue(':published', 0);
         $stmt->execute();
         $sql = 'UPDATE users SET organization = :organization WHERE id = :userId LIMIT 1';
         $stmt = $db->prepare($sql);
         $stmt->bindValue(':organization', $db->lastInsertId());
         $stmt->bindValue(':userId', Session::getUser()->getId());
         $stmt->execute();
         // Refresh the cached organizer.
         Session::getUser()->getData('organization', false);
         redirect('account.php', 'Organizer assigned to you.');
     }
 }
开发者ID:jamesread,项目名称:lanlist.org,代码行数:26,代码来源:FormNewOrganizer.php

示例6: widget

 function widget()
 {
     $user = Session::getUser();
     if ($user) {
         $this->data->user = $user;
         $this->data->is_logged_in = true;
     }
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:8,代码来源:AuthenticateController.php

示例7: INSERT

 public static function INSERT()
 {
     $row = parent::INSERT();
     $row->setContent(Document::INSERT());
     $row->setComments(Comment::INSERT());
     $row->setTimeCreation(time());
     $row->setTimePublished(time() + 60 * 60 * 24 * 30);
     $row->setAuthor(Session::getUser());
     return $row;
 }
开发者ID:fulldump,项目名称:8,代码行数:10,代码来源:extended.class.php

示例8: editPost

 /**
  * Modifica un post "semplice".
  * 
  * @param data: array associativo contenente i dati.
  * Le chiavi ricercate dal sistema per questo array sono:
  * title: titolo del post (string filtrata)
  * subtitle: sottotitolo del post (string filtrata)
  * headline: occhiello del post (string filtrata)
  * tags: array di oggetti Tag
  * categories: array di oggetti Category
  * content: il testo di un articolo (filtrato), l'indirizzo del videoreportage o l'elenco di indirizzi di foto di un fotoreportage
  * visibile: indica la visibilità dell'articolo se non visibile è da considerare come una bozza (boolean)
  *
  * @return: l'articolo modificato.
  */
 static function editPost($post, $data)
 {
     if (isset($data["ID"])) {
         unset($data["ID"]);
     }
     $data = Filter::filterArray($data);
     $p->edit($data);
     $postdao = new PostDao();
     $post = $postdao->update($p, Session::getUser());
     return $post;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:26,代码来源:PostManager.php

示例9: process

 public function process()
 {
     global $db;
     $sql = 'INSERT INTO organization_join_requests (user, organizer, comments) VALUES (:user, :organization, :comments) ';
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':user', Session::getUser()->getId());
     $stmt->bindValue(':organization', $this->getElementValue('organization'));
     $stmt->bindValue(':comments', $this->getElementValue('comments'));
     $stmt->execute();
     redirect('account.php', 'Thanks, your request to join will be approved or denied as quickly as possible!');
 }
开发者ID:jamesread,项目名称:lanlist.org,代码行数:11,代码来源:FormJoinOrganizer.php

示例10: logout

 public static function logout()
 {
     if (!Session::getUser()) {
         Session::deleteSessionCookie();
         return;
     }
     $token = Session::getSessionCookie();
     $session = UserSession::findByToken($token);
     $session->expired = 1;
     $session->save();
     Session::deleteSessionCookie();
 }
开发者ID:pvpalvk,项目名称:kyberkoulutus2,代码行数:12,代码来源:Session.php

示例11: onOpen

 function onOpen() {
   $role = $this->getAttribute('role');
   if($u = Session::getUser()) {
     if($role) {
       return $u->isRole($role) ? HTMLTag::PROCESS_BODY : HTMLTag::SKIP_BODY;
     } else {
       return HTMLTag::PROCESS_BODY;
     }
   } else {
     return HTMLTag::SKIP_BODY;
   }
 }
开发者ID:BackupTheBerlios,项目名称:freeform-frmwrk,代码行数:12,代码来源:HTMLIfUser.php5

示例12: mostrarTodos

function mostrarTodos()
{
    $sesion = new Session();
    $user = $sesion->getUser();
    $arra2 = unserialize(file_get_contents("canciones/archivo.txt"));
    foreach ($arra2 as $key => $valor) {
        if ($arra2[$key]["privado"] == "ON" && $user != $arra2[$key]["user"]) {
            //No muestra los videos privados de otros users.
        } else {
            echo '<img src="canciones/' . $key . '/' . $arra2[$key]["imagen"] . '"/>';
            $cancion = new Cancion($arra2[$key]["user"], $key, $arra2[$key]["genero"], $arra2[$key]["audio"], $arra2[$key]["imagen"], $arra2[$key]["privado"]);
            $sesion->set($key, $cancion);
            echo "<a href=\"escuchar.php?c={$key}\">Escuchar</a>";
        }
    }
}
开发者ID:JuanManuelOlalla,项目名称:practica1,代码行数:16,代码来源:phpBuscar.php

示例13: applicationLayout

function applicationLayout()
{
    $r = getRenderer();
    $form = new Form(array('controller' => 'Company', 'action' => 'show', 'method' => 'get', 'title' => 'getName', 'auto_submit' => array('id')));
    $f = $r->classSelect('Company', array('title' => 'Jump to Client', 'id' => 'client_quicksearch', 'name' => 'id'));
    $form->content = $f;
    $client_search_form = $form->html;
    $bookmark_widget = $r->view('bookmarkWidget', array());
    $hour_widget = $r->view('hourWidget', array());
    if (Session::sessionExists()) {
        $bookmarks = Session::getUser()->getBookmarks();
        $bookmark_list = $r->view('bookmarkTable', $bookmarks);
    } else {
        $bookmark_list = '';
    }
    return array('client_quicksearch' => $client_search_form, 'bookmark' => $bookmark_widget, 'bookmark_list' => $bookmark_list, 'hour_widget' => $hour_widget);
}
开发者ID:radicaldesigns,项目名称:gtd,代码行数:17,代码来源:application_layout.php

示例14: process

 public function process()
 {
     global $db;
     $sql = 'INSERT INTO venues (title, lat, lng, organizer, country) VALUES (:title, :lat, :lng, :organizer, :country) ';
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':title', $this->getElementValue('title'));
     $stmt->bindValue(':lat', $this->getElementValue('lat'));
     $stmt->bindValue(':lng', $this->getElementValue('lng'));
     $stmt->bindValue(':country', $this->getElementValue('country'));
     if (Session::hasPriv('NEW_VENUE')) {
         $stmt->bindValue(':organizer', $this->getElementValue('organizer'));
     } else {
         $stmt->bindValue('organizer', Session::getUser()->getData('organization'));
     }
     $stmt->execute();
     Logger::messageDebug('Venue ' . $this->getElementValue('title') . ' created by: ' . Session::getUser()->getUsername(), LocalEventType::CREATE_VENUE);
     redirect('account.php', 'Venue created.');
 }
开发者ID:jamesread,项目名称:lanlist.org,代码行数:18,代码来源:FormNewVenue.php

示例15: __construct

 public function __construct()
 {
     parent::__construct('formEditVenue', 'Edit Venue');
     $venue = $this->getVenue();
     if (Session::getUser()->getData('organization') != $venue['organizer']) {
         Session::requirePriv('EDIT_VENUE');
     }
     $this->addElement(Element::factory('hidden', 'id', null, $venue['id']));
     $this->addElement(Element::factory('text', 'title', 'Title', $venue['title']));
     $this->addElement(Element::factory('text', 'lat', 'Lat', $venue['lat']));
     $this->getElement('lat')->setMinMaxLengths(1, 10);
     $this->addElement(Element::factory('text', 'lng', 'Lng', $venue['lng']));
     $this->getElement('lng')->setMinMaxLengths(1, 10);
     $this->addElement(FormHelpers::getElementCountry($venue['country']));
     $this->addElement(FormHelpers::getOrganizerList());
     $this->getElement('organizer')->setValue($venue['organizer']);
     $this->addButtons(Form::BTN_SUBMIT);
 }
开发者ID:jamesread,项目名称:lanlist.org,代码行数:18,代码来源:FormEditVenue.php


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