Пример #1
0
 // Make sure forward was supplied
 if (!isset($_REQUEST['forward'])) {
     $tpl->set_msg_err(_('Error: no forward supplied'));
     $tpl->wrap_exit();
 }
 // Make sure destination was supplied
 if (!isset($_REQUEST['destination'])) {
     $tpl->set_msg_err(_('Error: no destination supplied'));
     $tpl->wrap_exit();
 }
 $forward = ereg_replace('^.qmail-', '', $_REQUEST['forward']);
 $destination = $_REQUEST['destination'];
 if (!checkEmailFormat($destination)) {
     $destination = $destination . '@' . $domain;
 }
 if (!checkEmailFormat($destination)) {
     $tpl->set_msg_err(_('Error: invalid forward supplied'));
     $tpl->wrap_exit('back.tpl');
 }
 // Add it!
 $contents = $vp->ReadFile($domain, '', ".qmail-{$forward}");
 if ($vp->Error && $vp->Error != 'command failed - -ERR XXX No such file or directory') {
     die("Error: {$vp->Error}");
 }
 // Now build a new array without that forward
 array_push($contents, "&{$destination}");
 $vp->WriteFile($contents, $domain, '', ".qmail-{$forward}");
 if ($vp->Error && $vp->Error != 'command failed - -ERR XXX No such file or directory') {
     die("Error: {$vp->Error}");
 }
 $tpl->set_msg(_("Forward Modified Successfully"));
Пример #2
0
<?php

include_once "../db_connect.php";
$data = json_decode(file_get_contents("php://input"));
if ($data->token != NULL && $data->loggedUser != NULL) {
    $response = array();
    if ($data != NULL && isset($data->username, $data->firstName, $data->lastName, $data->gender, $data->email, $data->password)) {
        $encrypted_pass = password_hash($data->password, PASSWORD_DEFAULT);
        if (checkIfStrings($data->firstName, $data->lastName) && checkEmailFormat($data->email) && $data->password == $data->password_verify) {
            $sql = "INSERT INTO users (gender,username,lname,fname,email,password,userlevel)\n\t\t\t\t\t\t\t\t   VALUES ('{$data->gender}','{$data->username}','{$data->lastName}','{$data->firstName}','{$data->email}','{$encrypted_pass}','a')";
            $query = mysqli_query($db_connect, $sql);
            if ($query === TRUE) {
                $response["success"] = 1;
                $response["message"] = "Record successfully created!";
            } else {
                $response["success"] = 0;
                $response["message"] = 'There seems to be an error wih the query:' . mysqli_error($db_connect);
            }
        } else {
            $response["success"] = 0;
            $response["message"] = 'Please provide proper input!';
        }
    } else {
        $response["success"] = 0;
        $response["message"] = 'Please fill in all fields';
    }
    echo json_encode($response);
}
function checkIfStrings($var1, $var2 = null, $var3 = null, $var4 = null, $var5 = null, $var6 = null, $var7 = null, $var8 = null)
{
    $pass = TRUE;
Пример #3
0
 /**
  * Parse Home dot-qmail
  *
  * Evaluate contents of a .qmail file in a user's home directory.
  * Looking for routing types standard, delete, or forward, with optional
  * saving of messages, as well as vacation messages.
  *
  * @author Bill Shupp <*****@*****.**>
  *
  */
 function parse_home_dotqmail($contents, $account_info = '')
 {
     global $tpl, $autorespond;
     if ($account_info == '') {
         global $uesr_info;
         $account_info = $user_info;
     }
     $is_standard = FALSE;
     $is_deleted = FALSE;
     $is_forwarded = FALSE;
     // Set default template settings
     $tpl->assign('routing_standard_checked', '');
     $tpl->assign('routing_deleted_checked', '');
     $tpl->assign('routing_forwarded_checked', '');
     $tpl->assign('forward', '');
     $tpl->assign('save_a_copy_checked', '');
     $tpl->assign('vacation_checked', '');
     $tpl->assign('vacation_subject', '');
     $tpl->assign('vacation_body', '');
     if (empty($contents)) {
         $is_standard = TRUE;
     }
     if (is_array($contents) && count($contents) == 1 && $contents[0] == '# delete') {
         $is_deleted = TRUE;
     }
     if ($is_standard) {
         $tpl->assign('routing_standard_checked', ' checked');
     } else {
         if ($is_deleted) {
             $tpl->assign('routing_deleted_checked', ' checked');
         } else {
             // now let's parse it
             while (list($key, $val) = each($contents)) {
                 if ($val == $account_info['user_dir'] . '/Maildir/' || $val == './Maildir/') {
                     $tpl->assign('save_a_copy_checked', ' checked');
                     continue;
                 }
                 if (ereg($autorespond, $val)) {
                     $tpl->assign('vacation_checked', ' checked');
                     $this->get_vacation($val);
                     continue;
                 } else {
                     if (checkEmailFormat(ereg_replace('^&', '', $val))) {
                         $is_forwarded = TRUE;
                         $tpl->assign('routing_forwarded_checked', ' checked');
                         $tpl->assign('forward', ereg_replace('^&', '', $val));
                     }
                 }
             }
             // See if default routing select applies
             if (!$is_standard && !$is_deleted && !$is_forwarded) {
                 $tpl->assign('routing_standard_checked', ' checked');
             }
         }
     }
 }
Пример #4
0
 *
 * This is where initial authentication happens
 *
 * @author Bill Shupp <*****@*****.**>
 * @package TA_Modules
 * @version 1.0
 *
 */
// Use login info (should check it first
// Try and initiate class with that info
if (isset($_POST['event']) && $_REQUEST['event'] == 'login_now') {
    if (!isset($_POST['email_address']) || !isset($_POST['password'])) {
        $tpl->set_msg_err(_('Error: missing fields'));
        $tpl->wrap_exit('login.tpl');
    }
    if (!checkEmailFormat($_POST['email_address'])) {
        $tpl->set_msg_err(_('Error: invalid email address format'));
        $tpl->wrap_exit('login.tpl');
    }
    $email_array = explode('@', $_POST['email_address']);
    $login_user = $email_array[0];
    $login_domain = $email_array[1];
    $vp = new vpopmail_admin($login_domain, $login_user, $_POST['password'], $server_ip, $server_port);
    if ($vp->Error) {
        unset($_SESSION['user']);
        unset($_SESSION['domain']);
        unset($_SESSION['password']);
        unset($_SESSION['email']);
        $tpl->set_msg("Unable to open vpopmaild - {$vp->Error}");
        $tpl->wrap_exit();
    } else {
Пример #5
0
<?php

include_once "../db_connect.php";
$data = json_decode(file_get_contents("php://input"));
if ($data->token != NULL && $data->loggedUser != NULL) {
    $response = array();
    if ($data != NULL && isset($data->username, $data->fname, $data->lname, $data->gender, $data->email)) {
        if (checkIfStrings($data->fname, $data->lname, $data->username, $data->gender) && checkEmailFormat($data->email)) {
            //userlevel and password not changeable
            $sql = "UPDATE users SET gender ='{$data->gender}',username='******',lname='{$data->lname}',fname='{$data->fname}',email='{$data->email}'\n                                   WHERE id = '{$data->id}'";
            $query = mysqli_query($db_connect, $sql);
            if ($query === TRUE) {
                $response["success"] = 1;
                $response["message"] = "Record successfully updated!";
            } else {
                $response["success"] = 0;
                $response["message"] = 'There seems to be an error.Please try again later.';
                echo "Error: " . $query . "<br>" . $db_connect->error;
            }
        } else {
            $response["success"] = 0;
            $response["message"] = 'Please provide proper input!';
        }
    } else {
        $response["success"] = 0;
        $response["message"] = 'Please fill in all fields';
    }
    echo json_encode($response);
}
function checkIfStrings($var1, $var2 = null, $var3 = null, $var4 = null, $var5 = null, $var6 = null, $var7 = null)
{