diff --git a/kloxo/file/indexcontent.php b/kloxo/file/indexcontent.php index 1fb7a459a0..dc4621d4c6 100644 --- a/kloxo/file/indexcontent.php +++ b/kloxo/file/indexcontent.php @@ -1,27 +1,12 @@ - - <?php echo get_title() ?> - - - - - -
- - - - - - - -
- - - -
-
- -





- "Kloxo Account",'domain' => 'Domain Owner', 'mailaccount' => "Mail Account"); +$progname = $sgbl->__var_program_name; + +$ghtml->print_jscript_source("/htmllib/js/lxa.js"); +if ($sgbl->is_this_slave()) { print("Slave Server\n"); exit; } + +$logfo = db_get_value("general", "admin", "login_pre"); +$logfo = str_replace("<%programname%>", $sgbl->__var_program_name, $logfo); if(!$cgi_forgotpwd ){ $ghtml->print_message(); @@ -31,158 +16,147 @@ include_once "lib/demologins.php"; } else { ?> - - - - -
-
- - - - - - - - class=logintextbox > - - - + + +
+ +
+
+ +
- iset("_cgi_nf")) { - print(""); - } - ?> - - -
Username
Password
Login As - -
- - -
Forgot Password?
- -
-
- -
- - - - - - - - -
-
- - - - - - - class=logintextbox > - - - - - - -
Username
Email Id
Login Type - -
- - -
Back to login
- -
-
- - - + + +
+ +
+
__var_program_name; + $cprogname = ucfirst($progname); + $cgi_clientname = $ghtml->frm_clientname; + $cgi_email = $ghtml->frm_email; - $cgi_clientname = $ghtml->_cgi_clientname; - $cgi_email = $ghtml->_cgi_email; + htmllib::checkForScript($cgi_clientname); + $classname = $ghtml->frm_class; - /* - if ($cgi_clientname == 'admin') { - $ghtml->print_redirect("/?frm_emessage=cannot_reset_admin"); + if (!$classname) { + $classname = getClassFromName($cgi_clientname); } -*/ - - if ($cgi_clientname != "" && $cgi_email != "") { - $tablename = $sgbl->__var_ltype[$ghtml->_cgi_typename]; - $rawdb = new Sqlite(null, $tablename); - $email = $rawdb->rawQuery("select contactemail from $tablename where nname = '$cgi_clientname';"); + if (!empty($cgi_clientname) && !empty($cgi_email)) { + $tablename = $classname; + $database = new Sqlite(null, $tablename); - if($email && $cgi_email == $email[0]['contactemail']) { + $data = $database->rawQuery("select contactemail from $tablename where nname = '$cgi_clientname';"); + + if(empty($data)) { + $ghtml->print_redirect("/login/?frm_emessage=nouser_email"); + //throw lxException('Contact email is not set on Kloxo, it could not be send to a empty address.'); + } + elseif(!isset($data[0]['contactemail'])) { + $ghtml->print_redirect("/login/?frm_emessage=nouser_email"); + //throw lxException('Contact email is not set on Kloxo, it could not be send to a empty address.'); + } + else { + $contact_email = $data[0]['contactemail']; + + if(empty($contact_email)) { + //throw lxException('Contact email is not set on Kloxo, it could not be send to a empty address.'); + $ghtml->print_redirect("/login/?frm_emessage=nouser_email"); + } + } + + if($cgi_email == $contact_email) { $rndstring = randomString(8); $pass = crypt($rndstring); - $rawdb->rawQuery("update $tablename set password = '$pass' where nname = '$cgi_clientname'"); - $mailto = $email[0]['contactemail']; - $name = "Kloxo"; - $email = "Admin"; + $database->rawQuery("update $tablename set password = '$pass' where nname = '$cgi_clientname'"); - $cc = ""; - $subject = "Kloxo Password Reset Request"; - $message = "\n\n\nYour password has been reset to the one below for your Kloxo login.\n"; - $message .= 'Username: '. $cgi_clientname."\n"; - $message .= 'New Password: '. $rndstring.''; + $subject = "$cprogname Password Reset Request"; + + $message = "\n\n\nYour password has been reset to the one below for your $cprogname login.\n" . + "The Client IP address which requested the Reset: {$_SERVER['REMOTE_ADDR']}\n" . + 'Username: '. $cgi_clientname."\n" . + 'New Password: '. $rndstring; - //$message = nl2br($message); + $from = NULL; //Setting NULL gets the program@hostname.com + lx_mail($from, $contact_email, $subject, $message); - mail($mailto, $subject, $message, "Cc: $cc\nFrom: \"$name\" <$email>\nReply-To: \"$name\" <$email>" ); - - $ghtml->print_redirect("/?frm_smessage=password_sent"); + $ghtml->print_redirect("/login/?frm_smessage=password_sent"); } else { - $ghtml->print_redirect("/?frm_emessage=nouser_email"); + $ghtml->print_redirect("/login/?frm_emessage=nouser_email"); } } } -?> -
- diff --git a/kloxo/httpdocs/login/PLACE_HOLDER b/kloxo/httpdocs/login/PLACE_HOLDER new file mode 100644 index 0000000000..e69de29bb2 diff --git a/kloxo/httpdocs/login/README.DEV b/kloxo/httpdocs/login/README.DEV new file mode 100644 index 0000000000..c025c1f8be --- /dev/null +++ b/kloxo/httpdocs/login/README.DEV @@ -0,0 +1 @@ +This directory is populated by: function setDefaultPages() in lib.php diff --git a/kloxo/httpdocs/login/index.php b/kloxo/httpdocs/login/index.php deleted file mode 100644 index 6786f2c323..0000000000 --- a/kloxo/httpdocs/login/index.php +++ /dev/null @@ -1,43 +0,0 @@ -frm_clientname; -$cgi_class = $ghtml->frm_class; -$cgi_password = $ghtml->frm_password; -$cgi_forgotpwd = $ghtml->frm_forgotpwd; -$cgi_email = $ghtml->frm_email; - -$cgi_classname = 'client'; -if ($cgi_class) { - $cgi_classname = $cgi_classname; -} -ob_start(); -include_once "htmllib/lib/indexcontent.php"; - - - -function index_print_header() -{ - global $gbl, $sgbl, $login, $ghtml; - - $progname = $sgbl->__var_program_name; - ?> - - - - - - - -
- - - -
-
-frm_clientname; -$cgi_class = $ghtml->frm_class; -$cgi_password = $ghtml->frm_password; -$cgi_forgotpwd = $ghtml->frm_forgotpwd; -$cgi_email = $ghtml->frm_email; -$cgi_classname = 'client'; -if($cgi_class) $cgi_classname = $cgi_classname; - -ob_start(); -include_once 'htmllib/lib/indexcontent.php'; - -function index_print_header() -{ - global $gbl, $sgbl, $login, $ghtml; - - $progname = $sgbl->__var_program_name; - ?> - - - - - - - - - - -
- - - - - - - - -
-
- -
-
- - - - - -
-
-