Commit 23e42b4f01246302854837aebc0227e002b41438

Authored by Neil Blakey-Milner
1 parent 55ea515e

Give authentication providers the hook, editUserSource, which cascades

into the authentication provider's dispatcher to allow for
provider/source specific information (such as the LDAP DN for a user) to
be edited/maintained.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4194 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php
... ... @@ -92,13 +92,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
92 92 $this->oPage->setBreadcrumbDetails('modify user details');
93 93 $this->oPage->setTitle("Modify User Details");
94 94  
95   - $name = KTUtil::arrayGet($_REQUEST, 'name');
96   - $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false);
97   - $add_user = KTUtil::arrayGet($_REQUEST, 'add_user', false);
98   - if ($add_user !== false) { $add_user = true; }
99   - $edit_user = KTUtil::arrayGet($_REQUEST, 'edit_user', false);
100 95 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
101   -
102 96 $oUser =& User::get($user_id);
103 97  
104 98 if (PEAR::isError($oUser) || $oUser == false) {
... ... @@ -135,7 +129,25 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
135 129 "source" => $oAuthenticationSource,
136 130 );
137 131 return $oTemplate->render($aTemplateData);
138   - }
  132 + }
  133 +
  134 + function do_editUserSource() {
  135 + $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
  136 + $oUser =& $this->oValidator->validateUser($user_id);
  137 + $this->aBreadcrumbs[] = array('name' => $oUser->getName());
  138 +
  139 + $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser);
  140 + if (is_null($oAuthenticationSource)) {
  141 + $oProvider =& new KTBuiltinAuthenticationProvider;
  142 + } else {
  143 + $sProvider = $oAuthenticationSource->getAuthenticationProvider();
  144 + $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
  145 + $oProvider = $oRegistry->getAuthenticationProvider($sProvider);
  146 + }
  147 +
  148 + $oProvider->dispatch();
  149 + exit();
  150 + }
139 151  
140 152 function do_editgroups() {
141 153 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
... ...