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


PHP UserAccount::getTableName方法代码示例

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


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

示例1: testCallApiOperationWithGrants

 public function testCallApiOperationWithGrants()
 {
     TestsHelper::dbFixture(\UserAccount::getTableName(), array(array('login' => 'test', 'password' => passwordColumn::hash('testtest'))));
     $user = \UserAccount::getById(1);
     \ACL::create(TestApiWithACLOperation::RightName);
     \ACL::grant(TestApiWithACLOperation::RightName, $user->obj_rights->getEntity());
     \UsersLogin::login('test', 'testtest');
     $method = new TestApiWithACLOperation();
     $this->assertTrue($method->exec());
 }
开发者ID:gudwin,项目名称:extasy,代码行数:10,代码来源:ApiOperationTest.php

示例2: setupUsers

 public static function setupUsers($data)
 {
     self::dbFixture(\UserAccount::getTableName(), array());
     foreach ($data as $key => $userRow) {
         $userRights = null;
         if (!isset($userRow['password'])) {
             $userRow['password'] = self::DefaultPassword;
         }
         self::checkUserRow($userRow);
         if (isset($userRow['rights'])) {
             $userRights = $userRow['rights'];
         }
         $userRow['password'] = Password::hash($userRow['password']);
         $user = new \UserAccount($userRow);
         $user->insert();
         if (!empty($userRights)) {
             $user->rights = $userRights;
             $user->update();
         }
     }
 }
开发者ID:gudwin,项目名称:extasy,代码行数:21,代码来源:Helper.php

示例3: update

    public function update($group, $permissions)
    {
        if (empty($group)) {
            $this->AddAlert('Группа пользователей не выбрана');
            $this->jump('./');
        }
        set_time_limit(0);
        $page = 0;
        $groupInfo = DBSimple::get(ACL_TABLE, ['name' => $group]);
        if (empty($groupInfo)) {
            throw new \InvalidArgumentException(sprintf('Group "%s" not found, failed to update group permissions', htmlspecialchars($group)));
        }
        $permissions = $this->filterPermissionsByGroup($group, $permissions);
        do {
            // получаем пользователей
            $sql = <<<SQL
\tselect u.* from %s as u
\tinner join %s as r
\ton r.entity = concat("%s", u.id)
\twhere r.actionId = "%s"
\torder by id asc
\tlimit %d,%d
SQL;
            $sql = sprintf($sql, \UserAccount::getTableName(), \ACL_GRANT_TABLE, \Faid\DB::escape(\UserAccount::ModelName), $groupInfo['id'], $page * self::Limit, self::Limit);
            $data = DB::query($sql);
            // устанавливаем каждому права
            foreach ($data as $row) {
                $user = new \UserAccount($row);
                $tmp = $user->rights->getValue();
                $tmp = array_merge($tmp, $permissions);
                $user->rights = $tmp;
                $user->update();
            }
            $page++;
        } while (sizeof($data) != 0);
        $this->addAlert('Права обновлены');
        $this->jump('./');
    }
开发者ID:gudwin,项目名称:extasy,代码行数:38,代码来源:GroupPermissions.php

示例4: testUserNotConfirmed

 /**
  * @expectedException \Extasy\Users\login\UserNotConfirmedException
  */
 public function testUserNotConfirmed()
 {
     DBSimple::update(\UserAccount::getTableName(), ['confirmation_code' => 'some_value'], ['id' => 1]);
     $api = new Login();
     $api->exec();
 }
开发者ID:gudwin,项目名称:extasy,代码行数:9,代码来源:LoginTest.php

示例5: findByEmail

 public static function findByEmail($email)
 {
     $result = DBSimple::get(UserAccount::getTableName(), array(sprintf('`email` = "%s" ', DB::escape($email), DB::escape($email))));
     return $result;
 }
开发者ID:gudwin,项目名称:extasy,代码行数:5,代码来源:dbmanager.php

示例6: array

<?php

use Faid\Configure\Configure;
use Extasy\CMS;
\Extasy\tests\ErrorHandlers::setUp();
\Faid\Debug\Debug::enable();
Configure::write(CMS::SaltConfigureKey, 'extasySalt');
Configure::write(\Extasy\Schedule\Runner::TimeoutConfigureKey, 30);
Configure::write(CMS::DashboardConfigureKey, array('url' => '/', 'Domain' => 'extasy'));
Configure::write(CMS::MainDomainConfigureKey, 'extasy');
// Собственно, имя проекта
define('SITE_NAME', 'Extasy Framework');
// Путь до закачиваемых пользователем файлов
define('FILE_PATH', EXTASY_PATH . 'tests/data/');
Configure::write(\Extasy\CMS::FileConfigureKey, EXTASY_PATH . 'tests/data/');
Configure::write(\Extasy\CMS::FilesHttpRoot, '/tests/data/');
Configure::write('UParser.tmp_dir', FILE_PATH);
Configure::write('Sitemap', ['Menu' => ['title' => 'Меню сайта', 'depth' => 2]]);
Configure::write(\UserAccount::ModelConfigureKey, ['table' => UserAccount::getTableName(), 'api' => ['profileUpdateFields' => 'name,surname'], 'fields' => ['id' => '\\Extasy\\Columns\\Index', 'login' => '\\Extasy\\Users\\Columns\\Login', 'password' => '\\Extasy\\Columns\\Password', 'rights' => '\\GrantColumn', 'time_access' => '\\Extasy\\Users\\Columns\\TimeAccess', 'registered' => '\\Extasy\\Columns\\Datetime', 'last_activity_date' => '\\Extasy\\Columns\\Datetime', 'confirmation_code' => '\\Extasy\\Users\\Columns\\ConfirmationCode', 'email_confirmation_code' => '\\Extasy\\Columns\\Input', 'email' => '\\Extasy\\Users\\Columns\\Email', 'new_email' => '\\Extasy\\Columns\\Input', 'name' => '\\Extasy\\Columns\\Input', 'surname' => '\\Extasy\\Columns\\Input', 'social_networks' => ['class' => '\\Extasy\\Users\\Columns\\SocialNetworks', 'parse_field' => 1], 'avatar' => ['class' => '\\Extasy\\Columns\\Image', 'base_dir' => 'users/', 'images' => '']]]);
// Режим отладки
define('DEBUG', 1);
$db = array('host' => 'localhost', 'user' => 'extasy', 'password' => '', 'database' => 'extasy');
$cacheConfig = array('Engine' => '\\Faid\\Cache\\Engine\\FileCache', 'FileCache' => array('BaseDir' => EXTASY_PATH . 'tests/data/'));
Configure::write('DB', $db);
Configure::write('SimpleCache', $cacheConfig);
开发者ID:gudwin,项目名称:extasy,代码行数:25,代码来源:test-environment.php


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