Advertisement
Guest User

Untitled

a guest
Oct 25th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.38 KB | None | 0 0
  1. <?php
  2. include 'include/settings.php';
  3. include'connection.php';
  4. if (!isset($_SESSION)) { session_start(); }
  5.  
  6. if (!isset($_SESSION['username'])) {
  7. echo '
  8. <script language="javascript">
  9. window.location.href = "login"
  10. </script>
  11. ';
  12. exit();
  13. }
  14.  
  15. $myLang = $_SESSION['lang'];
  16. include_once('include/lang/' . $myLang . '.php');
  17.  
  18. $site = mysqli_query($con, "SELECT * FROM `settings`") or die(mysqli_error($con));
  19. while($row = mysqli_fetch_array($site)){
  20. $website = $row['website'];
  21. $favicon = $row['favicon'];
  22. }
  23. $username= htmlspecialchars($_SESSION['username']);
  24. $idd = $_SESSION['id'];
  25. $rankk = $_SESSION['rank'];
  26. $email = $_SESSION['email'];
  27.  
  28. if(isset($_POST['password']) && isset($_POST['password_conf']) && isset($_POST['curr_password'])){
  29. $password = mysqli_real_escape_string($con, $_POST['password']);//password
  30. $pass_conf = mysqli_real_escape_string($con, $_POST['password_conf']);
  31. $curr_password = mysqli_real_escape_string($con, $_POST['curr_password']);
  32. $id = $_SESSION['id'];
  33. $result1 = mysqli_query($con, "SELECT * FROM `users` WHERE `username` = '$username'") or die(mysqli_error($con));
  34. $row10 = mysqli_fetch_array($result1);
  35. $pass_curr = $row10['password']; //pass
  36.  
  37.  
  38. if(!(password_verify($curr_password, $pass_curr))){
  39.  
  40. $settings = "current";
  41.  
  42. }else{
  43.  
  44. if($password != $pass_conf){
  45.  
  46. $settings = "passconf";
  47.  
  48. }else{
  49.  
  50. $passs = password_hash($password, PASSWORD_BCRYPT);
  51.  
  52. mysqli_query($con,"UPDATE `users` SET `password` = '$passs' WHERE `id` = '$id'") or die(mysqli_error($con));
  53.  
  54. $_SESSION['password'] = $password;
  55.  
  56. echo'
  57. <script language="JAVASCRIPT">
  58. window.location.href = "lib/logout"
  59. </script>
  60. ';
  61. die();
  62.  
  63. }
  64.  
  65. }
  66.  
  67. }
  68.  
  69. $log = mysqli_query($con, "SELECT * FROM `ip` WHERE `username` = '$username' ORDER BY datetime DESC") or die(mysqli_error($con));
  70. while ($row200 = mysqli_fetch_array($log)) {
  71. $username = $row200['username'];
  72. $ip = $row200['ip'];
  73. $date = $row200['datetime'];
  74. }
  75. ?>
  76.  
  77. <!DOCTYPE html>
  78. <html lang="en">
  79. <head>
  80. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  81.  
  82. <meta charset="utf-8">
  83. <meta name="viewport" content="width=device-width, initial-scale=1" />
  84. <meta name="description" content="<?php echo $website ?>" />
  85. <meta name="author" content="" />
  86.  
  87. <link rel="icon" href="<?php echo $favicon ?>">
  88.  
  89. <title><?php echo $website ?> | <?php echo $lang['settings']; ?></title>
  90.  
  91. <link rel="stylesheet" href="assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css">
  92. <link rel="stylesheet" href="assets/css/font-icons/entypo/css/entypo.css">
  93. <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic">
  94. <link rel="stylesheet" href="assets/css/bootstrap.css">
  95. <link rel="stylesheet" href="assets/css/neon-core.css">
  96. <link rel="stylesheet" href="assets/css/neon-theme.css">
  97. <link rel="stylesheet" href="assets/css/neon-forms.css">
  98. <link rel="stylesheet" href="assets/css/custom.css">
  99.  
  100. <?php
  101. if($_SESSION['skin'] == "blue"){ echo'
  102. <link rel="stylesheet" href="assets/css/skins/blue.css">';
  103. }elseif($_SESSION['skin'] == "black"){ echo'
  104. <link rel="stylesheet" href="assets/css/skins/black.css">';
  105. }elseif($_SESSION['skin'] == "white"){ echo'
  106. <link rel="stylesheet" href="assets/css/skins/white.css">';
  107. }elseif($_SESSION['skin'] == "purple"){ echo'
  108. <link rel="stylesheet" href="assets/css/skins/purple.css">';
  109. }elseif($_SESSION['skin'] == "cafe"){ echo'
  110. <link rel="stylesheet" href="assets/css/skins/cafe.css">';
  111. }elseif($_SESSION['skin'] == "red"){ echo'
  112. <link rel="stylesheet" href="assets/css/skins/red.css">';
  113. }elseif($_SESSION['skin'] == "green"){ echo'
  114. <link rel="stylesheet" href="assets/css/skins/green.css">';
  115. }elseif($_SESSION['skin'] == "yellow"){ echo'
  116. <link rel="stylesheet" href="assets/css/skins/yellow.css">';
  117. }elseif($_SESSION['skin'] == "blue"){ echo'
  118. <link rel="stylesheet" href="assets/css/skins/blue.css">';
  119. }elseif($_SESSION['skin'] == "facebook"){ echo'
  120. <link rel="stylesheet" href="assets/css/skins/facebook.css">';
  121. }
  122. ?>
  123.  
  124.  
  125.  
  126.  
  127. <script src="assets/js/jquery-1.11.3.min.js"></script>
  128.  
  129. <!--[if lt IE 9]><script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
  130.  
  131. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  132. <!--[if lt IE 9]>
  133. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  134. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  135. <![endif]-->
  136.  
  137.  
  138. </head>
  139. <style type="text/css">
  140. .login-error h3{
  141. background: #b62020;
  142. padding: 10px;
  143. margin: auto;
  144. width: 320px;
  145. font-size: 12px;
  146. -webkit-border-radius: 3px 3px 0 0;
  147. -webkit-background-clip: padding-box;
  148. -moz-border-radius: 3px 3px 0 0;
  149. -moz-background-clip: padding;
  150. border-radius: 3px 3px 0 0;
  151. background-clip: padding-box;
  152. color: white;
  153. text-align: center;
  154. font-size: 1.0em;
  155.  
  156. }
  157. .login-error p{
  158. background: #cc2424;
  159. padding: 20px;
  160. margin: auto;
  161. width: 320px;
  162. margin-bottom: 20px;
  163. font-size: 12px;
  164. -webkit-border-radius: 3px 3px 0 0;
  165. -webkit-background-clip: padding-box;
  166. -moz-border-radius: 3px 3px 0 0;
  167. -moz-background-clip: padding;
  168. border-radius: 0px 0px 5px 5px;
  169. background-clip: padding-box;
  170. text-align: center;
  171. color: white;
  172. margin-
  173. }
  174. </style>
  175. <script>
  176.  
  177. function showw(){
  178.  
  179. $("#error-<?php echo $settings?>").css("display", "block");
  180.  
  181. }
  182.  
  183. </script>
  184. <body onload="showw();" class="page-body <?php echo $_SESSION['skin']; ?>" data-url="http://neon.dev">
  185.  
  186. <?php include 'include/header.php'; ?>
  187.  
  188. <hr />
  189. <h1 class="margin-bottom"><?php echo $lang['settings']; ?></h1>
  190. <ol class="breadcrumb 2" >
  191. <li>
  192. <a href="index"><i class="fa-home"></i><?php echo $lang['home']; ?></a>
  193. </li>
  194. <li class="active">
  195.  
  196. <strong><?php echo $lang['settings']; ?></strong>
  197. </li>
  198. </ol>
  199.  
  200. <br />
  201.  
  202.  
  203. <form method="post" class="form-horizontal form-groups-bordered validate" action="settings">
  204.  
  205. <div class="row">
  206. <div class="col-md-12">
  207.  
  208. <div class="panel panel-primary" data-collapsed="0">
  209.  
  210. <div class="panel-heading">
  211. <div class="panel-title">
  212. <?php echo $lang['general_settings']; ?>
  213. </div>
  214.  
  215. <div class="panel-options">
  216. <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
  217. <a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a>
  218. </div>
  219. </div>
  220.  
  221. <div id="error-passconf" class="login-error" style="display:none;"></br>
  222. <h3> <?php echo $lang['error']; ?> </h3>
  223. <p> <?php echo $lang['passwords_are_not_same']; ?> ! </p>
  224. </div>
  225. <div id="error-current" class="login-error" style="display:none;"></br>
  226. <h3> <?php echo $lang['error']; ?> </h3>
  227. <p> <?php echo $lang['your_current_password_is_not_this']; ?> ! </p>
  228. </div>
  229.  
  230.  
  231.  
  232.  
  233. <div class="panel-body">
  234. <div class="form-group">
  235. <label for="field-1" class="col-sm-3 control-label"><?php echo $lang['username']; ?></label>
  236.  
  237. <div class="col-sm-5">
  238. <input type="text" class="form-control" id="field-1" value="<?php echo $username?>" readonly>
  239. <span class="description"><?php echo $lang['you_can_not_modify_your_username']; ?>.</span>
  240. </div>
  241. </div>
  242.  
  243. <div class="form-group">
  244. <label for="field-2" class="col-sm-3 control-label"><?php echo $lang['email']; ?></label>
  245.  
  246. <div class="col-sm-5">
  247. <input type="text" class="form-control" id="field-2" value="<?php echo $email ?>" readonly>
  248. <span class="description"><?php echo $lang['you_can_not_modify_your_email']; ?>.</span>
  249. </div>
  250. </div>
  251. <hr />
  252. <div class="form-group">
  253. <label for="field-3" class="col-sm-3 control-label"><?php echo $lang['curr_pass']; ?></label>
  254.  
  255. <div class="col-sm-5">
  256. <input type="password" class="form-control" name="curr_password" id="field-3" required>
  257. </div>
  258. </div>
  259.  
  260. <div class="form-group">
  261. <label for="field-4" class="col-sm-3 control-label"><?php echo $lang['new_pass']; ?></label>
  262.  
  263. <div class="col-sm-5">
  264. <input type="password" class="form-control" name="password" id="field-4" required>
  265. </div>
  266. </div>
  267.  
  268. <div class="form-group">
  269. <label for="field-4" class="col-sm-3 control-label"><?php echo $lang['conf_pass']; ?></label>
  270.  
  271. <div class="col-sm-5">
  272. <input type="password" class="form-control" name="password_conf" id="field-4" required>
  273. </div>
  274. </div>
  275.  
  276. </div>
  277.  
  278. </div>
  279. <center> <div class="form-group default-padding col-md-12">
  280. <button type="submit" class="btn btn-success"><?php echo $lang['save_changes']; ?></button>
  281. <button type="reset" class="btn"><?php echo $lang['reset_previous']; ?></button>
  282. </div></center>
  283. </form>
  284. </div>
  285. </div>
  286.  
  287. <div class="row">
  288. <div class="col-md-12">
  289.  
  290. <div class="panel panel-primary" data-collapsed="0">
  291.  
  292. <div class="panel-heading">
  293. <div class="panel-title">
  294. <?php echo $lang['connection_log']; ?>
  295. </div>
  296. </div>
  297.  
  298. </div>
  299.  
  300. </div>
  301. <script type="text/javascript">
  302. jQuery( document ).ready( function( $ ) {
  303. var $table3 = jQuery("#table-3");
  304.  
  305. var table3 = $table3.DataTable( {
  306. "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
  307. } );
  308.  
  309. // Initalize Select Dropdown after DataTables is created
  310. $table3.closest( '.dataTables_wrapper' ).find( 'select' ).select2( {
  311. minimumResultsForSearch: -1
  312. });
  313.  
  314. // Setup - add a text input to each footer cell
  315. $( '#table-3 tfoot th' ).each( function () {
  316. var title = $('#table-3 thead th').eq( $(this).index() ).text();
  317. $(this).html( '<input type="text" class="form-control" placeholder="<?php echo $lang['search']; ?> ' + title + '" />' );
  318. } );
  319.  
  320. // Apply the search
  321. table3.columns().every( function () {
  322. var that = this;
  323.  
  324. $( 'input', this.footer() ).on( 'keyup change', function () {
  325. if ( that.search() !== this.value ) {
  326. that
  327. .search( this.value )
  328. .draw();
  329. }
  330. } );
  331. } );
  332. } );
  333. </script>
  334.  
  335. <div class="col-md-13">
  336.  
  337.  
  338.  
  339. <div class="panel-body">
  340. <table class="table table-bordered datatable" id="table-3">
  341. <thead>
  342. <tr class="replace-inputs">
  343. <th>IP</th>
  344. <th>Date</th>
  345. <th>OS</th>
  346. </tr>
  347. </thead>
  348. <tbody>
  349. <?php $log = mysqli_query($con, "SELECT * FROM `ip` WHERE `username` = '$username' ORDER BY `datetime` DESC") or die(mysqli_error($con));
  350. while ($row200 = mysqli_fetch_array($log)) {
  351. $username = $row200['username'];
  352. $ip = $row200['ip'];
  353. $date = $row200['datetime'];
  354. $os = $row200['os'];
  355. echo'
  356. <tr class="odd gradeX">
  357. <td>'.$ip.'</td>
  358. <td>'.$date.'</td>
  359. <td class="center">Connected with '.$os.'</td>
  360. </tr>'; }?>
  361. </tbody>
  362. <tfoot>
  363. <tr>
  364. <th>IP</th>
  365. <th>Date</th>
  366. <th>OS</th>
  367. </tr>
  368. </tfoot>
  369. </table>
  370. </div>
  371.  
  372. </div>
  373. </div>
  374.  
  375. </br>
  376. <!-- Footer -->
  377. <?php include 'include/footer.php'; ?>
  378. </div>
  379.  
  380.  
  381.  
  382.  
  383. <!-- Chat Histories -->
  384.  
  385. </div>
  386. <script language="JAVASCRIPT">
  387. window.onload = showw();
  388. </script>
  389. <link rel="stylesheet" href="assets/js/datatables/datatables.css">
  390. <link rel="stylesheet" href="assets/js/select2/select2-bootstrap.css">
  391. <link rel="stylesheet" href="assets/js/select2/select2.css">
  392. <script src="assets/js/datatables/datatables.js"></script>
  393. <script src="assets/js/select2/select2.min.js"></script>
  394. <!-- Bottom scripts (common) -->
  395. <script src="assets/js/gsap/TweenMax.min.js"></script>
  396. <script src="assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js"></script>
  397. <script src="assets/js/bootstrap.js"></script>
  398. <script src="assets/js/joinable.js"></script>
  399. <script src="assets/js/resizeable.js"></script>
  400. <script src="assets/js/neon-api.js"></script>
  401.  
  402.  
  403.  
  404. <!-- JavaScripts initializations and stuff -->
  405. <script src="assets/js/neon-custom.js"></script>
  406.  
  407.  
  408. <!-- Demo Settings -->
  409. <script src="assets/js/neon-demo.js"></script>
  410.  
  411. </body>
  412. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement