當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。