function CreateTableBasedGrantsManager() { global $tableCaptions; $usersTable = array('TableName' => 'atig_users', 'UserName' => 'user_name', 'UserId' => 'user_id', 'Password' => 'user_password'); $userPermsTable = array('TableName' => 'atig_user_perms', 'UserId' => 'user_id', 'PageName' => 'page_name', 'Grant' => 'perm_name'); $passwordHasher = HashUtils::CreateHasher('MD5'); $connectionOptions = GetGlobalConnectionOptions(); $tableBasedGrantsManager = new TableBasedUserGrantsManager(new MyPDOConnectionFactory(), $connectionOptions, $usersTable, $userPermsTable, $tableCaptions, $passwordHasher, false); return $tableBasedGrantsManager; }
public function __construct($userInfos, $passwordEncryption = ENCRYPTION_NONE) { $this->userInfos = $userInfos; $this->passwordHasher = HashUtils::CreateHasher($passwordEncryption); }
public function __construct(ConnectionFactory $connectionFactory, $connectionOptions, $tableName, $userNameFieldName, $passwordFieldName, $passwordEncryption = '', $userIdFieldName = null) { $this->userNameFieldName = $userNameFieldName; $this->passwordFieldName = $passwordFieldName; $this->passwordHasher = HashUtils::CreateHasher($passwordEncryption); $this->CreateDataset($connectionFactory, $connectionOptions, $tableName, $userNameFieldName, $passwordFieldName); }
public function __construct($connectionFactory, $connectionOptions, $tableName, $userNameFieldName, $passwordFieldName, $passwordEncryption = '', $userIdFieldName = null) { $this->userNameFieldName = $userNameFieldName; $this->passwordFieldName = $passwordFieldName; $this->passwordHasher = HashUtils::CreateHasher($passwordEncryption); $this->dataset = new TableDataset($connectionFactory, $connectionOptions, $tableName); $field = new StringField($userNameFieldName); $this->dataset->AddField($field, true); $field = new StringField($passwordFieldName); $this->dataset->AddField($field, false); }