From a12fd49090c6c0398d3f7f147978c7435c44629f Mon Sep 17 00:00:00 2001 From: nbm Date: Tue, 29 Nov 2005 11:45:07 +0000 Subject: [PATCH] Add addUserFromSource, which is a hook available to authentication providers so that they can find and create a user from the authentication source. --- presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php b/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php index a880a41..79aa92a 100644 --- a/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php +++ b/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php @@ -77,17 +77,34 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { // nice, easy bits. $add_fields[] = new KTStringWidget('Mobile Number','The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS\'d with notifications. e.g. 999 9999 999', 'mobile_number', null, $this->oPage, false); $add_fields[] = new KTStringWidget('Maximum Sessions','As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.', 'max_sessions', '3', $this->oPage, true); + + $aAuthenticationSources =& KTAuthenticationSource::getList(); - $oTemplating = new KTTemplating; + $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("ktcore/principals/adduser"); $aTemplateData = array( - "context" => $this, + "context" => &$this, "add_fields" => $add_fields, + "authentication_sources" => $aAuthenticationSources, ); return $oTemplate->render($aTemplateData); } + function do_addUserFromSource() { + $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); + $sProvider = $oSource->getAuthenticationProvider(); + $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); + $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); + $this->aBreadcrumbs[] = array('action' => 'userManagement', 'name' => 'User Management'); + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'] . '?action=addUser', 'name' => 'add a new user'); + $oProvider->aBreadcrumbs = $this->aBreadcrumbs; + $oProvider->oPage->setBreadcrumbDetails($oSource->getName()); + $oProvider->oPage->setTitle("Modify User Details"); + + $oProvider->dispatch(); + exit(0); + } function do_editUser() { $this->aBreadcrumbs[] = array('action' => 'userManagement', 'name' => 'User Management'); @@ -430,4 +447,4 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { //$oDispatcher = new KTUserAdminDispatcher (); //$oDispatcher->dispatch(); -?> \ No newline at end of file +?> -- libgit2 0.21.4