Example #1
0
function handler()
{
    global $ARI_VERSION;
    // version
    $ari_version = $ARI_VERSION;
    // check error
    $error = $_SESSION['ari_error'];
    // load modules
    loadModules();
    // login to database
    $success = databaseLogon();
    if ($success) {
        // check if login is needed
        $content = loginBlock();
        if (!isset($content)) {
            list($nav_menu, $subnav_menu, $content) = handleBlock();
        }
    } else {
        $display = new Display();
        $content .= $display->displayHeaderText("ARI");
        $content .= $display->displayLine();
        $content .= checkErrorMessage();
    }
    // log off any databases needed
    databaseLogoff();
    // check for ajax request and refresh or if not build the page
    if (isset($_REQUEST['ajax_refresh'])) {
        echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n      <response>\n        <nav_menu><![CDATA[" . $nav_menu . "]]></nav_menu>\n        <subnav_menu><![CDATA[" . $subnav_menu . "]]></subnav_menu>\n        <content><![CDATA[" . $content . "]]></content>\n      </response>";
    } else {
        // build the page
        include_once "./theme/page.tpl.php";
    }
}
Example #2
0
 /**
  * Provide a login form for user
  *
  * @param $request
  *   Variable to hold data entered into form
  */
 function GetForm()
 {
     global $ARI_NO_LOGIN;
     if ($ARI_NO_LOGIN) {
         $ret = '';
         return;
     }
     if (isset($_GET['login'])) {
         $login = $_GET['login'];
     }
     // if user name and password were given, but there was a problem report the error
     if ($this->error != '') {
         $ret = $this->error;
     }
     $language = new Language();
     $display = new Display(NULL);
     // new header
     $ret .= $display->DisplayHeaderText(_("Login"));
     $ret .= $display->DisplayLine();
     $ret .= checkErrorMessage();
     $ret .= "\n      <table id='login'>\n        <form id='login' name='login' action=" . $_SESSION['ARI_ROOT'] . " method='POST'>\n          <tr>\n            <td class='right'>\n              <small><small>" . _("Login") . ":&nbsp;&nbsp;</small></small>\n            </td>\n            <td>\n              <input type='text' name='username' value='" . $login . "' maxlength=20 tabindex=1>\n            </td>\n          </tr>\n          <tr>\n            <td class='right'>\n              <small><small>" . _("Password") . ":&nbsp;&nbsp;</small></small>\n            </td>\n            <td colspan=1>\n              <input type='password' name='password' maxlength=20 tabindex=2>\n            </td>\n          </tr>\t\n          <tr>\t\t\t\t\n            <td></td>\t\n            <td>\n              <input type='submit' name='btnSubmit' value='" . _("Submit") . "' tabindex=3></small></small></p>\n            </td>\n          </tr>\n          <tr>\n            <td class='right'>\n              <input type='checkbox' name='remember'>\n            </td>\n            <td class='left'>\n              <p class='small'>" . _("Remember Password") . "</p>\n            </td>\n          </tr>\n        </form>\n        <tr>\t\t\t\t\n          <td></td>\t\n          <td>\n            " . $language->getForm() . "\n          </td>\n        </tr>\n        <tr><td>&nbsp;</td></tr>\n      </table>\n      <table id='login_text'>\n        <tr>\n          <td>" . _("Use your <b>Voicemail Mailbox and Password</b>") . "<br>" . _("This is the same password used for the phone") . "<br>" . "<br>" . _("For password maintenance or assistance, contact your Phone System Administrator.") . "<br>" . "\n          </td>\n        </tr>\n      </table>";
     $ret .= "\n      <script type='text/javascript'> \n      <!-- \n        if (document.login) { \n          document.login.username.focus(); \n        } \n      // --> \n      </script>";
     return $ret;
 }