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


PHP API::addUser方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $this->api = API::getInstance();
     $pseudoMockAccess = new FakeAccess();
     FakeAccess::$superUser = true;
     Access::setSingletonInstance($pseudoMockAccess);
     Fixture::createWebsite('2014-01-01 00:00:00');
     Fixture::createWebsite('2014-01-01 00:00:00');
     Fixture::createWebsite('2014-01-01 00:00:00');
     $this->api->addUser('userLogin', 'password', 'userlogin@password.de');
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:12,代码来源:APITest.php

示例2: testGetUserByEmail

 public function testGetUserByEmail()
 {
     $user = array('login' => "login", 'password' => "geqgeagae", 'email' => "test@test.com", 'alias' => "alias");
     $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
     $userByMail = $this->api->getUserByEmail($user['email']);
     $this->assertEquals($user['login'], $userByMail['login']);
     $this->assertEquals($user['email'], $userByMail['email']);
     $this->assertEquals($user['alias'], $userByMail['alias']);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:9,代码来源:UsersManagerTest.php

示例3: test_getSitesAccessFromUser_forSuperUser

 public function test_getSitesAccessFromUser_forSuperUser()
 {
     $user2 = 'userLogin2';
     $this->api->addUser($user2, 'password', 'userlogin2@password.de');
     // new user doesn't have access to anything
     $access = $this->api->getSitesAccessFromUser($user2);
     $this->assertEmpty($access);
     $this->api->setSuperUserAccess($user2, true);
     // super user has admin access for every site
     $access = $this->api->getSitesAccessFromUser($user2);
     $expected = array(array('site' => 1, 'access' => 'admin'), array('site' => 2, 'access' => 'admin'), array('site' => 3, 'access' => 'admin'));
     $this->assertEquals($expected, $access);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:13,代码来源:APITest.php

示例4: addUser

 /**
  * Decrypts the password and calls the original function on the decrypted value.
  *
  * @see the parent class function for parameters and return value
  */
 public function addUser($userLogin, $password, $email, $alias = false, $_isPasswordHashed = false)
 {
     $password = Crypto::decrypt($password);
     return parent::addUser($userLogin, $password, $email, $alias, $_isPasswordHashed);
 }
开发者ID:Joey3000,项目名称:piwik-UsersManagerEncrypted,代码行数:10,代码来源:API.php


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