-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Billington
committed
Apr 28, 2013
1 parent
ac13c55
commit 854a2c9
Showing
7 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<buildpath> | ||
<buildpathentry kind="src" path="lib/service"/> | ||
<buildpathentry kind="src" path="site"/> | ||
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/> | ||
</buildpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
site/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Auth</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.wst.validation.validationbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.dltk.core.scriptbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.php.core.PHPNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
include_path=0;/Auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?php | ||
/** | ||
* This abstract class provides an interface for interacting with most account-providing services. | ||
* | ||
* @author Michael Billington <michael.billington@gmail.com> | ||
*/ | ||
abstract class account_service { | ||
/** | ||
* Make a new user account on this service. | ||
* | ||
* @param Account_model $a The account to create | ||
*/ | ||
abstract protected function accountCreate(Account_model $a); | ||
|
||
/** | ||
* Delete a user account from this service. | ||
* | ||
* @param string $account_login The login name of the account | ||
* @param string $account_domain The domain which the account is on (services may serve multiple domains) | ||
*/ | ||
abstract protected function accountDelete(string $account_login, string $account_domain); | ||
|
||
|
||
/** | ||
* Update the login and display name for an account. | ||
* | ||
* @param Account_model $a The new account details | ||
* @param string $account_login The username to search for -- If an account has been renamed, then this will be different to the username stored in the above object. | ||
*/ | ||
abstract protected function accountUpdate(Account_model $a, string $account_login); | ||
|
||
/** | ||
* Disable a user account. | ||
* | ||
* @param Account_model $a The user account to disable | ||
*/ | ||
abstract protected function accountDisable(Account_model $a); | ||
|
||
/** | ||
* Enable a user account. | ||
* | ||
* @param Account_model $a The user account to enable | ||
*/ | ||
abstract protected function accountEnable(Account_model $a); | ||
|
||
/** | ||
* Re-base an account under a different organizational unit. | ||
* | ||
* @param Account_model $a | ||
*/ | ||
abstract protected function accountRelocate(Account_model $a); | ||
|
||
/** | ||
* Search an organizational unit recursively, looking for changes. | ||
* | ||
* @param Ou_model $o The organizational unit to search. | ||
*/ | ||
abstract protected function recursiveSearch(Ou_model $o); | ||
|
||
/** | ||
* Create a new group. | ||
* | ||
* @param Group_model $g The group to create. | ||
*/ | ||
abstract protected function groupCreate(UserGroup_model $g); | ||
|
||
/** | ||
* Delete a group. | ||
* | ||
* @param Group_model $g | ||
*/ | ||
abstract protected function groupDelete(string $group_cn, string $group_domain); | ||
|
||
/** | ||
* Add a user account to a group. | ||
* | ||
* @param Account_model $a The user account to add | ||
* @param Group_model $g The group to add it to | ||
*/ | ||
abstract protected function groupJoin(Account_model $a, Group_model $g); | ||
|
||
/** | ||
* Remove a user account from a group. | ||
* | ||
* @param Account_model $a The user account to remove | ||
* @param Group_model $g The group to remove it from | ||
*/ | ||
abstract protected function groupLeave(Account_model $a, Group_model $g); | ||
|
||
/** | ||
* Add a group to a group. | ||
* | ||
* @param Group_model $parent The parent group | ||
* @param Group_model $child The group to add | ||
*/ | ||
abstract protected function groupAddChild(Group_model $parent, Group_model $child); | ||
|
||
/** | ||
* Remove a group from a group. | ||
* | ||
* @param Group_model $parent The parent group | ||
* @param Group_model $child The group to remove | ||
*/ | ||
abstract protected function groupDelChild(Group_model $parent, Group_model $child); | ||
|
||
/** | ||
* Create a new organizational unit. | ||
* | ||
* @param Ou_model $o The organizational unit to create | ||
*/ | ||
abstract protected function ouCreate(Ou_model $o); | ||
|
||
|
||
/** | ||
* Delete an organizational unit. | ||
* | ||
* @param string $ou_id The name of the unit | ||
*/ | ||
abstract protected function ouDelete(string $ou_id); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require_once(dirname(__FILE__) . "/ad_service.php"); | ||
|
||
class ad_service extends ldap_service { | ||
|
||
|
||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
require_once(dirname(__FILE__) . "/account_service.php"); | ||
|
||
class ldap_service extends account_service { | ||
private $ldap_url; | ||
private $ldap_user; | ||
private $ldap_root; | ||
private $ldap_pass; | ||
|
||
/** | ||
* Construct a new LDAP service object | ||
* | ||
* @param string $ldap_url The URL of the ldap server. Looks like "ldaps://<hostname>:<port>". | ||
* @param string $ldap_user The username to log in as. Usually "cn=admin,dc=..,dc=.." or "Administrator@<domain name>" for Active Directory. | ||
* @param string $root The root of the domain. Looks like "dc=example,dc=com". | ||
* @param string $ldap_pass The password to use when logging in to this server. | ||
*/ | ||
function __construct(string $ldap_url, string $ldap_user, string $ldap_root, string $ldap_pass) { | ||
$this -> ldap_url = $ldap_url; | ||
$this -> ldap_user = $ldap_user; | ||
$this -> ldap_root = $ldap_root; | ||
$this -> ldap_pass = $ldap_pass; | ||
} | ||
|
||
|
||
} | ||
?> |