Exemplo n.º 1
0
function isAuth()
{
    session_start();
    if (isset($_SESSION['user']) && isset($_SESSION['user']['id'])) {
        return;
    }
    redirectUrl('login.php');
}
Exemplo n.º 2
0
/**
 * Convenience function to combine functions below
 */
function finalUrl($url)
{
    // This function should only works for google proxy feeds
    if (!str_contains($url, 'feedproxy.google.com')) {
        return $url;
    }
    // redirect
    $url = redirectUrl($url);
    // cleanup
    $url = cleanupUrl($url);
    // return result
    return $url;
}
Exemplo n.º 3
0
 function logout()
 {
     Session::destroySession();
     redirectUrl(SP_WEBPATH . "/login.php");
 }
Exemplo n.º 4
0
        $result = $obj_product->numberOfRows(TBL_MEMBER, 'name = "' . $name . '" AND cat_id=' . $cat_id . ' AND sub_cat_id =' . $sub_cat_id);
    }
    $obj->add_fields($cat_id, 'req', 'Please Select Product Category');
    $obj->add_fields($sub_cat_id, 'req', 'Please Select Product Sub Category');
    $error = $obj->validate();
    if ($error || $result > 0) {
        if ($result > 0) {
            $error .= "Product already Exist in selected Category.";
        }
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
    } else {
        if ($_FILES['logo']['name']) {
            $logo = $currentTimestamp . '_' . $_FILES['logo']['name'];
            move_uploaded_file($_FILES['logo']['tmp_name'], LIST_ROOT_ADMIN . "/products_manager/upload/" . $logo);
        } else {
            $logo = 'no_img.jpg';
        }
        $p_slug = $obj_handle->makeAlias($name);
        if ($obj_product->numberOfRows(TBL_PRODUCT, "p_slug = '" . $p_slug . "'") > 0) {
            $p_slug = $obj_handle->makeAlias($p_slug . " " . $cat_id);
        }
        $dataArr = array('name' => $name, 'logo' => $logo, 'desc' => $desc, 'cat_id' => $cat_id, 'sub_cat_id' => $sub_cat_id, 'publish' => $publish, 'creation_date' => $currentTimestamp, 'p_slug' => $p_slug);
        $add_product = $obj_product->save(TBL_PRODUCT, $dataArr);
        $_SESSION['msg'] = RECORD_ADD;
        redirectUrl(DEFAULT_ADMIN_URL . '/members/product.php');
        exit;
    }
}
?>

/* Get Current Date Time Stamp */
$currentTimestamp = getCurrentTimestamp();
$obj_handle = new Handle();
if (isset($submit) && $submit != "" && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $error = '';
    $obj->add_fields($name, 'req', 'Please Enter Group-Head Name');
    $obj->add_fields($address, 'req', 'Please Enter Address');
    $obj->add_fields($phone, 'req', 'Please Enter Phone No');
    $obj->add_fields($phone, 'num', 'Please Enter Valid Phone No');
    $obj->add_fields($phone, 'min=6', 'Please Enter Valid Phone No');
    $obj->add_fields($phone, 'max=12', 'Please Enter Valid Phone No');
    $error = $obj->validate();
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
    } else {
        $dataArr = array('name' => $name, 'address' => $address, 'phone' => $phone, 'status' => $publish, 'creation_date' => $currentTimestamp);
        $update_product = $obj_product->update(TBL_GHEAD, $dataArr, 'id=' . $prod_id);
        $_SESSION['msg'] = RECORD_UPDATE;
        redirectUrl(DEFAULT_ADMIN_URL . '/group_head/index.php');
        //echo '<script>location.href="'.DEFAULT_ADMIN_URL.'/group_head/index.php";</script>';
        exit;
    }
} else {
    #Code to Fetch seleted ID's data
    $getProduct = $obj_product->read(TBL_GHEAD, 'id=' . $prod_id);
    $fetchProduct = $db->fetchNextObject($getProduct);
    $name = $fetchProduct->name;
    $address = $fetchProduct->address;
    $phone = $fetchProduct->phone;
    $publish = $fetchProduct->status;
}
Exemplo n.º 6
0
/* Get Current Date Time Stamp */
$currentTimestamp = getCurrentTimestamp();
if (isset($submit) && $submit != "" && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $error = '';
    $obj->add_fields($title, 'req', 'Please Enter Title');
    $error = $obj->validate();
    $image = '';
    //--------------------------------------------//
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
    } else {
        if ($_FILES["logo"]["name"]) {
            $type = explode(".", $_FILES["logo"]["name"]);
            if (end($type) == "png" || end($type) == "jpeg" || end($type) == "jpg" || end($type) == "gif") {
                $image = getCurrentTimestamp() . '-' . $_FILES["logo"]["name"];
                //chmod(DEFAULT_ADMIN_URL."/images/brands",0777);
                move_uploaded_file($_FILES["logo"]["tmp_name"], LIST_ROOT_ADMIN . "/images/brands/" . $image);
            }
        }
        $dataArr = array('title' => $title, 'logo' => $image, 'publish' => $publish, 'creation_date' => $currentTimestamp);
        $add_product = $obj_block->save(TBL_BRANDS, $dataArr);
        $_SESSION['msg'] = 'Brand Successfully Added';
        redirectUrl(DEFAULT_ADMIN_URL . '/brands/index.php');
        unset($obj_block);
        unset($obj);
        exit;
    }
}
?>

        if (!empty($_FILES["banner_image"]["name"])) {
            $image = $currentTimestamp . '-' . $obj_handle->makeAlias($_FILES["banner_image"]["name"]);
            @chmod(DEFAULT_ADMIN_URL . "/images/htmlpage", 0777);
            if (isset($old_image) && $old_image != '' && file_exists(LIST_ROOT_ADMIN . "/images/htmlpage/" . $old_image)) {
                @unlink(LIST_ROOT_ADMIN . "/images/htmlpage/" . $old_image);
            }
            move_uploaded_file($_FILES["banner_image"]["tmp_name"], LIST_ROOT_ADMIN . "/images/htmlpage/" . $image);
        } else {
            $image = $old_image;
        }
        $middle_text = str_replace('../js/uploaded/', DEFAULT_ADMIN_URL . '/js/uploaded/', $middle_text);
        $footer_above_text = str_replace('../js/uploaded/', DEFAULT_ADMIN_URL . '/js/uploaded/', $footer_above_text);
        $footer_text = str_replace('../js/uploaded/', DEFAULT_ADMIN_URL . '/js/uploaded/', $footer_text);
        $dataArr = array('middle_text' => $middle_text, 'footer_above_text' => $footer_above_text, 'footer_text' => $footer_text, 'creation_date' => $currentTimestamp);
        $update_product = $obj_block->update(TBL__HTMLPAGE, $dataArr, 'id=1');
        $_SESSION['msg'] = 'Html Page Successfully Updated';
        unset($obj_block);
        unset($obj);
        redirectUrl(DEFAULT_ADMIN_URL . '/htmlpage/update.php');
        exit;
    }
} else {
    #Code to Fetch seleted ID's data
    $getBlock = $obj_block->read(TBL__HTMLPAGE, 'id=1');
    $fetchBlock = $db->fetchNextObject($getBlock);
    // $old_image = $fetchBlock->banner_image ;
    $middle_text = $fetchBlock->middle_text;
    $footer_above_text = $fetchBlock->footer_above_text;
    $footer_text = $fetchBlock->footer_text;
    unset($obj_block);
}
Exemplo n.º 8
0
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
include_once "includes/sp-load.php";
if (isLoggedIn() && $_GET['sec'] != 'logout') {
    redirectUrl(SP_WEBPATH . "/");
}
include_once SP_CTRLPATH . "/user.ctrl.php";
$controller = new UserController();
$controller->view->menu = 'login';
$controller->set('spTitle', 'Seo Panel: Login section');
$controller->set('spDescription', 'Login to Seo Panel and utilise seo tools and plugins to increase the perfomance of your site.');
$controller->set('spKeywords', 'Seo Panel Login section');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    switch ($_POST['sec']) {
        case "login":
            $controller->login();
            break;
        case "requestpass":
            $controller->set('spTitle', 'Seo panel forgot password');
            $controller->requestPassword($_POST['email']);
Exemplo n.º 9
0
    /**
     * Check the default provider to see if it overrides one of the entry methods and then redirect.
     *
     * @param string $Type One of the following.
     *  - SignIn
     *  - Register
     *  - SignOut (not complete)
     * @param string $Target
     * @param string $TransientKey
     */
    protected function checkOverride($Type, $Target, $TransientKey = null)
    {
        if (!$this->Request->get('override', true)) {
            return;
        }
        $Provider = Gdn_AuthenticationProviderModel::getDefault();
        if (!$Provider) {
            return;
        }
        $this->EventArguments['Target'] = $Target;
        $this->EventArguments['DefaultProvider'] =& $Provider;
        $this->EventArguments['TransientKey'] = $TransientKey;
        $this->fireEvent("Override{$Type}");
        $Url = $Provider[$Type . 'Url'];
        if ($Url) {
            switch ($Type) {
                case 'Register':
                case 'SignIn':
                    // When the other page comes back it needs to go through /sso to force a sso check.
                    $Target = '/sso?target=' . urlencode($Target);
                    break;
                case 'SignOut':
                    $Cookie = c('Garden.Cookie.Name');
                    if (strpos($Url, '?') === false) {
                        $Url .= '?vfcookie=' . urlencode($Cookie);
                    } else {
                        $Url .= '&vfcookie=' . urlencode($Cookie);
                    }
                    // Check to sign out here.
                    $SignedOut = !Gdn::session()->isValid();
                    if (!$SignedOut && (Gdn::session()->validateTransientKey($TransientKey) || $this->Form->isPostBack())) {
                        Gdn::session()->end();
                        $SignedOut = true;
                    }
                    // Sign out is a bit of a tricky thing so we configure the way it works.
                    $SignoutType = c('Garden.SSO.Signout');
                    switch ($SignoutType) {
                        case 'redirect-only':
                            // Just redirect to the url.
                            break;
                        case 'post-only':
                            $this->setData('Method', 'POST');
                            break;
                        case 'post':
                            // Post to the url after signing out here.
                            if (!$SignedOut) {
                                return;
                            }
                            $this->setData('Method', 'POST');
                            break;
                        case 'none':
                            return;
                        case 'redirect':
                        default:
                            if (!$SignedOut) {
                                return;
                            }
                            break;
                    }
                    break;
                default:
                    throw new Exception("Unknown entry type {$Type}.");
            }
            $Url = str_ireplace('{target}', rawurlencode(url($Target, true)), $Url);
            if ($this->deliveryType() == DELIVERY_TYPE_ALL && strcasecmp($this->data('Method'), 'POST') != 0) {
                redirectUrl($Url, 302);
            } else {
                $this->setData('Url', $Url);
                $Script = <<<EOT
<script type="text/javascript">
   window.location = "{$Url}";
</script>
EOT;
                $this->render('Redirect', 'Utility');
                die;
            }
        }
    }
Exemplo n.º 10
0
            if (isset($remember) && $remember == '1') {
                setcookie('user_name1', $user_name, time() + 24 * 60 * 60 * 30);
                setcookie('password1', $password, time() + 24 * 60 * 60 * 30);
            }
            if (isset($referer) and $referer != '') {
                if (strpos($referer, 'logout') !== false) {
                    redirectUrl(DEFAULT_ADMIN_URL . '/dashboard/index.php');
                } else {
                    if (strpos($referer, 'login/login.php') !== false) {
                        redirectUrl(DEFAULT_ADMIN_URL . '/dashboard/index.php');
                    } else {
                        redirectUrl($referer);
                    }
                }
            } else {
                redirectUrl(DEFAULT_ADMIN_URL . '/dashboard/index.php');
            }
            exit;
        } else {
            $result = "Invalid username or password";
        }
    } else {
        $result = "Please fill all the required fields.";
    }
    unset($objLogin);
} else {
    if (isset($forgot_submit)) {
        $objValidation = new validation();
        $objValidation->add_fields($email, 'req', 'Please Enter Email Address');
        $error = $objValidation->validate();
        if ($error) {
Exemplo n.º 11
0
<?php

if (isset($_GET['lang'])) {
    setLang($_GET['lang']);
}
if (isset($_SERVER['HTTP_REFERER'])) {
    redirectUrl($_SERVER['HTTP_REFERER']);
} else {
    redirect("homepage");
}
Exemplo n.º 12
0
function redirect($routeName = '')
{
    // redirect to generate url
    redirectUrl(generateUrl($routeName));
}
Exemplo n.º 13
0
        if (!empty($_FILES["banner_image"]["name"])) {
            $image = $currentTimestamp . '-' . $obj_handle->makeAlias($_FILES["banner_image"]["name"]);
            @chmod(DEFAULT_ADMIN_URL . "/images/banner", 0777);
            if (isset($old_image) && $old_image != '' && file_exists(LIST_ROOT_ADMIN . "/images/banner/" . $old_image)) {
                @unlink(LIST_ROOT_ADMIN . "/images/banner/" . $old_image);
            }
            move_uploaded_file($_FILES["banner_image"]["tmp_name"], LIST_ROOT_ADMIN . "/images/banner/" . $image);
        } else {
            $image = $old_image;
        }
        $middle_text = str_replace('../js/uploaded/', DEFAULT_ADMIN_URL . '/js/uploaded/', $middle_text);
        $footer_above_text = str_replace('../js/uploaded/', DEFAULT_ADMIN_URL . '/js/uploaded/', $footer_above_text);
        $footer_text = str_replace('../js/uploaded/', DEFAULT_ADMIN_URL . '/js/uploaded/', $footer_text);
        $dataArr = array('banner_image' => $image, 'middle_text' => $middle_text, 'footer_above_text' => $footer_above_text, 'footer_text' => $footer_text, 'creation_date' => $currentTimestamp);
        $update_product = $obj_block->update(TBL_BANNER, $dataArr, 'id=1');
        $_SESSION['msg'] = 'Banner Successfully Updated';
        unset($obj_block);
        unset($obj);
        redirectUrl(DEFAULT_ADMIN_URL . '/banner/update.php');
        exit;
    }
} else {
    #Code to Fetch seleted ID's data
    $getBlock = $obj_block->read(TBL_BANNER, 'id=1');
    $fetchBlock = $db->fetchNextObject($getBlock);
    $old_image = $fetchBlock->banner_image;
    $middle_text = $fetchBlock->middle_text;
    $footer_above_text = $fetchBlock->footer_above_text;
    $footer_text = $fetchBlock->footer_text;
    unset($obj_block);
}
Exemplo n.º 14
0
        $file_type = strtolower(end(explode(".", $_FILES["image"]["name"])));
        if ($file_type == "png" || $file_type == "jpeg" || $file_type == "jpg" || $file_type == "gif") {
            $valid_file_type = 'yeap';
        } else {
            $valid_file_type = '';
        }
        $obj->add_fields($valid_file_type, 'req', 'Please upload image file only.');
    }
    $error = $obj->validate();
    //--------------------------------------------//
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
    } else {
        $image = '';
        if (!empty($_FILES["image"]["name"])) {
            $type = strtolower(end(explode(".", $_FILES["image"]["name"])));
            if ($type == "png" || $type == "jpeg" || $type == "jpg" || $type == "gif") {
                $image = $currentTimestamp . '-' . $obj_handle->makeAlias($_FILES["image"]["name"]) . '.' . $type;
                @chmod(LIST_ROOT_ADMIN . "/images/new_model", 0777);
                move_uploaded_file($_FILES["image"]["tmp_name"], LIST_ROOT_ADMIN . "/images/new_model/" . $image);
            }
        }
        $dataArr = array('brand_name' => $brand_name, 'year' => $year, 'image' => $image, 'prix' => $prix, 'publish' => $publish, 'creation_date' => $currentTimestamp);
        $add_product = $obj_block->save(TBL_NEW_MODEL, $dataArr);
        $_SESSION['msg'] = 'New Model Successfully Added';
        redirectUrl(DEFAULT_ADMIN_URL . '/new_model/index.php');
        unset($obj_block);
        unset($obj);
        exit;
    }
}
Exemplo n.º 15
0
                			unlink(LIST_ROOT_ADMIN."/images/new_model/".$old_image);
                		}*/
                if (isset($old_image) && $old_image != '' && file_exists(LIST_ROOT_ADMIN . "/images/htmltemplate/" . $old_image)) {
                    @unlink(LIST_ROOT_ADMIN . "/images/htmltemplate/" . $old_image);
                }
                move_uploaded_file($_FILES["image"]["tmp_name"], LIST_ROOT_ADMIN . "/images/htmltemplate/" . $image);
            }
        } else {
            $image = $old_image;
        }
        $dataArr = array('title' => $title, 'details_url' => $details_url, 'image' => $image, 'price' => $price, 'publish' => $publish);
        $update_product = $obj_block->update(TBL__HTMLTEMPLATE, $dataArr, 'id=' . $model_id);
        $_SESSION['msg'] = 'Car Template Successfully Updated';
        unset($obj_block);
        unset($obj);
        redirectUrl(DEFAULT_ADMIN_URL . '/htmltemplate/index.php');
        exit;
    }
} else {
    //echo "virender";
    #Code to Fetch seleted ID's data
    $getBlock = $obj_block->read(TBL__HTMLTEMPLATE, 'id=' . $model_id);
    $fetchBlock = $db->fetchNextObject($getBlock);
    // print_r($fetchBlock);
    $title = $fetchBlock->title;
    $details_url = $fetchBlock->details_url;
    $old_image = $fetchBlock->image;
    $price = $fetchBlock->price;
    $publish = $fetchBlock->publish;
    unset($obj_block);
}
Exemplo n.º 16
0
    //--------------------------------------------//
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
    } else {
        $image = '';
        if ($_FILES["image"]["name"]) {
            $type = explode(".", $_FILES["image"]["name"]);
            if (end($type) == "png" || end($type) == "jpeg" || end($type) == "jpg" || end($type) == "gif") {
                $image = getCurrentTimestamp() . '-' . $_FILES["image"]["name"];
                //chmod(DEFAULT_ADMIN_URL."/images/used_car/image",0777);
                move_uploaded_file($_FILES["image"]["tmp_name"], LIST_ROOT_ADMIN . "/images/used_car/image/" . $image);
            }
        }
        $dispo = '';
        if ($_FILES["dispo"]["name"]) {
            $type = explode(".", $_FILES["dispo"]["name"]);
            if (end($type) == "png" || end($type) == "jpeg" || end($type) == "jpg" || end($type) == "gif") {
                $dispo = getCurrentTimestamp() . '-' . $_FILES["dispo"]["name"];
                //chmod(DEFAULT_ADMIN_URL."/images/used_car/dispo",0777);
                move_uploaded_file($_FILES["dispo"]["tmp_name"], LIST_ROOT_ADMIN . "/images/used_car/dispo/" . $dispo);
            }
        }
        $dataArr = array('model_name' => $model_name, 'brand_id' => $brand_id, 'year' => $year, 'image' => $image, 'dispo' => $dispo, 'prix' => $prix, 'publish' => $publish, 'creation_date' => $currentTimestamp);
        $add_product = $obj_block->save(TBL_USED_CAR, $dataArr);
        $_SESSION['msg'] = 'Car Successfully Added';
        redirectUrl(DEFAULT_ADMIN_URL . '/used_car/index.php');
        unset($obj_block);
        unset($obj);
        exit;
    }
}
Exemplo n.º 17
0
function isHavingWebsite()
{
    $userId = isLoggedIn();
    $websiteCtrl = new WebsiteController();
    $count = isAdmin() ? $websiteCtrl->__getCountAllWebsites() : $websiteCtrl->__getCountAllWebsites($userId);
    if ($count <= 0) {
        redirectUrl(SP_WEBPATH . "/admin-panel.php?sec=newweb");
    }
}
Exemplo n.º 18
0
<?php

extract($_GET);
extract($_POST);
# ----------------------------------------------------------------------------------------------------
if ((isset($submit) || isset($submit_x)) && ($submit != "" || $submit_x != '')) {
    if ($user_name != '' && $password != '') {
        $objLogin = new LoginSystem();
        if ($objLogin->doLogin($user_name, $password)) {
            //echo '<script>location.href="'.DEFAULT_ADMIN_URL.'/home/home.php";</script>';
            redirectUrl(DEFAULT_ADMIN_URL . '/home/home.php');
            exit;
        } else {
            $result = "Invalid username or password";
        }
    } else {
        $result = "please fill all the required fields.";
    }
}
Exemplo n.º 19
0
 function logout()
 {
     Session::setSession('userInfo', "");
     redirectUrl(SP_WEBPATH . "/login.php");
 }
Exemplo n.º 20
0
<?php

include_once '../../conf/config.inc.php';
$logout = new LoginSystem();
$logout->logout();
//echo '<script>location.href="'.DEFAULT_ADMIN_URL.'/login/login.php";</script>';
redirectUrl(DEFAULT_ADMIN_URL . '/login/login.php');
exit;
?>



	







Exemplo n.º 21
0
<html>
<head>
<meta charset="utf-8">
<?php 
        redirectTitle($_REQUEST['short']);
        ?>
<script>
<!--
<?php 
        // Get deeplinked URL
        $detect = new Mobile_Detect();
        // iOS
        if ($detect->isMobile() && $detect->isiOS()) {
            echo redirectUrl($_REQUEST['short'], "ios");
            // Android
        } elseif ($detect->isMobile() && $detect->isAndroidOS()) {
            echo redirectUrl($_REQUEST['short'], "android");
            // Web fallback
        } else {
            echo redirectUrl($_REQUEST['short']);
        }
        ?>
//-->
</script>
</head>

<body>
</body>
</html><?php 
    }
}