Exemplo n.º 1
0
function DisplayUserEntries()
{
    $users = GetUsers();
    foreach ($users as $user) {
        DisplayEntry($user->ID, $user->Username, $user->PasswordHash, $user->Email, $user->PhoneNumber, $user->Name, $user->Role);
    }
}
Exemplo n.º 2
0
function DisplayUserEntries()
{
    $users = GetUsers();
    foreach ($users as $user) {
        DisplayEntry($user['ID'], $user['Username'], $user['Password'], $user['Email'], $user['Phone'], $user['Name'], $user['Role']);
    }
}
Exemplo n.º 3
0
function DoesUserExist()
{
    $userList = GetUsers();
    $noUser = true;
    foreach ($userList as $userVal) {
        if ($userVal["name"] == $targetUser) {
            $noUser = false;
        }
    }
    return $noUser;
}
Exemplo n.º 4
0
function displayActivity($min = 0, $user = "", $srchFile = "", $srchAction = "")
{
    global $cfg, $db;
    $sqlForSearch = "";
    $userdisplay = $user;
    if ($user != "") {
        $sqlForSearch .= "user_id='" . $user . "' AND ";
    } else {
        $userdisplay = _ALLUSERS;
    }
    if ($srchFile != "") {
        $sqlForSearch .= "file like '%" . $srchFile . "%' AND ";
    }
    if ($srchAction != "") {
        $sqlForSearch .= "action like '%" . $srchAction . "%' AND ";
    }
    $offset = 50;
    $inx = 0;
    if (!isset($min)) {
        $min = 0;
    }
    $max = $min + $offset;
    $output = "";
    $morelink = "";
    $sql = "SELECT user_id, file, action, ip, ip_resolved, user_agent, time FROM tf_log WHERE " . $sqlForSearch . "action!=" . $db->qstr($cfg["constants"]["hit"]) . " ORDER BY time desc";
    $result = $db->SelectLimit($sql, $offset, $min);
    while (list($user_id, $file, $action, $ip, $ip_resolved, $user_agent, $time) = $result->FetchRow()) {
        $user_icon = "images/user_offline.gif";
        if (IsOnline($user_id)) {
            $user_icon = "images/user.gif";
        }
        $ip_info = htmlentities($ip_resolved, ENT_QUOTES) . "<br>" . htmlentities($user_agent, ENT_QUOTES);
        $output .= "<tr>";
        if (IsUser($user_id)) {
            $output .= "<td><a href=\"message.php?to_user="******"\"><img src=\"" . $user_icon . "\" width=17 height=14 title=\"" . _SENDMESSAGETO . " " . $user_id . "\" border=0 align=\"bottom\">" . $user_id . "</a>&nbsp;&nbsp;</td>";
        } else {
            $output .= "<td><img src=\"" . $user_icon . "\" width=17 height=14 title=\"n/a\" border=0 align=\"bottom\">" . $user_id . "&nbsp;&nbsp;</td>";
        }
        $output .= "<td><div class=\"tiny\">" . htmlentities($action, ENT_QUOTES) . "</div></td>";
        $output .= "<td><div align=center><div class=\"tiny\" align=\"left\">";
        $output .= htmlentities($file, ENT_QUOTES);
        $output .= "</div></td>";
        $output .= "<td><div class=\"tiny\" align=\"left\"><a href=\"javascript:void(0)\" onclick=\"return overlib('" . $ip_info . "<br>', STICKY, CSSCLASS);\" onmouseover=\"return overlib('" . $ip_info . "<br>', CSSCLASS);\" onmouseout=\"return nd();\"><img src=\"images/properties.png\" width=\"18\" height=\"13\" border=\"0\"><font class=tiny>" . htmlentities($ip, ENT_QUOTES) . "</font></a></div></td>";
        $output .= "<td><div class=\"tiny\" align=\"center\">" . date(_DATETIMEFORMAT, $time) . "</div></td>";
        $output .= "</tr>";
        $inx++;
    }
    if ($inx == 0) {
        $output = "<tr><td colspan=6><center><strong>-- " . _NORECORDSFOUND . " --</strong></center></td></tr>";
    }
    $prev = $min - $offset;
    if ($prev >= 0) {
        $prevlink = "<a href=\"admin.php?op=showUserActivity&min=" . $prev . "&user_id=" . $user . "&srchFile=" . $srchFile . "&srchAction=" . $srchAction . "\">";
        $prevlink .= "<font class=\"TinyWhite\">&lt;&lt;" . $min . " " . _SHOWPREVIOUS . "]</font></a> &nbsp;";
    }
    if ($inx >= $offset) {
        $morelink = "<a href=\"admin.php?op=showUserActivity&min=" . $max . "&user_id=" . $user . "&srchFile=" . $srchFile . "&srchAction=" . $srchAction . "\">";
        $morelink .= "<font class=\"TinyWhite\">[" . _SHOWMORE . "&gt;&gt;</font></a>";
    }
    ?>
	<div id="overDiv" style="position:absolute;visibility:hidden;z-index:1000;"></div>
	<script language="JavaScript">
		var ol_closeclick = "1";
		var ol_close = "<font color=#ffffff><b>X</b></font>";
		var ol_fgclass = "fg";
		var ol_bgclass = "bg";
		var ol_captionfontclass = "overCaption";
		var ol_closefontclass = "overClose";
		var ol_textfontclass = "overBody";
		var ol_cap = "&nbsp;IP Info";
	</script>
	<script src="overlib.js" type="text/javascript"></script>
	<div align="center">
	<table>
	<form action="admin.php?op=showUserActivity" name="searchForm" method="post">
	<tr>
		<td>
		<strong><?php 
    echo _ACTIVITYSEARCH;
    ?>
</strong>&nbsp;&nbsp;&nbsp;
		<?php 
    echo _FILE;
    ?>
:
		<input type="Text" name="srchFile" value="<?php 
    echo $srchFile;
    ?>
" width="30"> &nbsp;&nbsp;
		<?php 
    echo _ACTION;
    ?>
:
		<select name="srchAction">
		<option value="">-- <?php 
    echo _ALL;
    ?>
 --</option>
<?php 
    $selected = "";
    foreach ($cfg["constants"] as $action) {
        $selected = "";
        if ($action != $cfg["constants"]["hit"]) {
            if ($srchAction == $action) {
                $selected = "selected";
            }
            echo "<option value=\"" . $action . "\" " . $selected . ">" . htmlentities($action, ENT_QUOTES) . "</option>";
        }
    }
    ?>
		</select>&nbsp;&nbsp;
		<?php 
    echo _USER;
    ?>
:
		<select name="user_id">
		<option value="">-- <?php 
    echo _ALL;
    ?>
 --</option>
<?php 
    $users = GetUsers();
    $selected = "";
    for ($inx = 0; $inx < sizeof($users); $inx++) {
        $selected = "";
        if ($user == $users[$inx]) {
            $selected = "selected";
        }
        echo "<option value=\"" . $users[$inx] . "\" " . $selected . ">" . htmlentities($users[$inx], ENT_QUOTES) . "</option>";
    }
    ?>
		</select>
		<input type="Submit" value="<?php 
    echo _SEARCH;
    ?>
">

		</td>
	</tr>
	</form>
	</table>
	</div>

<?php 
    echo "<table width=\"760\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
    echo "<tr><td colspan=6 bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
    echo "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr><td>";
    echo "<img src=\"images/properties.png\" width=18 height=13 border=0>&nbsp;&nbsp;<font class=\"title\">" . _ACTIVITYLOG . " " . $cfg["days_to_keep"] . " " . _DAYS . " (" . $userdisplay . ")</font>";
    if (!empty($prevlink) && !empty($morelink)) {
        echo "</td><td align=\"right\">" . $prevlink . $morelink . "</td></tr></table>";
    } elseif (!empty($prevlink)) {
        echo "</td><td align=\"right\">" . $prevlink . "</td></tr></table>";
    } elseif (!empty($prevlink)) {
        echo "</td><td align=\"right\">" . $morelink . "</td></tr></table>";
    } else {
        echo "</td><td align=\"right\"></td></tr></table>";
    }
    echo "</td></tr>";
    echo "<tr>";
    echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _USER . "</div></td>";
    echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _ACTION . "</div></td>";
    echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _FILE . "</div></td>";
    echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"13%\"><div align=center class=\"title\">" . _IP . "</div></td>";
    echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"15%\"><div align=center class=\"title\">" . _TIMESTAMP . "</div></td>";
    echo "</tr>";
    echo $output;
    if (!empty($prevlink) || !empty($morelink)) {
        echo "<tr><td colspan=6 bgcolor=\"" . $cfg["table_header_bg"] . "\">";
        echo "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr><td align=\"left\">";
        if (!empty($prevlink)) {
            echo $prevlink;
        }
        echo "</td><td align=\"right\">";
        if (!empty($morelink)) {
            echo $morelink;
        }
        echo "</td></tr></table>";
        echo "</td></tr>";
    }
    echo "</table>";
}
Exemplo n.º 5
0
 $confirmationMsg = "";
 // Get selectedRole
 if (FirstTimeHere($pageName)) {
     $refreshRequested = true;
     $selectedRole = ADMIN_ROLE;
 } else {
     if (array_key_exists($selectedRoleID, $_POST)) {
         $selectedRole = $_POST[$selectedRoleID];
     } else {
         $selectedRole = ADMIN_ROLE;
     }
     $refreshRequested = CheckForRefresh();
 }
 // Are we refreshing?
 if ($refreshRequested) {
     $userList = GetUsers();
     GetUsersOrGroupsByRole(true, $selectedRole, $usersSelected);
     $usersNotSelected = array_diff($userList, $usersSelected);
     $groupList = GetGroups();
     GetUsersOrGroupsByRole(false, $selectedRole, $groupsSelected);
     $groupsNotSelected = array_diff($groupList, $groupsSelected);
 } else {
     // Get submitted data
     if (array_key_exists($usersSelectedID, $_POST)) {
         $usersSelected = $_POST[$usersSelectedID];
     }
     if (array_key_exists($usersNotSelectedID, $_POST)) {
         $usersNotSelected = $_POST[$usersNotSelectedID];
     }
     if (array_key_exists($groupsSelectedID, $_POST)) {
         $groupsSelected = $_POST[$groupsSelectedID];
Exemplo n.º 6
0
 $errorMsg = "";
 $confirmationMsg = "";
 // Is this our first time here?
 if (FirstTimeHere($pageName)) {
     // Was the selected group passed in the URL?
     if (array_key_exists($selectedGroupID, $_GET)) {
         $selectedGroup = $_GET[$selectedGroupID];
     }
     // Get info for selected user
     $selectedGroupData = GetDataForGroup($selectedGroup, true);
     if ($selectedGroupData == NULL) {
         throw new Exception(sprintf($errNotFound, $selectedGroup));
     }
     $description = $selectedGroupData->description;
     CopyArray($selectedGroupData->users, $usersSelected);
     $allUsers = GetUsers();
     $usersNotSelected = array_diff($allUsers, $usersSelected);
 } else {
     // Get submitted data
     if (array_key_exists($selectedGroupID, $_POST)) {
         $selectedGroup = $_POST[$selectedGroupID];
     }
     if (array_key_exists($descriptionID, $_POST)) {
         $description = $_POST[$descriptionID];
     }
     if (array_key_exists($usersSelectedID, $_POST)) {
         $usersSelected = $_POST[$usersSelectedID];
     }
     if (array_key_exists($usersNotSelectedID, $_POST)) {
         $usersNotSelected = $_POST[$usersNotSelectedID];
     }
Exemplo n.º 7
0
        <table width="100%" cellpadding="1" border="0">
        <tr>
        <td valign="top">
        <b><?php 
echo _TORRENTLINKS;
?>
:</b><br>
<?php 
$arLinks = GetLinks();
if (is_array($arLinks)) {
    foreach ($arLinks as $link) {
        echo "<a href=\"" . $link['url'] . "\" target=\"_blank\"><img src=\"images/arrow.gif\" width=9 height=9 title=\"" . $link['url'] . "\" border=0 align=\"baseline\">" . $link['sitename'] . "</a><br>\n";
    }
}
echo "</ul></td>";
$arUsers = GetUsers();
$arOnlineUsers = array();
$arOfflineUsers = array();
for ($inx = 0; $inx < count($arUsers); $inx++) {
    if (IsOnline($arUsers[$inx])) {
        array_push($arOnlineUsers, $arUsers[$inx]);
    } else {
        array_push($arOfflineUsers, $arUsers[$inx]);
    }
}
echo "<td bgcolor=\"" . $cfg["table_data_bg"] . "\" valign=\"top\">";
echo "<b>" . _ONLINE . ":</b><br>";
for ($inx = 0; $inx < count($arOnlineUsers); $inx++) {
    echo "<a href=\"message.php?to_user="******"\">";
    echo "<img src=\"images/user.gif\" width=17 height=14 title=\"\" border=0 align=\"bottom\">" . $arOnlineUsers[$inx];
    echo "</a><br>\n";
/**
 * Удаление ключа индивидуальной настройки пользователя в базе данных.
 * @param      $Name Имя настройки.
 * @param null $UserId Идентификатор пользователя. Если не указан, то используется идентификатор текущего пользователя.
 * @return var|null Возвращает значение удаленной настройки, или null, если настройка не найдена.
 */
function UserDataDelete($Name, $UserId = null)
{
    $this_user = false;
    if (!isset($UserId)) {
        if (System::user()->Auth) {
            $UserId = SafeEnv($this->Get('u_id'), 11, int);
            $this_user = true;
        } else {
            return null;
        }
    }
    $Data = GetUserInfo($UserId);
    $Data = $Data['data'];
    if (isset($Data[$Name])) {
        $value = $Data[$Name];
        unset($Data[$Name]);
        $system_users_cache = GetUsers();
        $system_users_cache[$UserId]['data'] = $Data;
        if ($this_user) {
            System::user()->Session('u_data', $Data);
        }
        System::database()->Update('users', "`data`='" . SafeEnv(serialize($Data), 0, str) . "'", "`id`='{$UserId}'");
        return $value;
    }
}
Exemplo n.º 9
0
<?php 
header('Content-Type: text/html; charset=utf-8');
/// set the content charset to utf-8 for php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
$temp = $_POST["param"];
$temp = str_replace("[", "", $temp);
$temp = str_replace("]", "", $temp);
//echo $temp;
$param = json_decode($temp);
$ordr = (int) $param->order;
switch ($ordr) {
    case 1:
        GetUsers();
        break;
    case 2:
        InsertUser($param);
        break;
    case 3:
        UpdateUser($param);
        break;
    case 4:
        GetUserInfo($param);
        break;
    case 5:
        DelUser($param);
        break;
}
function GetUsers()
{
Exemplo n.º 10
0
<?php

//Insersion des fichiers ".php"
require_once 'mysql.inc.php';
require_once 'DbFunctions.php';
require_once 'DisplayFunctions.php';
$tabUser = GetUsers();
$tableHTMLUsers = AssocToHtml($tabUser);
?>

<!DOCTYPE html>
<html>
    <head>
        <title>Accueil</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <?php 
require_once 'header.php';
?>
    <body>
        <div id="corpsForm">
            <div id="insideCorpsForm">
                <?php 
if (isset($_GET['id'])) {
    $tableHTMLUser = TableUsersToHtmlUser($_GET['id'], $tabUser);
    echo $tableHTMLUser;
} else {
    echo $tableHTMLUsers;
}
Exemplo n.º 11
0
?>
		<!--Done adding profile pic to page-->
                </td>
        </tr>
        <tr>
                <td>
        	        <div style="text-align:center">
	                <strong>Other Users</strong>
                	</div>
                	<br />
                </td>
        </tr>

	<?php 
$dbh = ConnectDB();
$userdata = GetUsers($dbh);
foreach ($userdata as $thisone) {
    $photo_id = GetProfilePic($dbh, $thisone->username);
    if ($photo_id != 0) {
        $pic = GetPic($dbh, $photo_id);
        echo '<tr><td><img src="' . $pic . '
			" alt="" style="width:auto;height:auto;
			max-width:20px;max-height:20px;"/>
			&nbsp;<a href="./show_pix.php?username='******'">' . $thisone->username . '</a></td></tr>';
    } else {
        echo '<tr><td><img src="/~mclaug67/Images/johnfreeman.png"
			alt="" style="width:auto;height:auto;
			max-width:20px;max-height:20px;"/>
			&nbsp;<a href="./show_pix.php?username='******'">' . $thisone->username . '</a></td></tr>';
    }
}
Exemplo n.º 12
0
                                  <input type="checkbox" id="callapp_checkbox_' . $aRow[$hidden] . '" name="check_' . $aRow[$hidden] . '" value="' . $aRow[$hidden] . '" class="check" />
                                  <label for="callapp_checkbox_' . $aRow[$hidden] . '"></label>
                              </div>';
                }
            }
            $data['aaData'][] = $row;
        }
        break;
    case 'save_actived':
        ActivedUsers($user_id, $actived_number, $operator);
        break;
    case 'save_actived_select':
        ActivedUsersSelect($user_id, $operator, $ids);
        break;
    case 'get_user':
        $page = GetUsers();
        $data = array('user' => $page);
        break;
    default:
        $error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
 *	Request Functions
* ******************************
*/
function GetUsers()
{
    $data = '';
    $req = mysql_query("SELECT  `users`.`id`,\r\n\t\t\t\t                `user_info`.`name`\r\n                        FROM    `users`\r\n                        JOIN    `user_info` ON `users`.`id` = `user_info`.`user_id`\r\n                        WHERE   `users`.`actived` = 1");
Exemplo n.º 13
0
 $formName = 'AddGroupForm';
 $homePage = 'groupmanagement.php';
 $helpPage = 'HelpDocs/adding_and_deleting_groups.htm';
 $groupName = "";
 $groupNameID = 'groupName';
 $description = "";
 $descriptionID = 'description';
 $usersSelected = array();
 $usersSelectedID = 'usersSelected';
 $usersNotSelected = array();
 $usersNotSelectedID = 'usersNotSelected';
 $confirmationMsg = "";
 $errorMsg = "";
 // Is this our first time here?
 if (FirstTimeHere($pageName)) {
     $usersNotSelected = GetUsers();
 } else {
     // Get submitted data
     if (array_key_exists($groupNameID, $_POST)) {
         $groupName = $_POST[$groupNameID];
     }
     if (array_key_exists($descriptionID, $_POST)) {
         $description = $_POST[$descriptionID];
     }
     if (array_key_exists($usersSelectedID, $_POST)) {
         $usersSelected = $_POST[$usersSelectedID];
     }
     if (array_key_exists($usersNotSelectedID, $_POST)) {
         $usersNotSelected = $_POST[$usersNotSelectedID];
     }
     // Validate inputs.
Exemplo n.º 14
0
<?php

include "../modules/Application/src/Application/View/Helper/Form.php";
include "../modules/Application/src/Application/View/Helper/FormUpdate.php";
include "../modules/Application/src/Application/Mapper/User/GetUsers.php";
include "../modules/Application/src/Application/Mapper/User/GetUser.php";
include "../modules/Application/src/Application/Mapper/User/DeleteUser.php";
include "../modules/Utils/src/Utils/View/RenderView.php";
$formdef = "../modules/Application/src/Application/Forms/register.json";
switch ($route['action']) {
    case 'index':
    case 'select':
        $users = GetUsers($config);
        $content = RenderView($route, array('users' => $users));
        break;
    case 'insert':
        if ($_POST) {
            include '../modules/Utils/src/Utils/Form/FilterData.php';
            $formdef = "../modules/Application/src/Application/Forms/register.json";
            $data = FilterData($_POST, $formdef);
            $validate = ValidateData($data, $formdef);
            if ($validate['result'] === true) {
                // Write to repo
                $array = $_POST;
                $array['photo'] = $_FILES['photo']['name'];
                Save($array, $filename);
                header("Location: /user/select");
            } else {
                echo "<pre>";
                print_r($valid);
                echo "</pre>";
        exit;
    }
    if (isset($_GET['GroupId']) and is_numeric($_GET['GroupId'])) {
        $GroupId = (int) $_GET['GroupId'];
        if (isset($_GET['GroupName']) and mb_strlen($_GET['GroupName']) <= 100 and !ContainsIllegalCharacters($_GET['GroupName'])) {
            $GroupName = trim($_GET['GroupName']);
        } else {
            prnMsg(_('The Group Name should be less than 100 and cannot contains illegal characters'), 'error');
            include 'includes/footer.inc';
            exit;
        }
    }
    $sql = "DELETE FROM mailgroupdetails WHERE userid = '" . $UserId . "' AND groupname = '" . $GroupName . "'";
    $ErrMsg = 'Failed to delete the userid ' . $UserId . ' from group ' . $GroupName;
    $result = DB_query($sql, $db, $ErrMsg);
    GetUsers($GroupId, $GroupName);
}
if (!isset($_GET['Edit'])) {
    //display the input form
    ?>
	<form id="MailGroups" action="<?php 
    echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8');
    ?>
" method="post">
		<input type="hidden" name="FormID" value="<?php 
    echo $_SESSION['FormID'];
    ?>
" />
		<label for="MailGroup"><?php 
    echo _('Mail Group');
    ?>
Exemplo n.º 16
0
function DisplayMessageList()
{
    global $cfg;
    $users = GetUsers();
    echo '<div align="center">' . '<table border="0" cellpadding="0" cellspacing="0">' . '<form name="formMessage" action="message.php" method="post">' . '<tr><td>' . _SENDMESSAGETO;
    echo '<select name="to_user">';
    for ($inx = 0; $inx < sizeof($users); $inx++) {
        echo '<option>' . $users[$inx] . '</option>';
    }
    echo '</select>';
    echo '<input type="Submit" value="' . _COMPOSE . '">';
    echo '</td></tr></form></table></div>';
}
Exemplo n.º 17
0
<?php

include '../modules/Application/src/Application/Model/Mapper/UserMapper/GetUsers.php';
include '../modules/Application/src/Application/Model/Mapper/UserMapper/GetUser.php';
include '../modules/Application/src/Application/Model/Mapper/UserMapper/DeleteUser.php';
include '../modules/Utils/src/Utils/View/RenderView.php';
$userfilename = $_SERVER['DOCUMENT_ROOT'] . '/../data/user.txt';
switch ($router['action']) {
    case 'index':
    case 'select':
        $rows = GetUsers($config);
        $content = RenderView($router, array('rows' => $rows));
        break;
    case 'insert':
        if ($_POST) {
            include '../modules/Utils/src/Utils/Form/FilterData.php';
            $formdef = "../modules/Application/src/Application/Form/register.json";
            $data = FilterData($_POST, $formdef);
            $validate = ValidateData($data, $formdef);
            if ($validate['result'] === true) {
                $_POST['photo'] = $_FILES['photo']['name'];
                echo "<pre>";
                print_r($_FILES);
                echo "</pre>";
                $destination = $_SERVER['DOCUMENT_ROOT'] . '/img/' . $_POST['photo'];
                move_uploaded_file($_FILES['photo']['tmp_name'], $destination);
                include "../modules/Application/src/Application/Model/Txt/Insert.php";
                Insert($_POST, $userfilename);
                header("Location: /user/select");
            }
            echo "<pre>";
Exemplo n.º 18
0
    SetUserSortColumn($sortColumn);
    // Are we switching to another page?
    CheckForPageSwitch();
    // Are we deleting the selected user?
    if (CheckForDeleteSelection() && DeleteUser($selectedUser)) {
        $confirmationMsg = sprintf($confSuccessfulDeletion, $selectedUser);
    }
} catch (MgException $e) {
    CheckForFatalMgException($e);
    $errorMsg = $e->GetExceptionMessage();
} catch (Exception $e) {
    $errorMsg = $e->getMessage();
}
// Load display data
try {
    $users = GetUsers();
    $numUsers = sizeof($users);
    $currPage = GetPageNumber($users, $selectedUser, $pageSize);
    GetPageRange($currPage, $numUsers, $pageSize, $firstPageIndex, $lastPageIndex);
    LoadUserTable($userTable, $firstPageIndex, $lastPageIndex, true);
    if (!array_key_exists($selectedUser, $userTable) && $numUsers > 0) {
        $selectedUser = $users[$firstPageIndex];
    }
    LoadUserRolesTable($userRolesTable, $firstPageIndex, $lastPageIndex);
} catch (MgException $e) {
    CheckForFatalMgException($e);
    if (empty($errorMsg)) {
        $errorMsg = $e->GetExceptionMessage();
    }
} catch (Exception $e) {
    if (empty($errorMsg)) {
Exemplo n.º 19
0
function RunImport()
{
    if (!empty($_FILES)) {
        if (basename($_FILES['importFile']['name']) == "import_0945.csv") {
            Import_PRICE_ROST();
        } elseif (basename($_FILES['importFile']['name']) == "DC_IMS.csv") {
            Import_DC_IMS();
        } elseif (basename($_FILES['importFile']['name']) == "PRICE_KROSS.csv") {
            Import_PRICE_KROSS();
        } elseif (basename($_FILES['importFile']['name']) == "FILIAL.csv") {
            Import_Filial();
        } elseif (basename($_FILES['importFile']['name']) == "DOSTAVKA.csv") {
            Import_DOSTAVKA();
        } elseif (basename($_FILES['importFile']['name']) == "FILTR.csv") {
            ImportFILTR();
        } else {
            UploadImage();
        }
    } elseif (isset($_GET['action']) and $_GET['action'] == "GetOrders") {
        GetOrders();
    } elseif (isset($_GET['action']) and $_GET['action'] == "GetUsers") {
        GetUsers();
    } else {
        EmptyAction();
    }
}