• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Init/classes/class.ilPasswordAssistanceGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00033 class ilPasswordAssistanceGUI
00034 {
00038         function ilPasswordAssistanceGUI()
00039         {
00040                 global $ilCtrl;
00041                 
00042                 $this->ctrl =& $ilCtrl;
00043         }
00044         
00048         function &executeCommand()
00049         {
00050                 global $ilias, $lng, $ilSetting, $ilErr, $ilAuth;
00051                 
00052                 // check hack attempts
00053                 if (!$ilSetting->get("password_assistance")) // || AUTH_DEFAULT != AUTH_LOCAL)
00054                 {
00055                         if (empty($_SESSION["AccountId"]) and $_SESSION["AccountId"] !== false)
00056                         {
00057                                 $ilErr->raiseError($lng->txt("permission_denied"),$ilias->error_obj->WARNING);
00058                         }
00059                 }
00060                 
00061                 // check correct setup
00062                 if (!$ilSetting->get("setup_ok"))
00063                 {
00064                         die("Setup is not completed. Please run setup routine again. (pwassist.php)");
00065                 }
00066 
00067                 // Change the language, if necessary. 
00068                 // And load the 'pwassist' language module
00069                 $lang = $_GET['lang'];
00070                 if ($lang != null && $lang != "" && $lng->getLangKey() != $lang)
00071                 {
00072                         $lng = new ilLanguage($lang);
00073                 }
00074                 $lng->loadLanguageModule('pwassist');
00075 
00076                 $cmd = $this->ctrl->getCmd();
00077                 $next_class = $this->ctrl->getNextClass($this);
00078                 
00079                 switch($next_class)
00080                 {                               
00081                         default:
00082                                 if ($cmd != "")
00083                                 {
00084                                         return $this->$cmd();
00085                                 }
00086                                 else
00087                                 {
00088                                         if (!empty($_GET["key"])) {
00089                                                 $this->showAssignPasswordForm();
00090                                         } else {
00091                                                 $this->showAssistanceForm();
00092                                         }
00093                                 }
00094                                 break;
00095                 }
00096                 
00097                 // Logout current session
00098                 //$ilAuth->logout();
00099                 //session_destroy();
00100 
00101         }
00102 
00103 
00104         /* Shows the password assistance form.
00105          * This form is used to request a password assistance mail from ILIAS.
00106          *
00107          * This form contains the following fields: 
00108          * username 
00109          * email 
00110          *
00111          * When the user submits the form, then this script is invoked with the cmd
00112          * 'submitAssistanceForm'.
00113          *
00114          * @param message  A message to display on the form.
00115          * @param username The user name to be shown in the form.
00116          * @param email    The e-mail to be shown in the form.
00117          */
00118         function showAssistanceForm($message="", $username="", $email="")
00119         {
00120                 global $tpl, $ilias, $lng;
00121 
00122                 // Create the form
00123                 $tpl->addBlockFile("CONTENT", "content", "tpl.pwassist_assistance.html");
00124                 
00125                 if ($message != "")
00126                 {
00127                         $tpl->setCurrentBlock("pw_message");
00128                         $tpl->setVariable("TXT_MESSAGE", str_replace("\\n","<br>",$message));
00129                         $tpl->parseCurrentBlock();
00130                 }
00131                 
00132                 $tpl->setVariable("FORMACTION",
00133                         $this->ctrl->getFormAction($this));
00134                 $tpl->setVariable("TARGET","target=\"_parent\"");
00135                 $tpl->setVariable("IMG_AUTH",
00136                         ilUtil::getImagePath("icon_auth_b.gif"));
00137                 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("password_assistance"));
00138         
00139                 $contact_address = $ilias->getSetting("admin_email");
00140                 $tpl->setVariable
00141                 (
00142                         "TXT_ENTER_USERNAME_AND_EMAIL", 
00143                         str_replace
00144                         (
00145                                 "\\n","<br>",
00146                                 sprintf
00147                                         (
00148                                         $lng->txt("pwassist_enter_username_and_email"),
00149                                         "<a href=\"mailto:".$contact_address."\">".$contact_address."</a>"
00150                                         )
00151                         )
00152                 );
00153                 $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
00154                 $tpl->setVariable("TXT_EMAIL", $lng->txt("email"));
00155                 $tpl->setVariable("USERNAME", $username);
00156                 $tpl->setVariable("EMAIL", $email);
00157                 $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
00158                 $tpl->setVariable("BACK", $lng->txt("back"));
00159                 $tpl->setVariable("LINK_BACK",
00160                         $this->ctrl->getLinkTargetByClass("ilstartupgui", "showLogin"));
00161                 $tpl->setVariable("LANG", $lng->getLangKey());
00162         
00163                 $tpl->show();
00164         }
00165         
00166         
00167         /* Shows the password assistance form.
00168          * This form is used to request a password assistance mail from ILIAS.
00169          *
00170          * This form contains the following fields: 
00171          * username 
00172          * email 
00173          *
00174          * When the user submits the form, then this script is invoked with the cmd
00175          * 'submitAssistanceForm'.
00176          *
00177          * @param message  A message to display on the form.
00178          * @param username The user name to be shown in the form.
00179          * @param email    The e-mail to be shown in the form.
00180          */
00181         function showUsernameAssistanceForm($message="", $username="", $email="")
00182         {
00183                 global $tpl, $ilias, $lng;
00184 
00185                 // Create the form
00186                 $tpl->addBlockFile("CONTENT", "content", "tpl.pwassist_username_assistance.html");
00187 
00188                 if ($message != "")
00189                 {
00190                         $tpl->setCurrentBlock("pw_message");
00191                         $tpl->setVariable("TXT_MESSAGE", str_replace("\\n","<br>",$message));
00192                         $tpl->parseCurrentBlock();
00193                 }
00194 
00195                 $tpl->setVariable("FORMACTION",
00196                         $this->ctrl->getFormAction($this));
00197                 $tpl->setVariable("IMG_AUTH",
00198                         ilUtil::getImagePath("icon_auth_b.gif"));
00199                 $tpl->setVariable("TARGET","target=\"_parent\"");
00200                 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("password_assistance"));
00201         
00202                 $contact_address = $ilias->getSetting("admin_email");
00203                 $tpl->setVariable
00204                 (
00205                         "TXT_ENTER_USERNAME_AND_EMAIL", 
00206                         str_replace
00207                         (
00208                                 "\\n","<br>",
00209                                 sprintf
00210                                         (
00211                                         $lng->txt("pwassist_enter_email"),
00212                                         "<a href=\"mailto:".$contact_address."\">".$contact_address."</a>"
00213                                         )
00214                         )
00215                 );
00216                 $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
00217                 $tpl->setVariable("TXT_EMAIL", $lng->txt("email"));
00218                 $tpl->setVariable("USERNAME", $username);
00219                 $tpl->setVariable("EMAIL", $email);
00220                 $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
00221                 $tpl->setVariable("BACK", $lng->txt("back"));
00222                 $tpl->setVariable("LINK_BACK",
00223                         $this->ctrl->getLinkTargetByClass("ilstartupgui", "showLogin"));
00224                 $tpl->setVariable("LANG", $lng->getLangKey());
00225         
00226                 $tpl->show();
00227         }
00228         
00241         function submitAssistanceForm()
00242         {
00243                 global $tpl, $ilias, $lng, $rbacadmin, $rbacreview;
00244                 
00245                 require_once "classes/class.ilObjUser.php";
00246                 require_once "classes/class.ilUtil.php";
00247                 
00248                 // Retrieve form data
00249                 $username = ilUtil::stripSlashes($_POST["username"]);
00250                 $email = ilUtil::stripSlashes($_POST["email"]);
00251                 
00252                 // Retrieve a user object with matching user name and email address.
00253                 $userObj = null;
00254                 $userid = ilObjUser::getUserIdByLogin($username);
00255                 $txt_key = "pwassist_invalid_username_or_email";
00256                 if ($userid != 0)
00257                 {
00258                         $userObj = new ilObjUser($userid);
00259                         if (strcasecmp($userObj->getEmail(), $email) != 0) 
00260                         {
00261                                 $userObj = null;
00262                         } else if ($userObj->getAuthMode(true) != AUTH_LOCAL ||
00263                                  ($userObj->getAuthMode(true) == AUTH_DEFAULT && AUTH_DEFAULT != AUTH_LOCAL))                   
00264                         {
00265                             $userObj = null;
00266                             $txt_key = "pwassist_invalid_auth_mode";
00267                         }
00268                 }
00269                 
00270                 // No matching user object found?
00271                 // Show the password assistance form again, and display an error message.
00272                 if ($userObj == null) 
00273                 {
00274                         $this->showAssistanceForm
00275                         (
00276                                 $lng->txt($txt_key),
00277                                 $username,
00278                                 $email
00279                         );
00280                 }
00281         
00282                 // Matching user object found?
00283                 // Check if the user is permitted to use the password assistance function,
00284                 // and then send a password assistance mail to the email address.
00285                 else
00286                 {
00287                         // FIXME: Extend this if-statement to check whether the user
00288                         // has the permission to use the password assistance function.
00289                         // The anonymous user and users who are system administrators are
00290                         // not allowed to use this feature
00291                         if ($rbacreview->isAssigned($userObj->getID, ANONYMOUS_ROLE_ID)
00292                         || $rbacreview->isAssigned($userObj->getID, SYSTEM_ROLE_ID)
00293                         ) 
00294                         {
00295                                 $this->showAssistanceForm
00296                                 (
00297                                         $lng->txt("pwassist_not_permitted"),
00298                                         $username,
00299                                         $email
00300                                 );
00301                         }
00302                         else
00303                         {
00304                                 $this->sendPasswordAssistanceMail($userObj);
00305                                 $this->showMessageForm
00306                                 (
00307                                         null,
00308                                         sprintf
00309                                         (
00310                                                 $lng->txt("pwassist_mail_sent"),
00311                                                 $email
00312                                         )
00313                                 );
00314                         }
00315                 }
00316         }
00317         
00330         function submitUsernameAssistanceForm()
00331         {
00332                 global $tpl, $ilias, $lng, $rbacadmin, $rbacreview;
00333                 
00334                 require_once "classes/class.ilObjUser.php";
00335                 require_once "classes/class.ilUtil.php";
00336                 
00337                 // Retrieve form data
00338                 $email = ilUtil::stripSlashes($_POST["email"]);
00339                 
00340                 // Retrieve a user object with matching user name and email address.
00341                 $logins = ilObjUser::_getUserIdsByEmail($email);
00342                 
00343                 // No matching user object found?
00344                 // Show the password assistance form again, and display an error message.
00345                 if (count($logins)< 1)  
00346                 {
00347                         $this->showUsernameAssistanceForm
00348                         (
00349                                 $lng->txt("pwassist_invalid_email"),
00350                                 "",
00351                                 $email
00352                         );
00353                 }
00354         
00355                 // Matching user object found?
00356                 // Check if the user is permitted to use the password assistance function,
00357                 // and then send a password assistance mail to the email address.
00358                 else
00359                 {
00360                         // FIXME: Extend this if-statement to check whether the user
00361                         // has the permission to use the password assistance function.
00362                         // The anonymous user and users who are system administrators are
00363                         // not allowed to use this feature
00364         /*              if ($rbacreview->isAssigned($userObj->getID, ANONYMOUS_ROLE_ID)
00365                         || $rbacreview->isAssigned($userObj->getID, SYSTEM_ROLE_ID)
00366                         ) 
00367                         {
00368                                 $this->showAssistanceForm
00369                                 (
00370                                         $lng->txt("pwassist_not_permitted"),
00371                                         $username,
00372                                         $email
00373                                 );
00374                         } 
00375                         else */
00376                         {
00377                                 $this->sendUsernameAssistanceMail($email, $logins);
00378                                 $this->showMessageForm
00379                                 (
00380                                         null,
00381                                         sprintf
00382                                         (
00383                                                 $lng->txt("pwassist_mail_sent"),
00384                                                 $email
00385                                         )
00386                                 );
00387                         }
00388                 }
00389         }
00390         
00404         function sendPasswordAssistanceMail($userObj)
00405         {
00406                 global $lng, $ilias;
00407         
00408                 include_once "classes/class.ilMailbox.php";
00409                 include_once "classes/class.ilMimeMail.php";
00410                 require_once "include/inc.pwassist_session_handler.php";
00411                 
00412         
00413                 // Check if we need to create a new session
00414                 $pwassist_session = db_pwassist_session_find($userObj->getId());
00415                 if (count($pwassist_session) == 0 || $pwassist_session["expires"] < time())
00416                 {
00417                         // Create a new session id
00418                         db_set_save_handler();
00419                         session_start();
00420                         $pwassist_session["pwassist_id"] = db_pwassist_create_id();
00421                         session_destroy();
00422                         db_pwassist_session_write(
00423                                 $pwassist_session["pwassist_id"],
00424                                 3600, 
00425                                 $userObj->getId()
00426                         );
00427                 }
00428                 $protocol = isset($_SERVER['HTTPS'])?"https://":"http://";
00429                 // Compose the mail
00430                 $server_url=$protocol.$_SERVER['HTTP_HOST'].
00431                         substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')).
00432                         '/';
00433                 $pwassist_url=$protocol.$_SERVER['HTTP_HOST']
00434                 .str_replace("ilias.php", "pwassist.php", $_SERVER['PHP_SELF'])
00435                 ."?client_id=".$ilias->getClientId()
00436                 ."&lang=".$lng->getLangKey()
00437                 ."&key=".$pwassist_session["pwassist_id"];
00438                 $contact_address=$ilias->getSetting("admin_email");
00439 //echo "<br>-".htmlentities($pwassist_url)."-";
00440                 $mm = new ilMimeMail();
00441                 $mm->Subject($lng->txt("pwassist_mail_subject"));
00442                 $mm->From($contact_address);
00443                 $mm->To($userObj->getEmail());
00444                 
00445                 $mm->Body
00446                 (
00447                         str_replace
00448                         (
00449                                 array("\\n","\\t"),
00450                                 array("\n","\t"),
00451                                 sprintf
00452                                 (
00453                                 $lng->txt("pwassist_mail_body"),
00454                                 $pwassist_url,
00455                                 $server_url,
00456                                 $_SERVER['REMOTE_ADDR'],
00457                                 $userObj->getLogin(),
00458                                 'mailto:'.$contact_address
00459                                 )
00460                         )
00461                 );
00462                 
00463                 $mm->Send();
00464         }
00465         
00466         
00480         function sendUsernameAssistanceMail($email, $logins)
00481         {
00482                 global $lng, $ilias;
00483         
00484                 include_once "classes/class.ilMailbox.php";
00485                 include_once "classes/class.ilMimeMail.php";
00486                 require_once "include/inc.pwassist_session_handler.php";
00487                 $protocol = isset($_SERVER['HTTPS'])?"https://":"http://";
00488 
00489         
00490                 // Compose the mail
00491                 $server_url=$protocol.$_SERVER['HTTP_HOST'].
00492                         substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')).
00493                         '/';
00494                 $login_url=$server_url."pwassist.php"
00495                                         ."?client_id=".$ilias->getClientId()
00496                                         ."&lang=".$lng->getLangKey();
00497 //echo "-".htmlentities($login_url)."-";
00498                 $contact_address=$ilias->getSetting("admin_email");
00499         
00500                 $mm = new ilMimeMail();
00501                 $mm->Subject($lng->txt("pwassist_mail_subject"));
00502                 $mm->From($contact_address);
00503                 $mm->To($email);
00504                 
00505                 $mm->Body
00506                 (
00507                         str_replace
00508                         (
00509                                 array("\\n","\\t"),
00510                                 array("\n","\t"),
00511                                 sprintf
00512                                 (
00513                                                 $lng->txt("pwassist_username_mail_body"),
00514                                                 join ($logins,",\n"), 
00515                                                 $server_url, 
00516                                                 $_SERVER['REMOTE_ADDR'], 
00517                                                 $email,
00518                                                 'mailto:'.$contact_address,
00519                                                 $login_url                                                              
00520                                 )
00521                         )
00522                 );
00523                 
00524                 $mm->Send();
00525         }
00526         
00527         /* Assign password form.
00528          * This form is used to assign a password to a username.
00529          *
00530          * To use this form, the following data must be provided as HTTP GET parameter,
00531          * or in argument pwassist_id:
00532          * key
00533          *
00534          * The key is used to retrieve the password assistance session.
00535          * If the key is missing, or if the password assistance session has expired, the
00536          * password assistance form will be shown instead of this form.
00537          *
00538          * @param message  A message to display on the form.
00539          * @param username The user name to be shown in the form.
00540          * @param password The password1 to be shown in the form.
00541          * @param password The password2 to be shown in the form.
00542          * @param pwassist_id The session key for the password assistance use case.
00543          *                  If this parameter is omitted, the key is retrieved from
00544          *                  the form data.
00545          */
00546         function showAssignPasswordForm($message="", $username="", $password1="", $password2="", $pwassist_id="")
00547         {
00548                 global $tpl, $ilias, $lng, $rbacadmin, $rbacreview;
00549                 
00550                 require_once "include/inc.pwassist_session_handler.php";
00551                 require_once "classes/class.ilLanguage.php";
00552                 
00553                 // Retrieve form data
00554                 if ($pwassist_id == "") 
00555                 {
00556                         $pwassist_id = $_GET["key"];
00557                 }
00558         
00559                 // Retrieve the session, and check if it is valid
00560                 $pwassist_session = db_pwassist_session_read($pwassist_id);
00561                 if (count($pwassist_session) == 0 || $pwassist_session["expires"] < time())
00562                 {
00563                         $this->showAssistanceForm($lng->txt("pwassist_session_expired"));
00564                 }
00565                 else
00566                 {
00567                         $tpl->addBlockFile("CONTENT", "content", "tpl.pwassist_assignpassword.html");
00568                         if ($message != "")
00569                         {
00570                                 $tpl->setCurrentBlock("pw_message");
00571                                 $tpl->setVariable("TXT_MESSAGE", str_replace("\\n","<br>",$message));
00572                                 $tpl->parseCurrentBlock();
00573                         }
00574 
00575                         $tpl->setVariable("FORMACTION",
00576                                 $this->ctrl->getFormAction($this));
00577                         $tpl->setVariable("TARGET","target=\"_parent\"");
00578                         $tpl->setVariable("IMG_AUTH",
00579                                 ilUtil::getImagePath("icon_auth_b.gif"));
00580                         $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("password_assistance"));
00581                         $tpl->setVariable("TXT_ENTER_USERNAME_AND_NEW_PASSWORD", $lng->txt("pwassist_enter_username_and_new_password"));
00582                         $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
00583                         $tpl->setVariable("TXT_PASSWORD1", $lng->txt("password"));
00584                         $tpl->setVariable("TXT_PASSWORD2", $lng->txt("retype_password"));
00585                         $tpl->setVariable("USERNAME", $username);
00586                         $tpl->setVariable("PASSWORD1", $password1);
00587                         $tpl->setVariable("PASSWORD2", $password2);
00588                         $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
00589                         $tpl->setVariable("KEY", $pwassist_id);
00590                         $tpl->setVariable("BACK", $lng->txt("back"));
00591                         $tpl->setVariable("CMD_BACK",
00592                                 $this->ctrl->getLinkTargetByClass("ilstartupgui", "showLogin"));
00593                         $tpl->setVariable("LANG", $lng->getLangKey());
00594                 
00595                         $tpl->show();
00596                 }
00597         }
00598         
00618         function submitAssignPasswordForm() {
00619                 global $tpl, $ilias, $lng, $rbacadmin, $rbacreview;
00620                 
00621                 require_once "include/inc.pwassist_session_handler.php";
00622                 
00623                 // Retrieve form data
00624                 $pwassist_id = ilUtil::stripSlashes($_POST["key"]);
00625                 $username = ilUtil::stripSlashes($_POST["username"]);
00626                 $password1 = ilUtil::stripSlashes($_POST["password1"]);
00627                 $password2 = ilUtil::stripSlashes($_POST["password2"]);
00628         
00629                 // Retrieve the session
00630                 $pwassist_session = db_pwassist_session_read($pwassist_id);
00631                 
00632                 if (count($pwassist_session) == 0 || $pwassist_session["expires"] < time())
00633                 {
00634                         $this->showAssistanceForm($lng->txt("pwassist_session_expired"));
00635                 }
00636                 else
00637                 {
00638                         $is_successful = true;
00639                         $message = "";
00640                         
00641                         $userObj = new ilObjUser($pwassist_session["user_id"]);
00642         
00643                         // Validate the entries of the user
00644                         // ----------------------------------
00645                         // check if the user still exists
00646                         if ($userObj == null)
00647                         {
00648                                 $message = $lng->txt("user_does_not_exist");
00649                                 $is_successful = false;
00650                         }
00651                         
00652                         // check if the username entered by the user matches the
00653                         // one of the user object.
00654                         if ($is_successful && strcasecmp($userObj->getLogin(), $username) != 0)
00655                         {
00656                                 $message = $lng->txt("pwassist_login_not_match");
00657                                 $is_successful = false;
00658                         }
00659                         
00660                         // check if the user entered the password correctly into the
00661                         // two entry fields.
00662                         if ($is_successful && $password1 != $password2)
00663                         {
00664                                 $message = $lng->txt("passwd_not_match");
00665                                 $is_successful = false;
00666                         }
00667         
00668                         // validate the password
00669                         if ($is_successful && !ilUtil::isPassword($password1))
00670                         {
00671                                 $message = $lng->txt("passwd_invalid");
00672                                 $is_successful = false;
00673                         }
00674                         
00675                         // End of validation
00676                         // If the validation was successful, we change the password of the
00677                         // user.
00678                         // ------------------
00679                         if ($is_successful)
00680                         {
00681                                 $is_successful = $userObj->resetPassword($password1,$password2);
00682                                 if (! $is_successful) 
00683                                 {
00684                                         $message = $lng->txt("passwd_invalid");
00685                                 }
00686                         }
00687         
00688                         // If we are successful so far, we update the user object.
00689                         // ------------------
00690                         if ($is_successful) 
00691                         {
00692                                 $is_successfull = $userObj->update();
00693                                 if (! $is_successful) 
00694                                 {
00695                                         $message = $lng->txt("update_error");
00696                                 }
00697                         }
00698                         
00699                         // If we are successful, we destroy the password assistance
00700                         // session and redirect to the login page.
00701                         // Else we display the form again along with an error message.
00702                         // ------------------
00703                         if ($is_successful)
00704                         {
00705                                 db_pwassist_session_destroy($pwassist_id);
00706                                 $this->showMessageForm
00707                                 (
00708                                         null,
00709                                         sprintf
00710                                         (
00711                                                 $lng->txt("pwassist_password_assigned"),
00712                                                 $username
00713                                         )
00714                                 );
00715                         }
00716                         else
00717                         {
00718                                 $this->showAssignPasswordForm
00719                                 (
00720                                         $message,
00721                                         $username,
00722                                         $password1,
00723                                         $password2,
00724                                         $pwassist_id
00725                                 );
00726                         }       
00727                 }
00728         }
00729         
00730         /* Message form.
00731          * This form is used to show a message to the user.
00732          */
00733         function showMessageForm($message="", $text="")
00734         {
00735                 global $tpl, $ilias, $lng;
00736                 
00737                 if ($message != "")
00738                 {
00739                         $tpl->setCurrentBlock("pw_message");
00740                         $tpl->setVariable("TXT_MESSAGE", str_replace("\\n","<br>",$message));
00741                         $tpl->parseCurrentBlock();
00742                 }
00743 
00744                 $tpl->addBlockFile("CONTENT", "content", "tpl.pwassist_message.html");
00745                 $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("password_assistance"));
00746                 $tpl->setVariable("IMG_AUTH",
00747                         ilUtil::getImagePath("icon_auth_b.gif"));
00748                 $tpl->setVariable("TXT_TEXT",str_replace("\\n","<br>",$text));
00749                 $tpl->setVariable("BACK", $lng->txt("back"));
00750                 $tpl->setVariable("LINK_BACK",
00751                         $this->ctrl->getLinkTargetByClass("ilstartupgui", "showLogin"));
00752                 $tpl->setVariable("LANG", $lng->getLangKey());
00753         
00754                 $tpl->show();
00755         }
00756 }
00757 
00758 ?>

Generated on Fri Dec 13 2013 13:52:11 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1