403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/hkosl.com/littleark/webadmin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/littleark/webadmin//sys_cms_user_modify.php
<?php
	$page_settings = array(
		'formid'     => 'Sys_cms_user', // for permission
		'section'    => 'System Setting', // parent/page title
		'subsection' => 'User Management', // page title
		'domain'     => 'sys_cms_user', // table/model name
		'access'     => 'GNu', // for permission
	);

	require_once "check_login.php";
	require_once 'function_auth.php';

	// error_reporting(E_ALL);
	// ini_set('display_errors', 1);

	$cmsloginid    = (int)$_POST["cmsloginid"];
	$cms_user_info = SysCmsLogin::where('cmsloginid', '=', $_SESSION["cmsloginid"])->first();

	$message = "";

	if (empty($_POST["username"])) {
		$message .= _lang("Please enter User Name.") . "\\n\\n";
	}

	$supplier_id = 0;
	$agent_id = 0;
	if ($cms_user_info["cmsrole"] != "user") {

		if ($cms_user_info["is_platform"] == 1) {

			if (empty($_POST["role_type"])) {
				$message .= _lang("Please select Role Type.") . "\\n\\n";
			} else {
				if ($_POST["role_type"] == "SUPPLIER") {
					$is_platform = 0;
					$is_supplier = 1;
					$is_agent    = 0;
					if (empty($_POST["supplier_id"])) {
						$message .= _lang("Please select Supplier.") . "\\n\\n";
					}

					$supplier_id = $_POST["supplier_id"];
				} else if ($_POST["role_type"] == "PLATFORM") {
					$is_platform = 1;
					$is_supplier = 0;
					$is_agent    = 0;
					$supplier_id = 0;
				} else if ($_POST["role_type"] == "AGENT") {
					$is_platform = 0;
					$is_supplier = 0;
					$is_agent    = 1;
					if (empty($_POST["agent_id"])) {
						$message .= _lang("Please select Agent.") . "\\n\\n";
					}
					$agent_id    = $_POST["agent_id"];
				}
			}
		}

	}

	if (empty($_POST["loginname"])) {
		$message .= _lang("Please enter Login Name.") . "\\n\\n";
	}

	if (!empty($message)) {
		echo "<script>alert('" . $message . "'); history.back();</script>";
		exit;
	}


	if (strlen($_POST["loginpw"]) > 0) {
		$strength = Password::strength($_POST["loginpw"], $_POST["username"]);
		if (!$strength) {
			exit(_lang('Insufficient password strength'));
		}
		$cmsloginpw = Password::hash($_POST["loginpw"]);

	}
	$nowdate = date("Y-m-d H:i:s");

	$sql        = "SELECT * FROM sys_cms_login where cmsloginname = ? AND cmsloginid <> ? and deleted = ?";
	$parameters = array($_POST["loginname"], $_POST["cmsloginid"], 0);
	$result     = bind_pdo($sql, $parameters, "selectone");
	if (!empty($result)) {
		header("Location: sys_cms_user_index.php?msg=" . _lang("You have already been assigned a login name."));
		exit;
	}

	// Modify

	if (strlen($_POST["loginpw"]) > 0) {
		if ($cms_user_info["cmsrole"] == "user" || $cms_user_info["is_platform"] == 0) {
			$sql        = "update sys_cms_login set cmsusername=?, cmsloginname=?, cmsrole=?, lastupdate=?, lastupby=?, cmsloginpw=? where cmsloginid=?";
			$parameters = array($_POST["username"], $_POST["loginname"], $_POST["role_level"], $nowdate, $_SESSION["cmsloginid"], $cmsloginpw, $_POST["cmsloginid"]);
			bind_pdo($sql, $parameters);
		} else {
			$sql        = "update sys_cms_login set cmsusername=?, cmsloginname=?, cmsrole=?, lastupdate=?, lastupby=?, cmsloginpw=?, is_platform=?, is_supplier=?, supplier_id=?, is_agent=?, agent_id=? where cmsloginid=?";
			$parameters = array($_POST["username"], $_POST["loginname"], $_POST["role_level"], $nowdate, $_SESSION["cmsloginid"], $cmsloginpw, $is_platform, $is_supplier, $supplier_id, $is_agent, $agent_id, $_POST["cmsloginid"]);
			bind_pdo($sql, $parameters);
		}


		unset($_SESSION['loginname']);
		unset($_SESSION['password']);
		unset($_SESSION['loginid']);
		unset($_SESSION['cmsloginid']);
		unset($_SESSION['role']);
		unset($_SESSION['cmsrole']);

		header("Location: sys_cms_user_index.php?msg=2");

		/*header("Location: login.php");
		exit;*/

	} else {
		if ($cms_user_info["cmsrole"] == "user" || $cms_user_info["is_platform"] == 0) {
			$sql        = "update sys_cms_login set cmsusername=?, cmsloginname=?, cmsrole=?, lastupdate=?, lastupby=? where cmsloginid=?";
			$parameters = array($_POST["username"], $_POST["loginname"], $_POST["role_level"], $nowdate, $_SESSION["cmsloginid"], $_POST["cmsloginid"]);
			bind_pdo($sql, $parameters);
		} else {
			$sql        = "update sys_cms_login set cmsusername=?, cmsloginname=?, cmsrole=?, lastupdate=?, lastupby=?,is_platform=?, is_supplier=?, supplier_id=?, is_agent=?, agent_id=? where cmsloginid=?";
			$parameters = array($_POST["username"], $_POST["loginname"], $_POST["role_level"], $nowdate, $_SESSION["cmsloginid"], $is_platform, $is_supplier, $supplier_id, $is_agent, $agent_id, $_POST["cmsloginid"]);
			bind_pdo($sql, $parameters);
		}

		header("Location: sys_cms_user_index.php?msg=2");
	}

Youez - 2016 - github.com/yon3zu
LinuXploit