shell bypass 403
UnknownSec Shell
:
/
home
/
delvin
/
dev.delv-in.com
/
models
/ [
drwxr-xr-x
]
upload
mass deface
mass delete
console
info server
name :
m_guide_content.php
<?php class Guide_Content { private $Database; private $db_table = 'guide_content'; function __construct(){ global $Database; $this->Database = $Database; } public function get($guideContID, $menuID, $words){ $data = array(); if ($guideContID > 0) { if ($stmt = $this->Database->prepare("SELECT * FROM `" . $this->db_table ."` WHERE `guideContID` = ?")){ $stmt->bind_param('i', $guideContID); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($guideContID, $menuID, $words, $image, $img_width, $img_align, $img_pos, $caption, $rank); $stmt->fetch(); if ($stmt->num_rows > 0){ $data = array('guideContID'=>$guideContID, 'menuID'=>$menuID, 'words'=>$words, 'image'=>$image, 'img_width'=>$img_width, 'img_align'=>$img_align, 'img_pos'=>$img_pos, 'caption'=>$caption, 'rank'=>$rank); } return $data; $stmt->close(); } } else if ($menuID > 0){ $query = "SELECT * FROM " . $this->db_table ." WHERE menuID = '" . $menuID ."' ORDER BY rank"; // echo __LINE__.": " . $query . "</br>"; if ($stmt = $this->Database->prepare("SELECT * FROM `" . $this->db_table ."` WHERE `menuID` = ? ORDER BY `rank`")){ $stmt->bind_param('i', $menuID); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($guideContID, $menuID, $words, $image, $img_width, $img_align, $img_pos, $caption, $rank); while ($stmt->fetch()){ $data[] = array('guideContID'=>$guideContID, 'menuID'=>$menuID, 'words'=>$words, 'image'=>$image, 'img_width'=>$img_width, 'img_align'=>$img_align, 'img_pos'=>$img_pos, 'caption'=>$caption, 'rank'=>$rank); } return $data; $stmt->close(); } } else if (strlen($words) > 2){ $words = "%".$words."%"; if ($stmt = $this->Database->prepare("SELECT * FROM `" . $this->db_table . "` WHERE `words` LIKE ? ORDER BY `rank`")){ $stmt->bind_param('s', $words); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($guideContID, $menuID, $words, $image, $img_width, $img_align, $img_pos, $caption, $rank); while ($stmt->fetch()){ $data[$menuID] = array('guideContID'=>$guideContID, 'menuID'=>$menuID, 'words'=>$words, 'image'=>$image, 'img_width'=>$img_width, 'img_align'=>$img_align, 'img_pos'=>$img_pos, 'caption'=>$caption, 'rank'=>$rank); } return $data; $stmt->close(); } } } public function add_mod($guideContID, $menuID, $words, $xImage, $img_width, $img_align, $img_pos, $caption, $rank){ $Template = new Template; if ($guideContID <= 0) { $image = ''; if ($_FILES['image']['name'] != ''){ $image = $_FILES['image']['name']; } if ($stmt = $this->Database->prepare("INSERT INTO " . $this->db_table ." (menuID, words, image, img_width, img_align, img_pos, caption, rank) VALUES (?,?,?,?,?,?,?,?)")){ $stmt->bind_param('ississsi', $menuID, $words, $image, $img_width, $img_align, $img_pos, $caption, $rank); if ($stmt->execute()){ $guideContID = $this->Database->insert_id; $uploaddir = 'views/guide/'.$guideContID; if (!file_exists($uploaddir)){ mkdir($uploaddir); } if ($_FILES['image']['name'] != ''){ if (move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir . "/".$_FILES['image']['name'])){ $alert2 = " and image file uploaded."; } } $alert = 'Content added ' . $alert2; $Template->set_alert($alert, 'success'); } else { $Template->set_alert('ERROR: Content was not added.', 'error'); } } } else { if ($_FILES['image']['name'] != ''){ $image = $_FILES['image']['name']; $uploaddir = 'views/guide/'.$guideContID; if (!file_exists($uploaddir)){ mkdir($uploaddir); } if (move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir . "/".$_FILES['image']['name'])){ $alert2 = " and image file uploaded."; } } else if (isset($_POST['del_image'])){ $image = ''; } else { $image = $xImage; } if ($stmt = $this->Database->prepare("UPDATE " . $this->db_table ." SET menuID=?, words=?, image=?, img_width=?, img_align=?, img_pos=?, caption=? WHERE guideContID = ?")){ $stmt->bind_param('ississsi', $menuID, $words, $image, $img_width, $img_align, $img_pos, $caption, $guideContID); if ($stmt->execute()){ $alert = 'Changes saved ' . $alert2; $Template->set_alert($alert, 'success'); } else { $Template->set_alert('ERROR: Content was not saved.', 'error'); } } } } public function update_rank($menuID, $guideContID, $rank, $oldRank){ $Template = new Template; // echo __line__.": menuID=" . $menuID .", guideContID=" . $guideContID .", rank =".$rank.", oldRank=".$oldRank."<br>"; $increment = 1; if ($rank <= 0){ // a menu item has been deleted. $query = "UPDATE ". $this->db_table . " SET rank = rank-1 WHERE rank > '".$oldRank."' and menuID = '".$menuID."'"; // echo __line__.": ".$query."<br>"; if ($stmt = $this->Database->prepare('UPDATE ' . $this->db_table . " SET rank = rank-? WHERE rank > ? and menuID = ?")){ $stmt->bind_param('iii', $increment, $oldRank, $menuID); $stmt->execute(); $stmt->close(); } } else if ($rank > $oldRank){ $this->decrement_rank($menuID, $rank, $oldRank); } else if ($rank < $oldRank){ $this->increment_rank($menuID, $rank, $oldRank); } if ($guideContID > 0){ $query = "UPDATE " . $this->db_table ." SET rank = '".$rank."' WHERE guideContID = '".$guideContID."'"; // echo __line__.": ".$query."<br>"; if ($stmt = $this->Database->prepare("UPDATE " . $this->db_table ." SET rank = ? WHERE guideContID = ?")){ $stmt->bind_param('ii', $rank, $guideContID); if ($stmt->execute()){ $Template->set_alert('Changes saved '.$query, 'success'); } else { $Template->set_alert('ERROR: Changes not saved', 'error'); } $stmt->close(); } } } public function decrement_rank($menuID, $rank, $oldRank){ $increment = 1; $Template = new Template; $query = 'UPDATE ' . $this->db_table . " SET rank = rank-1 WHERE rank > '".$oldRank."' and rank <= '".$rank."' and menuID = '".$menuID."'"; // echo __line__.": ".$query."<br>"; if ($stmt = $this->Database->prepare('UPDATE ' . $this->db_table . " SET rank = rank-? WHERE rank > ? and rank <= ? and menuID=?")){ $stmt->bind_param('iiii', $increment, $oldRank, $rank, $menuID); $stmt->execute(); // $Template->set_alert($query); $stmt->close(); } } public function increment_rank($menuID, $rank, $oldRank){ $increment = 1; $Template = new Template; $query = "UPDATE ". $this->db_table . " SET rank = rank + 1 WHERE rank < '".$oldRank."' and rank >= '".$rank."' and menuID='".$menuID."'"; // echo __line__.": ".$query."<br>"; if ($stmt = $this->Database->prepare('UPDATE ' . $this->db_table . " SET rank = rank+? WHERE rank < ? and rank >= ? and menuID=?")){ $stmt->bind_param('iiii', $increment, $oldRank, $rank, $menuID); $stmt->execute(); // $Template->set_alert($query); $stmt->close(); } } /** * * @access public * @param int * @return NULL */ public function delete($guideContID, $menuCrumbs, $rank){ $Template = new Template; if ($guideContID > 0){ if ($stmt = $this->Database->prepare("DELETE FROM ".$this->db_table." WHERE guideContID = ?")){ $stmt->bind_param('i', $guideContID); if ($stmt->execute()){ $this->update_rank($menuID, $guideContID, '', $rank); $Template->set_alert("Data deleted", "success"); } else { $Template->set_alert("ERROR: Delete failed", "error"); } $stmt->close(); } else { $Template->set_alert("ERROR: could not prepare SQL statement.".__LINE__."-m_guide_menu", "error"); } } } public function public_view($guideContID, $words, $image, $img_width, $img_align, $img_pos, $caption){ echo " <div class='col-12 top_line'>"; $size_arr = array(); if ($image != ''){ $size_arr = getimagesize("views/guide/". $guideContID ."/" . $image ); } $txt_width = 12 - $img_width; $img_width = round(($img_width / 12) * 100, 2); if ($img_pos == 'before' && $image != ''){ echo " <div class='guide_img_". $img_align."' style='max-width:". $size_arr[0]."px; width: ". $img_width."%'> <img src='views/guide/". $guideContID ."/" . $image ."' width=100%>"; if (strlen($caption) > 5){ echo " <div class='col-12 comment centre pad_4_b'>" . $caption ."</div>"; } echo " </div>"; } echo $words; if ($img_pos == 'after' && $image != ''){ echo " <div class='guide_img_". $img_align."' style='max-width:". $size_arr[0]."px; width: ". $img_width."%'> <img src='views/guide/". $guideContID ."/" . $image ."' width=100%>"; if (strlen($caption) > 5){ echo " <div class='col-12 comment centre pad_4_b'>" . $caption ."</div>"; } echo " </div>"; } echo " </div>"; } }
© 2026 UnknownSec