コード例 #1
0
ファイル: login.php プロジェクト: par-orillonsoft/jwasser
<?php

require_once "includes/application-top.php";
$objAdmin = new Admins();
$adminUname = fun_db_output($_POST['username']);
$adminPass = fun_db_output($_POST['password']);
if ($objAdmin->fun_verify_admins($adminUname, md5($adminPass))) {
    $adminInfo = $objAdmin->fun_getAdminUserInfo(0, $adminUname);
    if (sizeof($adminInfo)) {
        if ($adminInfo['status'] == "1") {
            $_SESSION['session_admin_userid'] = $adminInfo['id'];
            $_SESSION['session_admin_username'] = $adminInfo['username'];
            $_SESSION['session_admin_password'] = $adminInfo['password'];
            $_SESSION['session_admin_type'] = $adminInfo['type'];
            redirectURL(SITE_ADMIN_URL . "profile.php");
        } else {
            unset($_SESSION['session_admin_userid']);
            unset($_SESSION['session_admin_username']);
            unset($_SESSION['session_admin_password']);
            $_SESSION['msg'] = 'You account has been suspended due to some reason!';
            redirectURL(SITE_ADMIN_URL . "profile-login.php");
        }
    } else {
        $_SESSION['msg'] = 'Invalid username or password!';
        redirectURL(SITE_ADMIN_URL . "profile-login.php");
    }
} else {
    $_SESSION['msg'] = 'Invalid username or password!';
    redirectURL(SITE_ADMIN_URL . "profile-login.php");
}
コード例 #2
0
ファイル: reset-pwd.php プロジェクト: par-orillonsoft/jwasser
<?php

require_once "includes/application-top.php";
$objAdmin = new Admins();
$objAdmin->fun_authenticate_admin();
$dbObj = new DB();
$dbObj->fun_db_connect();
//print_r($_POST);
if (count($_POST) > 0) {
    $sql_pwd = "SELECT * FROM " . TABLE_USERS . " where password='******'o_password']) . "' and id=" . $_POST['user_id'];
    $rsResult_pwd = $dbObj->fun_db_query($sql_pwd);
    $total = $dbObj->fun_db_get_num_rows($rsResult_pwd);
    if ($total) {
        if (@$_POST['n_password'] == @$_POST['c_password']) {
            $arr['password'] = md5($_POST['n_password']);
            $lastID = $dbObj->update_data(TABLE_USERS, 'id', $arr, md5($_POST['user_id']));
            $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Password changed</span>';
            redirectURL(SITE_ADMIN_URL . "logout.php");
        } else {
            $_SESSION['msg'] = "New password and Comform password are not matching";
            redirectURL(SITE_ADMIN_URL . "reset-password.php");
        }
    } else {
        $_SESSION['msg'] = "old password incorrect";
        redirectURL(SITE_ADMIN_URL . "reset-password.php");
    }
}
コード例 #3
0
if (count($_POST) > 0) {
    $arr = $_POST;
    $arr['add_date'] = date("Y-m-d H:i:s");
    $lastID1 = $dbObj->insert_data(TABLE_COMMENT, $arr);
    /* mail for new comment*/
    if ($_SESSION['session_admin_userid'] == '') {
        if ($lastID1) {
            $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Your comment is successfully posted. Will display after approval.</span>';
        }
        $user_name = 'jwasser.com';
        //site url
        $mail = new PHPMailer();
        $mail->From = "*****@*****.**";
        $mail->FromName = $user_name;
        $mail->AddReplyTo($_POST['email']);
        $mail->AddAddress("*****@*****.**");
        $mail->Subject = "Comment Posted On Post";
        $mail->IsHTML(true);
        $mail->Body = "<b><font  style='font-size:14px;'>Below comment posted on post for approvel</font></b><br><br>\n\t\t                    <br>" . $arr['comment'] . "<br>";
        $mail->send();
        //if(!$mail->send()){echo "Not Send";die;}else{echo "Mail Send";die;}
    }
    $sqlSel_com1 = "SELECT * FROM " . TABLE_COMMENT . " where post_id=" . $arr['post_id'];
    $rsResult_com1 = $dbObj->fun_db_query($sqlSel_com1);
    $total_comment = $dbObj->fun_db_get_num_rows($rsResult_com1);
    $arr['total_comment'] = $total_comment;
    $lastID = $dbObj->update_data(TABLE_POST, 'id', $arr, md5($arr['post_id']));
    if ($lastID) {
        redirectURL("show-post.php?id=" . $arr['post_id']);
    }
}
コード例 #4
0
require_once "includes/application-top.php";
$objAdmin = new Admins();
$objAdmin->fun_authenticate_admin();
$dbObj = new DB();
$dbObj->fun_db_connect();
//print_r($_POST);
if (count($_POST) > 0) {
    $sql_pwd = "SELECT * FROM " . TABLE_USERS . " where password='******'o_password']) . "' and id=" . $_POST['user_id'];
    $rsResult_pwd = $dbObj->fun_db_query($sql_pwd);
    $total = $dbObj->fun_db_get_num_rows($rsResult_pwd);
    if ($total) {
        if (@$_POST['n_password'] == @$_POST['c_password']) {
            $arr['password'] = md5($_POST['n_password']);
            $lastID = $dbObj->update_data(TABLE_USERS, 'id', $arr, md5($_POST['user_id']));
            $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Password Changed</span>';
            redirectURL(SITE_ADMIN_URL . "logout.php?reset=yes");
        } else {
            $_SESSION['msg'] = "New password and confirm password are not matching";
        }
    } else {
        $_SESSION['msg'] = "Old password incorrect";
    }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xml:lang="en">
<head>

	<title><?php 
echo prefix . " | Reset Password";
?>
コード例 #5
0
require '_config/functions.php';
require '_config/Database.singleton.php';
$db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
$db->connect();
$page = sanitize($_GET['page']);
$doit = empty($page) ? '/' : $page;
if ($doit == '/') {
    ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
	<link rel="stylesheet" href="css/main.css" type="text/css" />
</head>
<body>

		<h1><?php 
    echo SITE_URL;
    ?>
</h1>
		
			<p class="about">This is a URL Shortner developed by <a href="http://andrewchamp.com/">Andrew Champ</a>.</p>

</body>
</html>
<?php 
} else {
    redirectURL();
}
$db->close();
ob_flush();
コード例 #6
0
ファイル: edit.php プロジェクト: par-orillonsoft/jwasser
$dbObj->fun_db_connect();
if (count($_POST) > 0) {
    $arr = $_POST;
    $image_info = getimagesize($_FILES["images"]["tmp_name"]);
    $image_width = $image_info[0];
    $image_height = $image_info[1];
    if ($_FILES['images']['name'] != '') {
        if ($image_width >= 400 && $image_height >= 300) {
            $randnum = rand();
            $str = str_replace(' ', '_', $_FILES['images']['name']);
            $Small_logo_ImgFName = "user/user_" . $str;
            $image = new SimpleImage();
            $image->load($_FILES['images']['tmp_name']);
            $image->resize(400, 300);
            $image->save($Small_logo_ImgFName);
            $arr['images'] = "user/user_" . $str;
        } else {
            $_SESSION['msg'] = "Images Size To small";
            redirectURL(SITE_ADMIN_URL . "profile-edit.php");
        }
    }
    $lastID = $dbObj->update_data(TABLE_USERS, 'id', $arr, md5($_POST['id']));
    if ($lastID) {
        $_SESSION['msg'] = "<span style=' color:green;font-size:13px;'>User Updated</span>";
    }
    if ($_REQUEST['action'] == 'edit') {
        redirectURL(SITE_ADMIN_URL . "profile-edit.php?action=edit&id=" . $_REQUEST['id']);
    } else {
        redirectURL(SITE_ADMIN_URL . "profile.php");
    }
}
コード例 #7
0
ファイル: create.php プロジェクト: par-orillonsoft/jwasser
if (count($_POST) > 0) {
    $arr = $_POST;
    $arr['add_date'] = date("Y-m-d H:i:s");
    $arr['password'] = md5($arr['password']);
    $arr['status'] = 1;
    if ($_FILES['images']['name'] != '') {
        $randnum = rand();
        $str = str_replace(' ', '_', $_FILES['images']['name']);
        $Small_logo_ImgFName = "user/user_" . $str;
        $image = new SimpleImage();
        $image->load($_FILES['images']['tmp_name']);
        $image->resize(400, 300);
        $image->save($Small_logo_ImgFName);
        $arr['images'] = "user/user_" . $str;
    }
    $existusername = $dbObj->fun_check_username_admin_existance1($arr['username']);
    $existemail = $dbObj->fun_check_email_admin_existance1($arr['email']);
    if ($existusername) {
        $_SESSION['msg'] = "Username already Exits";
        redirectURL(SITE_ADMIN_URL . "create-profile.php");
    } elseif ($existemail) {
        $_SESSION['msg'] = "Email already Exits";
        redirectURL(SITE_ADMIN_URL . "create-profile.php");
    } else {
        $lastID = $dbObj->insert_data(TABLE_USERS, $arr);
        if ($lastID) {
            $_SESSION['msg'] = "<span style=' color:green;font-size:13px;'>Profile Created</span>";
            redirectURL(SITE_ADMIN_URL . "create-profile.php");
        }
    }
}
コード例 #8
0
ファイル: post.php プロジェクト: par-orillonsoft/jwasser
                //$image->resize(400,300);
                $image->save($Small_logo_ImgFName);
                $arr['larg_image'] = "post/post_" . $str;
            }
            $lastID = $dbObj->insert_data(TABLE_POST, $arr);
            $adminInfo = $objAdmin->fun_getAdminUserInfo(0, $_SESSION['session_admin_username']);
            if ($lastID) {
                $user_name = 'jwasser.com';
                //site url
                $mail = new PHPMailer();
                $mail->From = "*****@*****.**";
                $mail->FromName = $user_name;
                $mail->AddReplyTo($adminInfo['email']);
                $mail->AddAddress("*****@*****.**");
                $mail->Subject = "New Post";
                $mail->IsHTML(true);
                $mail->Body = "<b><font  style='font-size:14px;'>New Post on jwasser.</font></b><br><br>\n\t\t\t\t\t\t\t\t<br> Posted By : " . $_SESSION['session_admin_username'] . "<br>";
                $mail->send();
                //if(!$mail->send()){echo "Not Send";die;}else{echo "Mail Send";}
                $_SESSION['msg'] = "<span style=' color:green;font-size:13px;'>Post Insert Successfully</span>";
                redirectURL(SITE_ADMIN_URL . "index.php");
            }
        } else {
            $_SESSION['msg'] = "Images Size To small";
            redirectURL(SITE_ADMIN_URL . "add-post.php");
        }
    } else {
        $_SESSION['msg'] = "Plz check Images Size";
        redirectURL(SITE_ADMIN_URL . "add-post.php");
    }
}