Exemplo n.º 1
0
<?php

include_once "include_db.php";
include_once "include_functions.php";
require_once "phpmailer/class.phpmailer.php";
if (!$_SESSION["uname"]) {
    header('Location: logout.php');
    exit;
}
$CURRENT_USER = $_SESSION["uname"];
if (isset($_POST['submit'])) {
    $errMsg = '';
    $fid = get_POST_var('fid');
    $your_comment = get_POST_var('your_comment');
    $emails = get_POST_var('their_email');
    if ($fid != '' && $fid != '0') {
        $send_MF = new ManageFiles();
        $send_FILEINFO = $send_MF->get_file_Info($fid, $_SESSION["empl_id"]);
        if (!count($send_FILEINFO)) {
            echo "Invalid file or privilege";
            exit;
        }
        //$fileInfo = getChatFileInfoById($fid);
    } else {
        $errMsg .= 'These seems to be some problem with this file.<br />';
    }
    if (trim($emails) == '') {
        $errMsg .= 'Please enter valid email address(s)<br />';
    }
    if ($errMsg == '') {
        $valid_email_cnt = 0;
Exemplo n.º 2
0
function loginUser($uname, $uepwd)
{
    global $DE_GLOBALS_USERLOGINERR;
    if ($uname == "sadmin") {
        $password = getVariableFromSadminTbl('sadminpass');
    } else {
        $password = executesql_returnArray("select password from users where username='******' and user_status='A' ;");
    }
    if (!$password || $password != $uepwd) {
        send_Action_Response('Fail', $DE_GLOBALS_USERLOGINERR);
    }
    $_SESSION["uname"] = "{$uname}";
    if (get_POST_var('setcuky') == 'true') {
        $cookieid = getaRandomString(32);
        setcookie(USERCOOKIENAME, $cookieid, time() + 7 * 24 * 3600);
        $success = execute_sqlInsert('cookies', array(username => $uname, cookieid => $cookieid, cookietime => 'CURRENT_TIMESTAMP'));
    }
    logUserEvent($uname . ' (User) Logged In');
    alertAppAdmin($uname . ' (User) Logged In');
    send_Action_Response('Success', 'To Welcome Page');
    exit;
}
Exemplo n.º 3
0
        send_Action_Response('Success', $res);
        exit;
        break;
    case 'fetchArchives':
        $date = get_POST_var('DATE');
        $roomId = get_POST_var('ROOMID');
        $MCR = new ManageChatRooms();
        $ARMSGS = $MCR->get_Archives_fromRoom($date, $roomId, $_SESSION['empl_id']);
        send_Action_Response('Success', " NEW_MESSAGES = " . json_encode($ARMSGS['NEW_MESSAGES']) . "; LASTFETCHEDMSGID = {$ARMSGS['LASTFETCHEDMSGID']} ;");
        exit;
        break;
    case 'getRoomIdsForUser':
        $MU = new ManageUsers();
        $MU->userId = get_POST_var('uid');
        $user_rooms = $MU->getUser_AllowedChatRooms_IncludeDepricatedOnes();
        send_Action_Response('Success', " USER_ROOMS = " . json_encode($user_rooms) . "; ");
        exit;
        break;
    case 'searchFiles':
        $date = get_POST_var('DATE');
        list($stDay, $stMonth, $stYear) = explode("-", $date);
        $newdate = $stYear . '-' . $stMonth . '-' . $stDay;
        $MF = new ManageFiles();
        $FILES = $MF->get_ListOfFiles_Search_with_details($_SESSION['empl_id'], $newdate);
        send_Action_Response('Success', " FILES = " . json_encode($FILES['NEW_FILES']) . "; ");
        exit;
        break;
    default:
        send_Action_Response('Fail', "SC Error #500: No case defined for Action : {$ACTION} ");
        break;
}
Exemplo n.º 4
0
<?php

set_time_limit(0);
include_once "include_db.php";
include_once "include_functions.php";
if (!$_SESSION["uname"]) {
    header('Location: logout.php');
    exit;
}
$CURRENT_USER = $_SESSION["uname"];
// check whether this user has access to this room
$GMU = new ManageUsers();
$GMU->userId = $_SESSION['empl_id'];
$rid = get_POST_var('rid');
if (!$GMU->has_AccessToRoom($rid)) {
    echo "You are not authorised to access this page.";
    exit;
}
// get file size and generate a random code
$MF = new ManageFiles();
$UFID = $MF->createUnique_FID(16);
$size = $_FILES['myfile']['size'];
$file_name = str_replace(' ', '_', $_FILES['myfile']['name']);
$file_type = $_FILES['myfile']['type'];
$errors = $_FILES['myfile']['error'];
//move the uploaded file to UPLOAD_PATH and insert into database
$result = 0;
if ($errors == UPLOAD_ERR_OK) {
    $tmp_name = $tmp_names;
    //$allowedExtensions = array("txt","csv","htm","html","xml","css","doc","xls","rtf","ppt","pdf","swf","flv","avi","wmv","mov","jpg","jpeg","gif","png");
    $type = end(explode(".", strtolower($file_name)));
Exemplo n.º 5
0
include_once "include_db.php";
include_once "include_functions.php";
if (!$_SESSION["uname"]) {
    header('Location: logout.php');
    exit;
}
$CURRENT_USER = $_SESSION["uname"];
$result = 0;
if (get_POST_var('to_user')) {
    $to_user = get_POST_var('to_user');
    if ($to_user == '' || $to_user == '0') {
        echo "please select a user to send file or message";
        exit;
    }
}
$new_message = get_POST_var('new_message');
if (isset($_FILES['myfile']['name']) && $_FILES['myfile']['name'] != '') {
    $file_type = $_FILES['myfile']['type'];
    $errors = $_FILES['myfile']['error'];
    $file_name = $_FILES['myfile']['name'];
    $size = $_FILES['myfile']['size'];
    if ($errors == UPLOAD_ERR_OK) {
        $tmp_name = $tmp_names;
        //$allowedExtensions = array("txt","csv","htm","html","xml","css","doc","xls","rtf","ppt","pdf","swf","flv","avi","wmv","mov","jpg","jpeg","gif","png");
        $type = end(explode(".", strtolower($file_name)));
        $MF = new ManageFiles();
        $UFID = $MF->createUnique_FID(16);
        $name = $UFID . "." . $type;
        $file_name = str_replace(' ', '_', $file_name);
        // Edit upload location here
        $destination_path = 'files/chat_files/';
Exemplo n.º 6
0
include_once "include_db.php";
if (!$_SESSION["uname"]) {
    header('Location: logout.php');
    exit;
}
$CURRENT_USER = $_SESSION["uname"];
if (!isset($_POST['submit'])) {
    echo "You are not authorised to access this page";
    exit;
}
$name = get_POST_var("name");
$email = get_POST_var("email");
$mobile = get_POST_var("mobile");
$designation = get_POST_var("designation");
$Timezone = get_POST_var("Timezone");
$uid = $_SESSION["empl_id"];
$existingEmail = executesql_returnArray("select emplEmail_id from tblAppUsers where empl_id!='{$uid}' AND emplEmail_id='{$email}'");
$er = '';
if ($existingEmail) {
    //send_Action_Response('Fail' , 'Email Already Exists !');
    $result = 0;
    $er = f;
} else {
    $result = execute_sqlUpdate('tblAppUsers', array('emplEmail_id' => $email, 'emplFullName' => $name, 'emplMobileNo' => $mobile, 'emplDesignation' => $designation, 'TimeZone' => $Timezone), array('empl_id' => $uid));
    //send_Action_Response( 'Success' , 'Updated!' );
    $result = 1;
}
if (isset($_FILES['userimg']['name'])) {
    $type = $_FILES['userimg']['type'];
    $errors = $_FILES['userimg']['error'];
Exemplo n.º 7
0
     exit;
     break;
 case 'resetRoutineTasksStatus':
     $result = execute_sqlUpdate("dailychecklist", array(status => 'N'), array(username => $USERNAME));
     send_Action_Response('Success', "Status Reset !");
     exit;
     break;
 case 'updateTasksStatus':
     $dclid = get_POST_var('dclid');
     $task_status = get_POST_var('task_status');
     $result = execute_sqlUpdate("dailychecklist", array(status => $task_status), array(username => $USERNAME, dclid => $dclid));
     send_Action_Response('Success', "Status Reset !");
     exit;
     break;
 case 'deleteDailyRoutineTask':
     $dclid = get_POST_var('dclid');
     $result = mysql_query("delete from dailychecklist where username='******' and dclid='{$dclid}' ");
     send_Action_Response('Success', "deleted daily routine task !");
     exit;
     break;
 case 'newIcalURL':
     $new_Key = getaRandomString(32);
     $result = execute_sqlUpdate("users", array('remindersicalkey' => $new_Key), array('username' => $USERNAME));
     send_Action_Response('Success', "ical key was reset !");
     exit;
     break;
 case 'getJsonEventsForCalendarView':
     $tasks = array();
     $twomonths_ago = date("Y-m-d", strtotime("-2 month"));
     $fourmonths_fromnow = date("Y-m-d", strtotime("+4 month"));
     $sqlquery = "select work_deadLine, workID, work_briefDesc, work_RTID from works_todolist where work_deadLine > '{$twomonths_ago}' and work_deadLine < '{$fourmonths_fromnow}' and work_userAssigned = '{$USERNAME}' ";
Exemplo n.º 8
0
<?php

include_once "include_db.php";
include_once "include_functions.php";
checkUserSessionandCookie();
include_once "include_header.php";
$username = $_SESSION["uname"];
?>
<SCRIPT>

var localajaxinit = function(){

}; // End of localajaxinit

</SCRIPT>


<?php 
$searchString = get_POST_var('search_term');
$sreport = new searchReport();
$sreport->search_ftext($searchString);
// $sreport->search_fromdate( $fromdate );
// $sreport->search_todate( $todate );
// $sreport->search_username( $username );
// $sreport->search_taskid( $taskid );
$sreport->search_results();
include "include_footer.php";