本文整理汇总了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');
}
示例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']);
}
示例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);
}
示例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);
}