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

PHP SessionAccountHandler类代码示例

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

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



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

示例1: insertNewTag

 private function insertNewTag()
 {
     $InsertTag = new Model\Tag\Inserter($this->PDO, $this->TagObject);
     $InsertTag->setAccountID(\SessionAccountHandler::getId());
     $InsertTag->insert();
     return $InsertTag->insertedID();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:7,代码来源:ChosenInserter.php


示例2: __construct

 /**
  * Construct importer
  * @param string $fileName relative to FRONTEND_PATH
  */
 public function __construct($fileName)
 {
     $this->Reader = new BigFileReaderGZip($fileName);
     $this->DB = DB::getInstance();
     $this->AccountID = USER_MUST_LOGIN ? SessionAccountHandler::getId() : 0;
     $this->Results = new RunalyzeJsonImporterResults();
 }
开发者ID:schoch,项目名称:Runalyze,代码行数:11,代码来源:class.RunalyzeJsonImporter.php


示例3: getFieldsetBlock

    /**
     * Get fieldset block
     * @return string
     */
    private function getFieldsetBlock()
    {
        $String = '';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $activityIDs[] = $TrainingObject->getActivityId();
        }
        $duplicates = (new DuplicateFinder(DB::getInstance(), SessionAccountHandler::getId()))->checkForDuplicates($activityIDs);
        $countDuplicates = count(array_filter($duplicates));
        $String .= HTML::info(sprintf(__('Found %s activities.'), count($this->TrainingObjects)));
        if ($countDuplicates > 0) {
            $String .= HTML::warning(_n('Found <strong>one</strong> duplicate activity.', 'Found duplicate activities.', $countDuplicates));
        }
        $String .= '<table class="fullwidth multi-import-table zebra-style c" id="multi-import-table">';
        $String .= '<thead><tr><th>' . __('Import') . '</th><th>' . __('Date') . '</th><th>' . __('Duration') . '</th><th>' . __('Distance') . '</th><th colspan="4"></th></tr></thead>';
        $String .= '<tbody>';
        foreach ($this->TrainingObjects as $i => $TrainingObject) {
            $String .= '<tr>' . $this->getTableRowFor($TrainingObject, $i, $duplicates[$TrainingObject->getActivityId()]) . '</tr>';
        }
        $String .= '</tbody>';
        $String .= '</table>';
        $String .= Ajax::wrapJSforDocumentReady('
			$("#multi-import-table td").click(function(e){
				if ($(e.target).closest(\'input[type="checkbox"]\').length == 0)
					$(this).parent().find(\'input:checkbox\').attr(\'checked\', !$(this).parent().find(\'input:checkbox\').attr(\'checked\'));
			});
		');
        return $String;
    }
开发者ID:rob-st,项目名称:Runalyze,代码行数:32,代码来源:class.MultiImporterFormular.php


示例4: __construct

 /**
  * Constructor
  * @param string $Type
  */
 public function __construct($Type)
 {
     $ExporterClass = 'Exporter' . $Type;
     if (class_exists($ExporterClass)) {
         $this->Exporter = new $ExporterClass(new Context(Request::sendId(), SessionAccountHandler::getId()));
     }
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:11,代码来源:class.ExporterFactory.php


示例5: displayContent

    /**
     * Display the content
     * @see PluginPanel::displayContent()
     */
    protected function displayContent()
    {
        echo $this->getStyle();
        echo '<div id="schuhe">';
        // TODO: Use data from shoe factory
        $inuse = true;
        $schuhe = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'shoe` WHERE accountid = ' . SessionAccountHandler::getId() . ' ORDER BY `inuse` DESC, `km` DESC')->fetchAll();
        foreach ($schuhe as $schuh) {
            $Shoe = new Shoe($schuh);
            if ($inuse && $Shoe->isInUse() == 0) {
                echo '<div id="hiddenschuhe" style="display:none;">';
                $inuse = false;
            }
            echo '<p style="position:relative;">
				<span class="right">' . $Shoe->getKmString() . '</span>
				<strong>' . ShoeFactory::getSearchLink($schuh['id']) . '</strong>
				' . $this->getShoeUsageImage($Shoe->getKm()) . '
			</p>';
        }
        if (empty($schuhe)) {
            echo HTML::em(__('You don\'t have any shoes'));
        }
        if (!$inuse) {
            echo '</div>';
        }
        echo '</div>';
        if (!$inuse) {
            echo Ajax::toggle('<a class="right" href="#schuhe" name="schuhe">' . __('Show unused shoes') . '</a>', 'hiddenschuhe');
        }
        echo HTML::clearBreak();
    }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:35,代码来源:class.RunalyzePluginPanel_Schuhe.php


示例6: initTraining

 /**
  * Init training
  */
 private function initTraining()
 {
     // TODO: Cache?
     $this->ActivityContext = new Activity\Context(SharedLinker::getTrainingId(), SessionAccountHandler::getId());
     if ($this->ActivityContext->activity()->id() <= 0) {
         $this->ActivityContext = null;
     }
 }
开发者ID:9x,项目名称:Runalyze,代码行数:11,代码来源:class.FrontendShared.php


示例7: __construct

 /**
  * Construct summary table
  * @param \Runalyze\Dataset\Configuration $datasetConfig
  * @param int $sportid
  * @param int $year
  */
 public function __construct(Dataset\Configuration $datasetConfig, $sportid, $year)
 {
     $this->AccountID = SessionAccountHandler::getId();
     $this->DatasetQuery = new Dataset\Query($datasetConfig, DB::getInstance(), $this->AccountID);
     $this->DatasetTable = new Runalyze\View\Dataset\Table($datasetConfig);
     $this->Sportid = $sportid;
     $this->Year = $year;
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:14,代码来源:class.SummaryTable.php


示例8: handleRequest

 /**
  * Handle request
  */
 private function handleRequest()
 {
     if (strlen(Request::param('public')) > 0) {
         $Updater = new Activity\Updater(DB::getInstance());
         $Updater->setAccountID(SessionAccountHandler::getId());
         $Updater->update(new Activity\Object(array('id' => $this->TrainingID, Activity\Object::IS_PUBLIC => Request::param('public') == 'true' ? 1 : 0)), array(Activity\Object::IS_PUBLIC));
     }
 }
开发者ID:9x,项目名称:Runalyze,代码行数:11,代码来源:class.ExporterWindow.php


示例9: fetchByID

 /**
  * Fetch row by id
  * @param string $table without PREFIX
  * @param int $ID
  * @return array
  */
 public function fetchByID($table, $ID)
 {
     $table = str_replace(PREFIX, '', $table);
     if ($table == 'account' || $table == 'plugin_conf') {
         return $this->query('SELECT * FROM `' . PREFIX . $table . '` WHERE `id`=' . (int) $ID . ' LIMIT 1')->fetch();
     }
     return $this->query('SELECT * FROM `' . PREFIX . $table . '` WHERE `id`=' . (int) $ID . ' AND `accountid`="' . SessionAccountHandler::getId() . '" LIMIT 1')->fetch();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:14,代码来源:class.PDOforRunalyze.php


示例10: equipmentTypeIdForNewStuff

 /**
  * @return int|null
  */
 protected function equipmentTypeIdForNewStuff()
 {
     if (null === $this->NewEquipmentTypeId) {
         $this->NewEquipmentTypeId = DB::getInstance()->insert('equipment_type', ['name', 'accountid'], ['RunningAHEAD', SessionAccountHandler::getId()]);
         DB::getInstance()->exec('INSERT INTO `' . PREFIX . 'equipment_sport` (`sportid`, `equipment_typeid`) SELECT `id`, "' . $this->NewEquipmentTypeId . '" FROM `runalyze_sport` WHERE `accountid`=' . SessionAccountHandler::getId());
     }
     return $this->NewEquipmentTypeId;
 }
开发者ID:rob-st,项目名称:Runalyze,代码行数:11,代码来源:class.ParserXMLrunningAHEADMultiple.php


示例11: uninstall

 /**
  * Uninstall
  * @return bool
  */
 public function uninstall()
 {
     $Factory = new PluginFactory();
     $Plugin = $Factory->newInstance($this->Key);
     DB::getInstance()->deleteByID('plugin', $Plugin->id());
     DB::getInstance()->query('DELETE FROM `' . PREFIX . 'plugin_conf` WHERE `pluginid`=' . $Plugin->id() . ' AND accountid = ' . SessionAccountHandler::getId());
     PluginFactory::clearCache();
     return true;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:13,代码来源:class.PluginInstaller.php


示例12: cacheAllClothes

 /**
  * Cache Clothes
  */
 private static function cacheAllClothes()
 {
     $clothes = Cache::get(self::CACHE_KEY);
     if (is_null($clothes)) {
         $clothes = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'clothes` WHERE accountid = ' . SessionAccountHandler::getId())->fetchAll();
         Cache::set(self::CACHE_KEY, $clothes, '3600');
     }
     return $clothes;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:12,代码来源:class.ClothesFactory.php


示例13: fetchAllPlugins

 /**
  * Cache all from Table plugin for a user
  */
 private static function fetchAllPlugins()
 {
     $data = Cache::get(self::CACHE_KEY);
     if ($data == NULL) {
         $data = self::fetchAllPluginsFrom(DB::getInstance(), SessionAccountHandler::getId());
         Cache::set(self::CACHE_KEY, $data, '3600');
     }
     return $data;
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:12,代码来源:class.PluginFactory.php


示例14: __construct

 /**
  * Construct importer
  * @param string $fileName relative to FRONTEND_PATH
  * @param int $accountID optional, session account id is used otherwise
  */
 public function __construct($fileName, $accountID = false)
 {
     $this->Reader = new GZipReader(FRONTEND_PATH . $fileName);
     $this->DB = DB::getInstance();
     $this->AccountID = SessionAccountHandler::getId();
     $this->Results = new RunalyzeJsonImporterResults();
     if ($accountID !== false) {
         $this->AccountID = $accountID;
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:15,代码来源:class.RunalyzeJsonImporter.php


示例15: loadAccountID

 /**
  * Load account ID
  * @return int
  */
 private static function loadAccountID()
 {
     if (defined('RUNALYZE_TEST')) {
         return null;
     }
     if (\AccountHandler::$IS_ON_REGISTER_PROCESS) {
         return \AccountHandler::$NEW_REGISTERED_ID;
     }
     return \SessionAccountHandler::getId();
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:14,代码来源:Configuration.php


示例16: getListLinkForCurrentUser

 /**
  * Get link to shared list for current user
  * @param string $text [optional]
  * @return string 
  */
 public static function getListLinkForCurrentUser($text = null)
 {
     if (!Configuration::Privacy()->listIsPublic()) {
         return '';
     }
     if (is_null($text)) {
         $text = Icon::$ATTACH;
     }
     return '<a href="shared/' . SessionAccountHandler::getUsername() . '/" target="_blank" ' . Ajax::tooltip('', __('Public list'), false, true) . '>' . $text . '</a>';
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:15,代码来源:class.SharedLinker.php


示例17: setGeneralInfo

 /**
  * Set general info 
  */
 protected function setGeneralInfo()
 {
     if (strlen(SessionAccountHandler::getName()) > 0) {
         $this->XML->AthleteLog->Athlete->addAttribute('Name', SessionAccountHandler::getName());
     }
     $this->Activity->addAttribute('StartTime', $this->timeToString($this->Context->activity()->timestamp()));
     $this->Activity->Duration->addAttribute('TotalSeconds', (int) $this->Context->activity()->duration());
     $this->Activity->Distance->addAttribute('TotalMeters', 1000 * $this->Context->activity()->distance());
     $this->Activity->Calories->addAttribute('TotalCal', $this->Context->activity()->calories());
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:13,代码来源:class.ExporterFITLOG.php


示例18: handleRequest

 /**
  * Handle request
  */
 protected function handleRequest()
 {
     if (Request::param('use-calculated-value') == 'true') {
         $oldObject = clone $this->Context->activity();
         $this->Context->activity()->set(Model\Activity\Object::ELEVATION, $this->Context->route()->elevation());
         $Updater = new Model\Activity\Updater(DB::getInstance(), $this->Context->activity(), $oldObject);
         $Updater->setAccountID(SessionAccountHandler::getId());
         $Updater->update();
     }
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:13,代码来源:class.ElevationInfo.php


示例19: insertShoe

 /**
  * Insert Show
  * @param SimpleXMLElement $Equipment
  */
 private function insertShoe(SimpleXMLElement &$Equipment)
 {
     if ((string) $Equipment->Name == '') {
         return;
     }
     $ExistingShoe = DB::getInstance()->query('SELECT id FROM `' . PREFIX . 'shoe` WHERE name=' . DB::getInstance()->escape($Equipment->Name) . ' AND accountid = ' . SessionAccountHandler::getId() . ' LIMIT 1')->fetch();
     if (isset($ExistingShoe['id'])) {
         self::$NewEquipment[(string) $Equipment->attributes()->id] = $ExistingShoe['id'];
     } else {
         self::$NewEquipment[(string) $Equipment->attributes()->id] = DB::getInstance()->insert('shoe', array('name', 'since', 'additionalKm', 'inuse'), array((string) $Equipment->Name, isset($Equipment->PurchaseInfo) && isset($Equipment->PurchaseInfo['date']) ? (string) $Equipment->PurchaseInfo['date'] : '', isset($Equipment->Distance) && isset($Equipment->Distance['initialDistance']) ? $this->distanceFromUnit($Equipment->Distance['initialDistance'], $Equipment->Distance['unit']) : 0, isset($Equipment->Name['retired']) && (string) $Equipment->Name['retired'] == 'true' ? 0 : 1));
     }
 }
开发者ID:n0rthface,项目名称:Runalyze,代码行数:16,代码来源:class.ParserXMLrunningAHEADMultiple.php


示例20: stringFor

 /**
  * Get string to display this dataset value
  * @param \Runalyze\Dataset\Context $context
  * @return string
  */
 public function stringFor(Context $context)
 {
     $string = '';
     if ($context->hasData(self::CONCAT_TAGIDS_KEY) && $context->data(self::CONCAT_TAGIDS_KEY) != '') {
         $ids = explode(',', $context->data(self::CONCAT_TAGIDS_KEY));
         $Factory = new \Runalyze\Model\Factory(\SessionAccountHandler::getId());
         foreach ($ids as $id) {
             $string .= '#' . $Factory->tag($id)->tag() . ' ';
         }
     }
     return $string;
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:17,代码来源:Tags.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP SessionCache类代码示例发布时间:2022-05-23
下一篇:
PHP Session类代码示例发布时间: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