Example #1
0
/**
* Logout function
*/
function logout_josso(&$user, &$new_session)
{
    if (isset($_SESSION["OPTIONAL_LOGIN_EXECUTED"])) {
        unset($_SESSION["OPTIONAL_LOGIN_EXECUTED"]);
    }
    if (isset($_SESSION["JOSSO_AUTOMATIC_LOGIN_EXECUTED"])) {
        unset($_SESSION["JOSSO_AUTOMATIC_LOGIN_EXECUTED"]);
    }
    if (isset($_SESSION["JOSSO_AUTOMATIC_LOGIN_REFERER"])) {
        unset($_SESSION["JOSSO_AUTOMATIC_LOGIN_REFERER"]);
    }
    forceRedirect(jossoCreateLogoutUrl(null));
}
Example #2
0
 public function setUserData()
 {
     if (!isset($_SESSION['LOGIN_ID'])) {
         forceRedirect('index.php');
     }
     $this->objUser = new PDODatabase();
     $prefix = 'us01';
     $table = 'users';
     $_id = $prefix . 'uin';
     $field_list = array('uin', 'username', 'password', 'email', 'status', 'us00uin');
     $this->setMasterData($table, $field_list, $prefix, array(), '', array());
     //$this->objUser->setMasterData($table,$field_list,$prefix);
     //var_dump($this->objDb);
     //echo 'login id '.$_SESSION['LOGIN_ID'];
     $data = $this->get(array("username" => $_SESSION['LOGIN_ID']));
     //var_dump($data);
     foreach ($data as $row) {
         $this->userDetails = $row;
     }
     //var_dump($this->userDetails);
     $this->objUserModule = new PDODatabase();
     $prefix1 = 'us02';
     $table = $prefix1 . 'modules';
     $_id = $prefix1 . 'uin';
     $field_list = array($prefix1 . 'uin', $prefix1 . 'set02uin', $prefix1 . 'us01uin', $prefix1 . 'view', $prefix1 . 'add', $prefix1 . 'delete');
     $this->objUserModule->setMasterData($table, $field_list, $prefix1, array(), '', array());
     //var_dump($this->objDb);
     //echo 'login id '.$_SESSION['LOGIN_ID'];
     //echo $prefix1."set02uin='".$this->userDetails['us01uin']."'";
     $data = $this->objUserModule->get($prefix1 . "us01uin='" . $this->userDetails['us01uin'] . "'");
     //var_dump($data);
     foreach ($data as $row) {
         $QRY = 'SELECT S.*,M.* FROM set02modules S INNER JOIN us02modules M ON S.set02uin=M.us02set02uin;';
         //$QRY="select * from set02modules where set02uin=".$row[$prefix1.'set02uin'];
         $data = Query($QRY);
         foreach ($data as $row) {
             $this->Rights[] = $row;
         }
         //echo $QRY;
     }
     //var_dump($this->Rights);
     //var_dump($this->userDetails);
 }
Example #3
0
        $strSQL = 'select * from us01users where us01username = "******"';
        //$strSQL = 'select * from controller where user = "******"';
        $strResult = $db->db->query($strSQL);
        //var_dump($arrResult);die();
        if ($strResult->rowCount() >= 1) {
            $GLOBALS['arrUserInfo'] = $strResult->fetchAll(PDO::FETCH_ASSOC);
            return true;
        }
    } else {
    }
    return false;
}
$x = isLogged($myDb);
//echo $x;die();
if ($x) {
    forceRedirect('home.php');
}
if (isset($_POST['login'])) {
    //Write code here for user validation...
    $strName = getREQUEST('username');
    $strPass = getREQUEST('password');
    if (!empty($strName) || !empty($strPass)) {
        $strSql = 'select * from us01users where us01username = "******"';
        $strResult = $myDb->db->query($strSql);
        if ($strResult->rowCount() >= 1) {
            //echo 'password match';die();
            $arrUserInfo = $strResult->fetchAll(PDO::FETCH_ASSOC);
            if (sha1(md5(sha1($strPass))) == $arrUserInfo[0]['us01password']) {
                $_SESSION['LOGIN_ID'] = $arrUserInfo[0]['us01username'];
                // echo mysql_num_rows($strResult);                die();
                header('location:index.php');
Example #4
0
<?php

/***************** these fields are required ************************************/
//die();
//var_dump($MyModules);
$objUser = new Users();
$data['message'] = '';
$id = 0;
$id = getREQUEST('_Id');
if (getREQUEST('sub')) {
    //$id=getREQUEST('_Id');
    $newPass = $objUser->reset_Password($id);
    if ($newPass) {
        $data['message'] = 'Password Changed Successfully. New password is ' . $newPass;
    } else {
        $data['message'] = 'Problem Resetting password !!!';
    }
} elseif (getREQUEST('negative')) {
    forceRedirect('home.php?module=Users');
}
//echo $id;
$data['_data'] = $objUser->getByID($id);
//var_dump($data);
echo defaultAdminModule($strModuleName, $data);
Example #5
0
<?php 
$id = getREQUEST('_Id');
$objCat = new NewsType();
$obj = new News();
if ($id) {
    $list = $obj->getByType($id);
    $Cat = $objCat->getById($id);
    $data['title'] = $Cat[$objCat->getPrefix() . 'title'];
    //News & Events';
} else {
    forceRedirect(BASE_URL);
    die;
    $list = $obj->get();
    $data['title'] = 'News & Events';
}
$data['data'] = $list;
$data['tot_page'] = ceil(count($list) / NEWS_PER_PAGE);
//var_dump($data);
//echo $list->rowCount();
echo defaultModule($strModuleName, $data);
    unset($_SESSION['JOSSO_ORIGINAL_URL']);
} else {
    if (isset($josso_defaultResource)) {
        $backToUrl = $josso_defaultResource;
    }
}
// Set P3P Header
$p3pHeaderValue = $josso_agent->getP3PHeaderValue();
if (isset($p3pHeaderValue)) {
    header($josso_agent->getP3PHeaderValue());
}
if (isset($backToUrl)) {
    if (isset($jossoUser)) {
        $backToUrl = str_replace('&amp;', '&', reapply_sid($backToUrl));
    }
    forceRedirect($backToUrl, true);
}
// No page is stored or no session was found, just display an error one ...
?>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
	<title>JOSSO - PHP Problem</title>
	<meta name="description" content="Java Open Single Signon">
</head>

<body>
    <h1>JOSSO Encountered a Problem!</h1>
    <h2>Either you accessed this page directly or no PHP Session support is available!</h2>
</body>
</html>
Example #7
0
<?php

//var_dump( get_browser());
$id = getREQUEST('_Id');
if (!$id) {
    $url = getSiteLink('home');
    //echo $url;
    forceRedirect($url);
}
//$objCat= new NewsType();
$obj = new FromPaper();
//$objHitCounter= new HitCounter();
//$ip=$_SERVER['REMOTE_ADDR'];
$list = $obj->getById($id);
$data['title'] = 'पत्रपत्रिका बाट';
$data['data'] = $list;
echo defaultModule($strModuleName, $data);
Example #8
0
function jossoRequestLogoutForUrl($currentUrl)
{
    $_SESSION['JOSSO_ORIGINAL_URL'] = $currentUrl;
    // Get JOSSO Agent instance
    $josso_agent =& jossoagent::getNewInstance();
    $logoutUrl = $josso_agent->getGatewayLogoutUrl() . '?josso_back_to=' . $currentUrl;
    $logoutUrl = $logoutUrl . createFrontChannelParams();
    // Clear SSO Cookie
    setcookie("JOSSO_SESSIONID", '', 0, "/");
    // session cookie ...
    $_COOKIE['JOSSO_SESSIONID'] = '';
    forceRedirect($logoutUrl);
}
Example #9
0
//var_dump($MyModules);
$id = 0;
$message = '';
$data['module_Title'] = 'Category';
$data['message'] = '';
$obj = new NewsType();
$allowed_module = array('About');
if (isset($_GET['_Id'])) {
    $id = $_GET['_Id'];
    $data['_data'] = $obj->getByID($id);
    if (!in_array($data['_data'][$obj->getPrefix() . 'module'], $allowed_module)) {
        //$data['_data'][$obj->getPrefix().'module']!='about'&&$data['_data'][$obj->getPrefix().'module']!='syllabus')
        return;
    }
} else {
    forceRedirect(ADMIN_URL);
    return;
    //$data['_data'] = $obj->get('', $obj->getPrefix().'uin' . ' desc');
    //$data['list_fields'] = $obj->getListField();
}
//$data['_extraModule'] = array(array('Commitments', 'Commit&action=Commitlist'));
$data['prefix'] = $obj->getPrefix();
$field_list = array('detail');
$_data = $obj->getByID($id);
//$data['obj']=$obj;
$data['lists'] = $obj->getListField();
$upload_dir = UPLOADS_DIR . $obj->getUploadURL();
$data['upload_dir'] = $upload_dir;
$data['uploadUrl'] = '../uploads/' . $obj->getUploadURL();
/* * *************** END of these fields are required *********************************** */
/**
            $objMsg->set("Posts for " . $data['module_Title'] . " Added Successfully");
        } else {
            $objMsg->set("Posts for " . $data['module_Title'] . " Not Added !", 1);
        }
        #$_resource=$obj->getByID($_POST[$_id]);
        #$_data=$obj->Fetch($_resource);
    }
    $strqry = '';
    foreach ($_GET as $k => $gets) {
        //echo $gets;
        if ($k != 'deletefile') {
            $strqry .= $k . '=' . $gets . '&';
        }
    }
    //echo $strqry;die();
    forceRedirect('home.php?' . $strqry);
}
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'add') {
        $obj->resetFieldList($field_list);
        $_data = $obj->getFieldValues();
        $data['_data'] = $obj->getFieldValues();
        //var_dump($_data);
    }
    //var_dump($_data);
}
$showList = true;
if (isset($_POST['sub']) || getREQUEST('deletefile') || getREQUEST('delete')) {
    $showList = false;
}
//echo 'hellw';
Example #11
0
                }
            }
        } else {
            echo '<div class="headline1">New Password and Confirm Password doesnt match !</div>';
        }
    } elseif ($action == 'setting') {
        $db = new Setting();
        $result = $db->update(1, $_POST);
        if ($result) {
            $objMsg->set('Setting updated Successfully !');
        } else {
            $objMsg->set(' Setting not updated !!');
        }
    } else {
    }
    forceRedirect(getCurrentURL());
}
include_once ADMIN_TPL_MODULE . 'includes/message.php';
?>
  
<div class="top_bar">
    <a href="home.php?module=setting&action=setting"><img src="../css/img/settings.png" height="32px" width="32px"/>Site Setting</a>
    <a href="home.php?module=setting&action=addcontrol"><img src="../css/img/add.png" height="32px" width="32px"/>Add Site Admin</a>
    <a href="home.php?module=AdminChangePass"><img src="../css/img/changepass.png" height="32px" width="32px"/>Change Password</a>
    <!--
<a href="home.php?module=setting&action=logo"><img src="../css/img/edit.png" height="32px" width="32px"/>Change Logo</a>
-->
    <!--
<a href="home.php?module=page"><img src="../css/img/add.png" height="32px" width="32px"/>Add Page</a>
-->
</div>
Example #12
0
{
    if (isset($_SESSION['LOGIN_ID'])) {
        $strSQL = 'select * from us01users where us01username = "******"';
        //$strSQL = 'select * from controller where user = "******"';
        $strResult = $db->db->query($strSQL);
        //var_dump($arrResult);die();
        if ($strResult->rowCount() >= 1) {
            $GLOBALS['arrUserInfo'] = $strResult->fetchAll(PDO::FETCH_ASSOC);
            return true;
        }
    }
    return false;
}
$x = isLogged($myDb);
if ($x === false) {
    forceRedirect('index.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Admin Panel : <?php 
echo APP_NAME;
?>
</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<link  href="<?php 
echo BASE_URL;
?>
Example #13
0
if (isset($_GET['action'])) {
    $type = $_GET['action'];
    //echo $type;
    if ($type == NEWS_SCROLLING) {
        if ($scrolling) {
            $scrolling = 0;
        } else {
            $scrolling = 1;
        }
    } elseif ($type == NEWS_HIGHLIGHT) {
        if ($highlight) {
            $highlight = 0;
        } else {
            $highlight = 1;
        }
    }
    $db->setFieldValues('scrolling', $scrolling);
    $db->setFieldValues('highlight', $highlight);
    //$db->setFieldValues($prefix.'headline',$headline);
    $result = $db->update_core($id);
    //var_dump($result);die();
    if ($result == true) {
        $objMsg->set('Update Successfull');
        //echo '<script>alert("Update Successfull");</script>';
    } else {
        $objMsg->set('Update Not Successfull');
        //echo '<script>alert("Update Not Successfull");</script>';
    }
    forceRedirect('?module=News&Type=' . getREQUEST('Type'));
}
//redirect('?$module='.$_GET['module']);
Example #14
0
        }
        $db->setFieldValues('view', $view);
    } elseif ($type == ACCESS_ADD) {
        if ($add) {
            $add = 0;
        } else {
            $add = 1;
        }
        $db->setFieldValues('add', $add);
    } elseif ($type == ACCESS_DELETE) {
        if ($delete) {
            $delete = 0;
        } else {
            $delete = 1;
        }
        $db->setFieldValues('delete', $delete);
    }
    //var_dump($db);die();
    $result = $db->update_core($id);
    //die();
    //var_dump($result);
    if ($result) {
        $objMsg->set('Update Successfull');
        //echo '<script>alert("");</script>';
    } else {
        $objMsg->set('Update not Successfull');
    }
    forceRedirect('?module=userModule&_Id=' . getREQUEST('userId'));
    die;
}
//redirect('?$module='.$_GET['module']);