$resetter = new Resetter(); $encodeExplorer = new EncodeExplorer(); $dest = filter_input(INPUT_POST, "user_email", FILTER_VALIDATE_EMAIL); $pulito = filter_input(INPUT_POST, 'cleanurl', FILTER_SANITIZE_STRING); $postcaptcha = filter_input(INPUT_POST, "captcha", FILTER_SANITIZE_STRING); global $_USERS; global $_TOKENS; if (!$dest || $setUp->getConfig("show_captcha_reset") == true && !$postcaptcha) { print "<div class=\"alert alert-warning\">" . $encodeExplorer->getString("fill_all_fields") . "</div>"; exit; } if (Utils::checkCaptchaReset($postcaptcha) !== true) { print "<div class=\"alert alert-danger\">" . $encodeExplorer->getString("wrong_captcha") . "</div>"; exit; } if (!$updater->findEmail($dest)) { print "<div class=\"alert alert-danger\">" . $encodeExplorer->getString("email_not_exist") . "</div>"; exit; } if (!$resetter->setToken($dest)) { print "<div class=\"alert alert-danger\">Error: token not set</div>"; exit; } $token = $resetter->setToken($dest); $setfrom = $setUp->getConfig('email_from'); $mail = new PHPMailer(); $mail->CharSet = 'UTF-8'; if ($setUp->getConfig('smtp_enable') == true) { $timeconfig = $setUp->getConfig('default_timezone'); $timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC"; date_default_timezone_set($timezone);
$newquota = filter_input(INPUT_POST, "quota", FILTER_SANITIZE_STRING); $newuserfolders = false; if (isset($_POST['newuserfolders']) || $postnewuserfolder) { $newuserfolders = array(); if (isset($_POST['newuserfolders'])) { $newuserfolders = $_POST['newuserfolders']; } } $postnewusermail = filter_input(INPUT_POST, "newusermail", FILTER_VALIDATE_EMAIL); if ($postnewusername || $postnewuserpass) { if (!$postnewusername || !$postnewuserpass) { $success = $encodeExplorer->getString("indicate_username_and_password_for_new_user"); $status = 'nope'; } else { $users = $_USERS; if (!$updater->findUser($postnewusername) && !$updater->findEmail($postnewusermail)) { $newuser = array(); $salt = $setUp->getConfig('salt'); $newuserpass = crypt($salt . urlencode($postnewuserpass), Utils::randomString()); $newuser['name'] = $postnewusername; $newuser['pass'] = $newuserpass; $newuser['role'] = $_POST['newrole']; if ($postnewuserfolder) { if (!file_exists("." . $setUp->getConfig('starting_dir') . $postnewuserfolder)) { mkdir("." . $setUp->getConfig('starting_dir') . $postnewuserfolder); } if (!in_array($postnewuserfolder, $newuserfolders)) { array_push($newuserfolders, $postnewuserfolder); } } if ($newuserfolders) {