public function CrossCheck($module) { if ($this->userDetails['us01us00uin'] > 99) { return array(true, 1, 1, 1); } $result_1 = array(false, 0, 0, 0); $doubleCheck = array('users', 'userModule', 'Report'); $excludeModules = array(UNAUTHORIZED, 'AdminChangePass', 'Commit'); if (in_array($module, $excludeModules)) { return array(true, 1, 0, 0); } if (in_array($module, $doubleCheck)) { $row_user = $this->objUser->getByID(getREQUEST('_Id')); //var_dump($row_user); if ($row_user['us01us00uin'] > $this->userDetails['us01us00uin']) { return array(false, 0, 0, 0); } //var_dump($row_user);die(); } //echo $this->userDetails['us01rights']; if ($this->userDetails['us01us00uin'] > 99) { return array(true, 1, 1, 1); } else { foreach ($this->Rights as $row) { //var_dump($row); $result = array(false, 0, 0, 0); if (in_array($module, $row) && $row['us02us01uin'] == $this->userDetails['us01uin']) { //var_dump($row); $result[0] = true; $result[ACCESS_VIEW] = $row['us02view']; $result[ACCESS_ADD] = $row['us02add']; $result[ACCESS_DELETE] = $row['us02delete']; $result_1 = $result; } } } //var_dump($result_1); //die(); return $result_1; }
<?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);
} else { echo 'deactivate'; } ?> .png" height="16px" width="16"> </a></td> <td><a href="home.php?module=changeAccess&action=<?php echo ACCESS_DELETE; ?> &_Id=<?php if (isset($row['us02uin'])) { echo $row['us02uin']; } else { echo '0' . '&mod_id=' . $row['set02uin']; } echo '&userId=' . getREQUEST('_Id'); ?> "> <img src="../img/<?php if (isset($row['us02delete']) && $row['us02delete']) { echo 'conduct'; } else { echo 'deactivate'; } ?> .png" height="16px" width="16"> </a></td> </tr> <?php $ct++;
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $data['module_Title'] = 'Monitor ' . getREQUEST('_Id'); echo defaultAdminModule($strModuleName, $data);
</td> <td> <input type="file" id="file" name="<?php echo 'file'; ?> "/> <?php if ($_data[$prefix . 'file']) { ?> <img style="width: 150px;" src="<?php echo $uploadUrl . $_data[$prefix . 'file']; ?> "> <a href="<?php echo curPageURL(); if (getREQUEST('deletefile') == '') { echo '&deletefile=1'; } ?> ">Delete File</a> <?php } ?> </td> </tr> <tr> <td> <label> </label> </td>
echo 'conduct'; } else { echo 'deactivate'; } ?> .png" height="16px" width="16"> </a> </td> <td class="center"><a href="home.php?module=<?php echo $_GET['module']; ?> &action=edit&_Id=<?php echo $row[$prefix . 'uin']; if (getREQUEST('Type')) { echo '&Type=' . getREQUEST('Type'); } ?> "> <img height="16px" width="16" src="../css/img/edit.png"></a> | <a onclick="delData(this.id,'<?php echo $strqry; ?> ')" href="#" id="<?php echo $_GET['module'] . '|' . $row[$prefix . 'uin']; ?> "> <img height="16px" width="16" src="../css/img/delete.png"></a></td> <?php $ct++;
#$_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'; //$data['message']=$message; if ($showList) { echo LoadDefaultAdminModule_v2($strModuleName, $data); }
} $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']);
?> <li class="<?php echo $active; ?> "> <?php echo '<a href="home.php?module=Users">'; ?> <img src="../css/img/user.png"/> <?php echo 'Users'; ?> </a> </li> <?php if (getREQUEST('module') == 'Password_enc') { $active = 'active'; } else { $active = ''; } ?> <li class="<?php echo $active; ?> "> <?php echo '<a href="home.php?module=Password_enc">'; ?> <img src="../css/img/user.png"/> <?php echo 'Password Encryptor';
<?php require_once 'system/config.php'; if (!(getREQUEST('module') && getREQUEST('file_name'))) { echo 'no module or type or filepath'; //forceRedirect(BASE_URL); die; } $path = getREQUEST('module'); $file = getREQUEST('file_name'); $allowed_type = array('doc', 'docx', 'pdf'); if (in_array($Type, $allowed_type)) { Force_Downlaod($path, $file, 'Notice'); die; } forceRedirect(BASE_URL);
/** * Function to get value from get/post method in a recursive way along with array_walk * */ function getRequestVal(&$item, $key) { $item = getREQUEST($key); }
if (!$upload_result[0]) { $message = $upload_result[1]; } else { if ($upload_result[1] != $_data[$prefix . 'file']) { $obj->setFieldValues_v2("file", $upload_result[1]); $id = $obj->update($_POST['uin']); } } } if ($id) { //$data['_data']=$obj->getByID_v2($_POST[$_id]); $message = "Update Completed Successfully"; } else { $message = "Data not Updated"; } $_resource = $obj->getByID_v2(getREQUEST('uin')); $_data = $obj->Fetch($_resource); $data['_data'] = $_data; //var_dump($_data); } elseif ($_GET['action'] == 'add') { $id = $obj->insert(); if ($id > 0) { if (isset($_FILES['file'])) { //echo 'uploading file'; $upload_result = AR_UploadImage('file', $upload_dir, array(960, 960), $prefix, '', '', '', 1); //var_dump($upload_result); if (!$upload_result[0]) { $message = $upload_result[1]; } else { if ($upload_result[1] != $_data[$prefix . 'file']) { $obj->setFieldValues_v2("file", $upload_result[1]);
<?php /***************** these fields are required ************************************/ //die(); //var_dump($MyModules); $id = 0; $Type = getREQUEST('Type'); $message = ''; $data['message'] = ''; if (!$Type) { forceRedirect('home.php'); } $obj = new News(); $objCat = new NewsType(); $newsType = $objCat->getById($Type); $data['module_Title'] = $newsType['news01title']; if (isset($_GET['_Id'])) { $id = $_GET['_Id']; $data['_data'] = $obj->getByID($id); } else { $data['_data'] = $obj->get(array('news01uin' => $Type)); $data['list_fields'] = $obj->getListField(); } //$data['_extraModule'] = array(array('Commitments', 'Commit&action=Commitlist')); $data['prefix'] = $obj->getPrefix(); $field_list = $obj->getUpdateFields(); $_data = $obj->getByID($id); //$data['obj']=$obj; $data['lists'] = $obj->getListField(); $upload_dir = UPLOADS_DIR . $obj->getUploadURL(); $data['upload_dir'] = $upload_dir;
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']);
<?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);
//die(); if (!$CrossResult[ACCESS_VIEW]) { //var_dump(getREQUEST('action')); //if() $strModule = UNAUTHORIZED; if (getREQUEST('action') == '') { $strModule = UNAUTHORIZED; } } $action = getREQUEST('action'); if (!$CrossResult[ACCESS_ADD]) { if ($action == 'add' || $action == 'edit') { $strModule = UNAUTHORIZED; } } if (getREQUEST('delete') == 1) { if (!$CrossResult[ACCESS_DELETE]) { $strModule = UNAUTHORIZED; } } } } //var_dump($objMsg); if (isset($_GET['logout'])) { unset($_SESSION['LOGIN_ID']); forceRedirect('index.php'); } //var_dump($data); function isLogged($db) { if (isset($_SESSION['LOGIN_ID'])) {
$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'); } //var_dump($arrUserInfo);die(); //$arrUserInfo = mysql_fetch_assoc( $strResult ); } else { $objMsg->set('Login failed !!!', 1);
//getSiteLink('',''); if (!isset($_SESSION['page_id'])) { $_SESSION['page_id'] = 1; } if ($_GET) { //var_dump($_GET); } else { $_SESSION['page_id'] = 1; } if (!isset($_SESSION['lang_type'])) { $_SESSION['lang_type'] = ''; } #FrontEnd Modules and their templates. If no template is defined default template is taken. It can be referred as Controllers of Joomla $arrFrontModules = array('Contact', 'Pages'); $arrFrontTemplate = array('Home' => 'mainTemplate.inc', 'Contact' => 'mainTemplate.inc', 'Pages' => 'pagesTemplate.inc'); //var_dump($_GET); $strModule = getREQUEST('module'); // // if (!in_array($strModule, $arrFrontModules)) { $strModule = 'Home'; } //echo $strModule;die(); $strTemplate = array_key_exists($strModule, $arrFrontTemplate) ? $arrFrontTemplate[$strModule] : $arrFrontTemplate['Home']; //echo $strTemplate;die(); ob_start(); include TPL . $strTemplate; //echo $strModule;die(); $strContent = ob_get_contents(); ob_end_clean(); echo $strContent;