// GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // require_once "../ipplanlib.php"; require_once "../adodb/adodb.inc.php"; require_once "../class.dbflib.php"; require_once "../layout/class.layout"; require_once "../auth.php"; $auth = new SQLAuthenticator(REALM, REALMERROR); // And now perform the authentication $auth->authenticate(); // set language isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']); //setdefault("window",array("bgcolor"=>"white")); //setdefault("table",array("cellpadding"=>"0")); //setdefault("text",array("size"=>"2")); $title = my_("Change user password"); newhtml($p); $w = myheading($p, $title); // explicitly cast variables as security measure against SQL injection list($user, $password1, $password2) = myRegister("S:user S:password1 S:password2"); $formerror = ""; $ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database")); if ($_POST) { $password1 = trim($password1); $password2 = trim($password2); if (strlen($password1) < 5 or strlen($password2) < 5) { $formerror .= my_("The password entered must be at least five characters") . "\n";
insert($p, block("<script type=\"text/javascript\">\n</script>\n<noscript>\n<p><b>\n<font size=4 color=\"#FF0000\">\nYour browser must be JavaScript capable to use this application. Please turn JavaScript on.\n</font>\n</b>\n</noscript>\n")); $w = myheading($p, my_("Install/Upgrade IPPlan"), false); insert($w, $t = container("div")); insert($t, heading(3, my_("IPplan v4.92b Installation System"))); // BEGIN INSTALLER LANGUAGE SUPPORT if (extension_loaded("gettext") and LANGCHOICE) { if ($_POST) { // set language cookie if language changed by user // language includes path of ipplan root seperated by : if ($lang) { setcookie("ipplanLanguage", $lang . ":" . dirname(dirname(__FILE__)), time() + 10000000, "/"); $_COOKIE['ipplanLanguage'] = $lang . ":" . dirname(dirname(__FILE__)); } } if (isset($_COOKIE["ipplanLanguage"])) { myLanguage($_COOKIE['ipplanLanguage']); } insert($w, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Language"))); insert($con, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"]))); insert($f, textbr(my_("Please choose your language:"))); insert($f, block('<select NAME="lang">')); foreach ($iso_codes as $key => $value) { // look only at language part of cookie if (isset($_COOKIE["ipplanLanguage"]) and substr($_COOKIE['ipplanLanguage'], 0, 5) == $key) { insert($f, block('<option VALUE="' . $key . '" SELECTED>' . $value . "\n")); } else { insert($f, block('<option VALUE="' . $key . '">' . $value . "\n")); } }