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


PHP CB\User类代码示例

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


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

示例1: getName

 public function getName($id = false)
 {
     if ($id === false) {
         $id = $this->id;
     }
     switch ($id) {
         case 'tasks':
             return L\get('Tasks');
         case 2:
             return L\get('AssignedToMe');
         case 3:
             return L\get('Created');
         case 4:
             return lcfirst(L\get('Overdue'));
         case 5:
             return lcfirst(L\get('Ongoing'));
         case 6:
             return lcfirst(L\get('Closed'));
         case 'assignee':
             return lcfirst(L\get('Assignee'));
         default:
             if (substr($id, 0, 3) == 'au_') {
                 return \CB\User::getDisplayName(substr($id, 3));
             }
     }
     return 'none';
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:27,代码来源:Tasks.php

示例2: getName

 public function getName($id = false)
 {
     $rez = 'no name';
     if ($id === false) {
         $id = $this->id;
     }
     if (!empty($id) && is_numeric($id)) {
         $facetConfig = $this->getFacetFieldConfig($this->getClassDepth() - 1);
         switch (@$facetConfig['type']) {
             case 'users':
                 $rez = User::getDisplayName($id);
                 break;
             case 'varchar':
                 $rez = $id;
                 break;
             default:
                 $rez = Objects::getName($id);
         }
     } else {
         switch ($id) {
             case 'root':
                 $rez = parent::getName('root');
                 break;
         }
     }
     return $rez;
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:27,代码来源:FacetNav.php

示例3: getClientData

 public function getClientData()
 {
     $rez = array('f' => $this->field, 'title' => $this->getTitle(), 'items' => array());
     foreach ($this->solrData as $k => $v) {
         $rez['items'][$k] = array('name' => User::getDisplayName($k), 'count' => $v);
     }
     return $rez;
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:8,代码来源:UsersFacet.php

示例4: beforeLock

 public function beforeLock($path, \Sabre\DAV\Locks\LockInfo $lock)
 {
     $path = $path;
     //dummy codacy assignment
     $lock->owner = \CB\User::getDisplayName($_SESSION['user']['id']);
     // error_log('beforeLock: ' . $lock->owner);
     return true;
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:8,代码来源:LockPlugin.php

示例5: deleteByNodeId

 public static function deleteByNodeId($nodeId, $userId = false)
 {
     if ($userId == false) {
         $userId = \CB\User::getId();
     }
     DB\dbQuery('DELETE FROM ' . static::getTableName() . ' WHERE user_id = $1 AND node_id = $2', array($userId, $nodeId)) or die(DB\dbQueryError());
     $rez = DB\dbAffectedRows() > 0;
     return $rez;
 }
开发者ID:youprofit,项目名称:casebox,代码行数:9,代码来源:Favorites.php

示例6: testsetAsLoged

 /**
  * @depends testCreate
  */
 public function testsetAsLoged()
 {
     $id = DM\Users::create(array('name' => $this->testName, 'password' => 'qq'));
     $this->assertTrue(is_numeric($id), 'Cant create User');
     \CB\User::setAsLoged($id, 'tests_key');
     $this->assertTrue(\CB\User::isLoged(), ' Error: user is not logged');
     $this->assertEquals($id, $_SESSION['user']['id'], 'Sessions user is not equal with setted users');
     $this->assertEquals('tests_key', $_SESSION['key'], 'Sessions key is not equal with setted keys');
 }
开发者ID:youprofit,项目名称:casebox,代码行数:12,代码来源:UserTest.php

示例7: init

 /**
  *
  * @param type $corename
  */
 public static function init($corename = DEFAULT_TEST_CORENAME)
 {
     $CB_PATH = \CB_DOC_ROOT;
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     $_SERVER['SERVER_NAME'] = static::getHost();
     $_GET['core'] = $corename;
     $_SESSION['user'] = array('id' => 1, 'groups' => [1]);
     require_once $CB_PATH . '/config.php';
     require_once $CB_PATH . '/lib/language.php';
     L\initTranslations();
     Config::setEnvVar('user_language_index', 1);
     \CB\User::setAsLoged(1, 'AbrACadaBraK333y');
 }
开发者ID:youprofit,项目名称:casebox,代码行数:17,代码来源:Helpers.php

示例8: getClientData

 public function getClientData($options = array())
 {
     $rez = array('f' => $this->field, 'title' => $this->getTitle(), 'items' => array());
     // $colors = empty($options['colors'])
     //     ? array()
     //     : Users::getColors();
     foreach ($this->solrData as $k => $v) {
         $rez['items'][$k] = array('name' => User::getDisplayName($k), 'count' => $v);
         if (!empty($options['colors'])) {
             $rez['items'][$k]['cls'] = 'user-color-' . $k;
         }
     }
     return $rez;
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:14,代码来源:UsersFacet.php

示例9: set

 /**
  * set state
  * @param array $p
  */
 public function set($p)
 {
     $rez = array('success' => true);
     $state = User::getUserState();
     if (!empty($p['value']) || isset($state[$p['name']])) {
         if (empty($p['value'])) {
             unset($state[$p['name']]);
         } else {
             $state[$p['name']] = $p['value'];
         }
         User::setUserState($state);
     }
     return $rez;
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:18,代码来源:DBProvider.php

示例10: saveObjectAttachments

/**
 * save attachments array for a given object id
 * @param  int $objectId
 * @param  array &$attachments attachments array as from getMailContentAndAtachment
 * @return void
 */
function saveObjectAttachments($objectId, &$attachments)
{
    $filesApiObject = new \CB\Api\Files();
    foreach ($attachments as $d) {
        if (empty($d['attachment'])) {
            continue;
        }
        //safe content to a temporary file
        $tmpName = tempnam(sys_get_temp_dir(), 'cbMailAtt');
        file_put_contents($tmpName, $d['content']);
        //call the api method
        $filesApiObject->upload(array('pid' => $objectId, 'localFile' => $tmpName, 'oid' => \CB\User::getId(), 'filename' => $d['filename'], 'content-type' => $d['content-type'], 'fileExistAction' => 'autorename'));
    }
}
开发者ID:sebbie42,项目名称:casebox,代码行数:20,代码来源:mail_functions.php

示例11: getData

 public function getData($id = false)
 {
     $rez = array('success' => true);
     parent::getData($id);
     $o = Objects::getCachedObject($this->id);
     $data = $o->getData();
     //show current version only if have more other versions
     if (!empty($data['versions'])) {
         $data['ago_text'] = Util\formatAgoTime($data['cdate']);
         $data['user'] = User::getDisplayName($data['oid'], true);
         $data['cls'] = 'sel';
         $rez['data'] = array($data);
     }
     return $rez;
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:15,代码来源:CurrentVersion.php

示例12: getName

 public function getName($id = false)
 {
     if ($id == false) {
         $id = $this->id;
     }
     $rez = 'no name';
     switch ($id) {
         case 'users':
             $rez = L\get('Users');
             break;
         default:
             $rez = \CB\User::getDisplayName($id);
     }
     return $rez;
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:15,代码来源:OfficeUsers.php

示例13: getData

 public function getData($id = false)
 {
     $rez = array('success' => true);
     parent::getData($id);
     // echo $this->id.'!!';
     $o = Objects::getCachedObject($this->id);
     $data = $o->getData();
     if (!empty($data['versions'])) {
         $rez['data'] = $data['versions'];
         foreach ($rez['data'] as &$version) {
             $version['ago_text'] = Util\formatAgoTime($version['cdate']);
             $version['user'] = User::getDisplayName($version['cid'], true);
         }
     }
     return $rez;
 }
开发者ID:austinvernsonger,项目名称:casebox,代码行数:16,代码来源:Versions.php

示例14: getData

 public function getData($id = false)
 {
     $rez = array('success' => true);
     if (empty(parent::getData($id))) {
         return $rez;
     }
     $params = array('pid' => $this->id, 'fq' => array('(template_type:task) OR (target_type:task)'), 'fl' => 'id,pid,name,template_id,date,date_end,cid,cdate,status', 'sort' => 'cdate', 'dir' => 'desc');
     $s = new \CB\Search();
     $sr = $s->query($params);
     foreach ($sr['data'] as $d) {
         $d['ago_text'] = @Util\formatDateTimePeriod($d['date'], null, @$_SESSION['user']['cfg']['timezone']);
         $d['user'] = User::getDisplayName($d['cid'], true);
         \CB\Tasks::setTaskActionFlags($d);
         $rez['data'][] = $d;
     }
     return $rez;
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:17,代码来源:Tasks.php

示例15: setUserStatus

 /**
  * set complete or incomplete status for a task responsible user
  * @param array $p params
  */
 public function setUserStatus($p)
 {
     $rez = array('success' => true, 'id' => $p['id']);
     $obj = Objects::getCachedObject($p['id']);
     $data = $obj->getData();
     if (User::getId() != $data['cid'] && !Security::isAdmin()) {
         throw new \Exception(L\get('Access_denied'));
     }
     if ($obj->getUserStatus($p['user_id']) == Objects\Task::$USERSTATUS_NONE) {
         throw new \Exception(L\get('Wrong_id'));
     }
     $status = $p['status'] == 1 ? Objects\Task::$USERSTATUS_DONE : Objects\Task::$USERSTATUS_ONGOING;
     $obj->setUserStatus($status, $p['user_id']);
     // $obj->updateSysData();
     $this->afterUpdate($p['id']);
     return $rez;
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:21,代码来源:Tasks.php


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