Commit cb3471dfd5d6ea6cede5d43d8238a930aca4d4e5

Authored by Michael Joseph
1 parent 48621f4c

#2723- display a blank user form if using the db to authenticate.

changed the search function name and the title of the search page


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2338 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/addUserBL.php
... ... @@ -47,7 +47,7 @@ if (checkSession()) {
47 47 $aResults = $oAuth->searchUsers($sSearch, $aAttributes);
48 48  
49 49 //post array to page
50   - if(isset($aResults)) {
  50 + if (isset($aResults)) {
51 51 if(count($aResults) == 0) {
52 52 $oPatternCustom->setHtml(getPageUsernameNotFound());
53 53 } else {
... ... @@ -65,7 +65,6 @@ if (checkSession()) {
65 65 }
66 66 }
67 67 }
68   -
69 68 } else {
70 69 $oPatternCustom->setHtml(getAddPageFail());
71 70 $main->setFormAction($_SERVER["PHP_SELF"]);
... ... @@ -87,7 +86,6 @@ if (checkSession()) {
87 86 } else if(isset($fAddToDb)) {
88 87 // if db authentication
89 88 if(isset($fFromDb)) {
90   - //User($sNewUserName, $sNewName, $sNewPassword, $iNewQuotaMax, $sNewEmail, $sNewMobile, $bNewEmailNotification, $bNewSmsNotification, $sNewLdapDn, $iNewMaxSessions, $iNewLanguageID)
91 89 $oUser = new User($fUsername,$fName,$fPassword,0,$fEmail,$fMobile,$fEmailNotification,$fSmsNotification,0,1,0);
92 90  
93 91 } else {
... ... @@ -100,14 +98,18 @@ if (checkSession()) {
100 98 $oPatternCustom->setHtml(getPageFail());
101 99 }
102 100 } else {
103   - // if nothing happens...just reload edit page
104   - $oPatternCustom->setHtml(getAddPage(null));
105   - $main->setFormAction($_SERVER["PHP_SELF"]. "?fSearch=1");
106   -
  101 + if ($default->authenticationClass == "DBAuthenticator") {
  102 + $aAttributes = array("" => array ("username", "name", "email", "mobile", "email_notification", "sms_notification"));
  103 + $oPatternCustom->setHtml(getDetailsDBPage(null,$aAttributes));
  104 + $main->setFormAction($_SERVER["PHP_SELF"]. "?fAddToDb=1&fFromDb=1");
  105 + } else {
  106 + // if nothing happens...just reload edit page
  107 + $oPatternCustom->setHtml(getSearchPage(null));
  108 + $main->setFormAction($_SERVER["PHP_SELF"]. "?fSearch=1");
  109 + }
107 110 }
108 111  
109   - //$main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/create.php?fRedirectURL=".urlencode("$default->rootUrl/control.php?action=addUnitSuccess&fUnit"));
110 112 $main->setCentralPayload($oPatternCustom);
111 113 $main->render();
112 114 }
113 115 -?>
  116 +?>
114 117 \ No newline at end of file
... ...
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/addUserUI.inc
... ... @@ -27,11 +27,11 @@ function getSelectUserPage($aResults) {
27 27 }
28 28  
29 29 // get add pages
30   -function getAddPage($unitID) {
  30 +function getSearchPage($unitID) {
31 31  
32 32 global $default;
33 33  
34   - $sToRender .= renderHeading("Add User To System");
  34 + $sToRender .= renderHeading("Search For A User To Add");
35 35 $sToRender .= "<table>\n";
36 36 $sToRender .= "<tr><td colspan=\"2\">Please enter a VALID Username to search for in the text box below</td></tr>\n";
37 37 $sToRender .= "<tr>\n";
... ...