예제 #1
0
<?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
     $image->save($Small_logo_ImgFName);
     $arr['image'] = "post/post_" . $str;
 }
 if ($_FILES['image']['name'] != '') {
     $randnum = rand();
     $str = "large" . rand() . str_replace(' ', '_', $_FILES['image']['name']);
     $Small_logo_ImgFName = "post/post_" . $str;
     $image = new SimpleImage();
     $image->load($_FILES['image']['tmp_name']);
     $image->resize(800, 600);
     //$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");