Example #1
0
	function exec($args, $stdin, &$stdout, &$stderr, &$system)
	{
		if (!isAdmin())
		{
			$stderr = ucf(i18n("not enough rights to delete user"));
			return true;
		}
		
		switch ($this->stage)
		{
			case 1:
				if (empty($args) || strtolower($args) == "y" || strtolower($args) == "yes")
				{
					$result = delUser($this->username);
					
					if ($result === true)
						$stdout = ucf(i18n("removed user successfully"));
					else
						$stdout = $result;
						
					$this->stage = 0;
					return true;
				}
				
				$stdout = ucf(i18n("aborted by user"));
				$this->stage = 0;
				return true;
		}
		
		if (empty($args))
		{
			$stdout = "Usage: udel [username]\n";
			$stdout .= "Example: udel admin";
			return true;
		}
		else
		{
			$this->username = $args;
			$stdout = ucf(i18n("are you sure you want to delete this user"))." (Y/n)?";
			$this->stage = 1;
		}
		
		return false;
	}
Example #2
0
function displayDelUser($config)
{
    if ($config->adminLvl >= 75) {
        $error = '';
        if (isset($_POST['removeBtn'])) {
            // Get user input
            $username = isset($_POST['user_to_Delete']) ? $_POST['user_to_Delete'] : '';
            $error = delUser($username);
        }
        if (isset($_POST['disableBtn'])) {
            // Get user input
            $username = isset($_POST['user_to_Delete']) ? $_POST['user_to_Delete'] : '';
            $userID = getUserID($config, $username);
            $error = disableUser($config, $userID);
        }
        if (!isset($_POST['submitBtn']) || $error != '') {
            ?>
            <a href="<?php 
            echo $_SERVER['PHP_SELF'];
            ?>
?usermenu=true">Back</a>
            <form action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
?DelUserBtn=true" method="post" name="delform">
                <table width="100%"><?php 
            echo '<tr><td align="center"><select name="user_to_Delete">';
            showAllUsers();
            echo '</select>';
            ?>
                </td></tr>
                <tr><td colspan="2" align="center"><input class="text" type="submit" name="removeBtn" value="Delete User" />
                    <input class="text" type="submit" name="disableBtn" value="Disable User" /></td></tr>
                </table>  
            </form>

        <?php 
        }
        if (isset($_POST['removeBtn']) || isset($_POST['disableBtn'])) {
            if (isset($_POST['disableBtn'])) {
                echo '<h2>Disable Results</h2>';
            } else {
                echo '<h2>Deletion result:</h2>';
            }
            ?>
        <div id="icon2">&nbsp;</div>
        <div id="result">
            <table width="100%"><tr><td><br/>
    <?php 
            echo $error;
            ?>
				<br/><br/><br/></td></tr>
			</table>
		</div>
    <?php 
        }
    }
}
Example #3
0
    if (!($fp = fopen('/etc/squid3/basic.passwd', 'w+'))) {
        print "Cannot open file (" . $fileName . ")";
        exit;
    }
    if ($fp) {
        foreach ($fileName as $line) {
            fwrite($fp, $line);
        }
        fclose($fp);
    }
}
// function for encrypting password
function htpasswd($pass)
{
    $pass = crypt(trim($pass), base64_encode(CRYPT_STD_DES));
    return $pass;
}
if (isset($_POST['changePass'])) {
    editUser($_POST['uname'], $_POST['pass']);
}
if (isset($_POST['delete'])) {
    delUser($_POST['uname']);
}
$out = "\n<html>\n<body>\n<table>\n";
$users = showUser();
foreach ($users as $user) {
    $out .= "\n\t<tr><td>" . $user['username'] . "</td><td>" . $user['password'] . "</td>\n\t<td>\n\t<form action=" . $_SERVER['PHP_SELF'] . " method=post name=delUserForm id=delUserForm>\n\t\t<input type=hidden name=uname value=" . $user['username'] . " />\n\t\t<input type=submit name=delete value=delete />\n\t</form>\n\t</td>\n\t</tr>\n";
}
$out .= "\n</table>\n<table>\n<form action=" . $_SERVER['PHP_SELF'] . " method=post name=squidUserForm id=squidUserForm>\n\t<tr><td>Username:</td><td align=left><input name=uname type=text size=20 /></td></tr>\n\t<tr><td>Password:</td><td align=left><input name=pass type=pass size=20 /></td></tr>\n\t<tr><td colspan=2><input type=submit name=changePass value=Change /></td></tr>\n</form>\n</table>\n";
$out .= "\n</body>\n</html>";
print $out;
Example #4
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', true);
include 'Config/functions.php';
include 'Config/static_config.php';
$user_id = $_GET['id'];
$user_id = (int) $user_id;
$message = " ";
if (delUser($user_id)) {
    $message = 'User has been sucsessfully removed!';
} else {
    $message = "Could not delete!";
}
$replacement_array = array('User deleting', '<div class="pageheading">
            <h3>' . $message . '</h3>
    </div>
    <div class="content-box">
        <h3>' . $message . '</h3>
    </div>
');
$replacement = output($replacement_array);
echo $replacement;
Example #5
0
<?php

include 'functions.php';
if (isset($_POST['mybutton1'])) {
    delUser();
} else {
    $getone = getUserData();
}
include 'header.php';
?>
<div class="page-header pool">
        <h1>Kasutaja</h1>
</div>
<a href="index.php" class="btn btn-info">View List</a>
<div class="row">
	<div class="col-md-6">
        <table class="table table-striped">
            <thead>
				<tr>
					<th>#</th>
					<th>Nimi</th>
					<th>Kasutaja</th>
					<th>E-mail</th>
					<th>Tel</th>
					<th>Sugu</th>
					<th>Pilt</th>
					<th>Muudetud</th>
					<th>Valikud</th>
				</tr>
            </thead>
            <tbody>
Example #6
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
if (isset($_SESSION['user'])) {
    if (isset($_POST['user'])) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/libs/stackexchange.php';
        delUser($_POST['user']);
    }
} else {
    header('Location: ../../index.php');
}
Example #7
0
    $where = "id={$id}";
    $mes = delProv($where);
} elseif ($act == "addCity") {
    $mes = addCity();
} elseif ($act == "editCity") {
    $where = "id={$id}";
    $mes = editCity($where);
} elseif ($act == "delCity") {
    $where = "id={$id}";
    $mes = delCity($where);
} elseif ($act == "addUser") {
    $mes = addUser();
} elseif ($act == "editUser") {
    $mes = editUser($id);
} elseif ($act == "delUser") {
    $mes = delUser($id);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
</head>
<body>
<?php 
if ($mes) {
    echo $mes;
}
?>
Example #8
0
    // このユーザーは既に削除されています
    \Sop\Api::exitWithError(array($msg001));
}
// 自分自身は削除不可
if (\Sop\Session::getSiteData('user_id') == $user_id) {
    \Sop\Log::warning(__FILE__, __LINE__, 'User tried to delete oneself.');
    $msg002 = "You can not delete oneself.";
    // 自分自身は削除できません。
    \Sop\Api::exitWithError(array($msg002));
}
// ---------------------------
// データ削除
// ---------------------------
$db->beginTransaction();
// --- TBL: user
$rslt = delUser($db, $user_id);
if (!$rslt) {
    \Sop\Log::error(__FILE__, __LINE__, 'Failed to delete user.');
    $msg003 = "The delete failed.: user";
    // 削除に失敗しました: user
    \Sop\Api::exitWithError(array($msg003));
}
// --- TBL: user_grp
$rslt = delUserGrp($db, $user_id);
if (!$rslt) {
    \Sop\Log::error(__FILE__, __LINE__, 'Failed to delete user_grp.');
    $msg004 = "The delete failed.: user_grp";
    // 削除に失敗しました: user_grp
    \Sop\Api::exitWithError(array($msg004));
}
// ---------------------------
Example #9
0
     $groupId = intval($_POST['groupId']);
     $matchId = intval($_POST['matchId']);
     $userId = intval($_POST['memberId']);
     $succe = updateUser($userId, $matchId, $groupId, -1, 1, 1, 1, 1);
     if ($succe != 1) {
         echo "添加队伍提交失败";
         return;
     }
     echo "添加队伍提交成功";
     break;
     // Del
 // Del
 case 'del':
     $matchId = intval($_POST['matchId']);
     $userId = intval($_POST['userId']);
     $succe = delUser($userId, $matchId);
     if ($succe != 1) {
         echo "删除选手失败";
         return;
     }
     echo "删除选手完成";
     break;
     // Update
 // Update
 case 'update':
     $matchTypeId = intval($_POST['matchTypeId']);
     $submitId = intval($_POST['submitId']);
     $userId = intval($_POST['userId']);
     $rankTypeList = getUserRankList($userId, $matchTypeId, -1, -1, 0, $submitId);
     $sumRankTypeList = getUserRankList($userId, $matchTypeId, -1, -1, 1, 0, OBJECT_K);
     foreach ($rankTypeList as $rankType) {
Example #10
0
    $custAddr = $_POST['custAddr'];
    if (count(getUserNoByLoginName($loginName)) != 0) {
        echo "<script> alert('The username already exist!, please change other one!')</script>";
    } else {
        if ($loginPswd != $rePswd) {
            echo "<script> alert('Password and re-enter password must be same!')</script> ";
        } else {
            if ($custAddr == "") {
                echo "<script> alert('Please enter Address!')</script>";
            } else {
                if (addUser($loginName, $loginPswd)) {
                    if (regCustomer(getUserNoByLoginName($loginName), $custName, $custGender, $custDOB, $custTel, $custAddr, $distNo)) {
                        echo "<script> alert('Successful register!')</script>";
                        unset($_POST);
                    } else {
                        delUser(getUserNoByLoginName($loginName));
                        echo "<script> alert('Unsuccessful register!')</script>";
                    }
                } else {
                    echo "<script> alert('Unsuccessful register!')</script>";
                }
            }
        }
    }
}
?>
<div class="outer">
<div class="middle">
<div class="inner col-50 col-m-100">

<h1>Register</h1>
        $template->setPage("Content", userProfileForm(true));
        break;
    case "edituser":
        $template->setPage("Title", "Edit-AdminUser::Registeration");
        $template->setPage("Content", userProfileForm(true));
        break;
    case "viewusers":
        $template->setPage("Title", "Preview::AdminUsers ");
        //$content ="<p>Some information on user profile viewer (Table list of Admin.)</p>";//
        $template->setPage("Content", usersDetailTable());
        break;
    case "profile":
        $template->setPage("Title", "Preview::Profile");
        //$content ="<p>Some information on user profile viewer (Table list of Admin.)</p>";
        $template->setPage("Content", $content);
        break;
    case "delete":
        echo delUser();
        header("Location: index.php");
        break;
    case "changepass":
        $template->setPage("Title", "Change My Password");
        $template->setPage("Content", changePassword());
        break;
    default:
        $template->setPage("Title", "My Profile ");
        $template->setPage("Content", viewProfile());
        break;
}
$template->setPage("Footer", ADMIN_FOOTER);
include_once "../" . TEMPLATE_DIR . SITE_TEMPLATE . ADMIN_LAYOUT;
    if (isset($_POST['TYPE'])) {
        $eldritchSQL = mysql_pconnect($hostname_eldritchSQL, $username_eldritchSQL, $password_eldritchSQL) or trigger_error(mysql_error(), E_USER_ERROR);
        mysql_select_db($database_eldritchSQL) or trigger_error(mysql_error(), E_USER_ERROR);
        $currID = $_POST['ID'];
        $type = $_POST['TYPE'];
        if ($type == "QD") {
            delQD($currID);
        } else {
            if ($type == "QDSUB") {
                delQDSub($currID);
            } else {
                if ($type == "ADMIN") {
                    delAdmin($currID);
                } else {
                    if ($type == "USER") {
                        delUser($currID);
                    }
                }
            }
        }
        mysql_close($eldritchSQL);
    }
}
function delQD($currID)
{
    if ($currID != "") {
        $response1 = mysql_query("DELETE FROM CGDB_QD_SUBITEM WHERE QD_ID = " . $currID) or trigger_error("Error removing sub-items for ID " . $currID . ": " . mysql_error(), E_USER_ERROR);
        $response2 = mysql_query("DELETE FROM CGDB_QD WHERE ID = " . $currID) or trigger_error("Error removing QD for ID " . $currID . ": " . mysql_error(), E_USER_ERROR);
        echo "Success";
    } else {
        trigger_error("Empty ID Passed", E_USER_ERROR);
Example #13
0
/**
 * function update table user et table UserEntities base inventory
*/
function _inventory_delUser($FH)
{
    //     global $result;
    syslog(LOG_WARNING, " test " . print_r($FH, true));
    delUser($FH);
}