File: UserStore.php

package info (click to toggle)
bamboo 1.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 580 kB
  • ctags: 1,338
  • sloc: php: 4,061; makefile: 44; sh: 36
file content (40 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

#########################################################
# UserStoreFactory

class UserStoreFactory {
	function create($configstr) {
		$directory = dirname(__FILE__) . "/userstores";
		$args = explode(',',$configstr,2);
		$class = ucfirst($args[0]) . "UserStore";
		$file = "$directory/$class.php";
		if (!is_file($file))
			die(_("Could not find user storage backend") . ": " . $args[0]);
		require_once($file);
		return new $class(trim($args[1]));
	}
}

#########################################################
# UserStore

class UserStore {

function newUser($user) {}

function setPassword($user,$password) {}

// returns a list of usernames
function getUsernames() {}

function authenticate($user,$pass,&$error) {
	$error = 'No user backend set';
	return false;
}

}

return;
?>