Ejemplo n.º 1
0
 public function closeWork($workID)
 {
     global $DE_GLOBALS_WORK_CLOSED;
     global $DE_GLOBALS_WORK_NEW;
     global $DE_GLOBALS_WORK_TASKONTASK;
     $currentTimeStamp = get_currentPHPTimestamp();
     $success = execute_sqlUpdate("WORKS", array(work_status => $DE_GLOBALS_WORK_CLOSED, work_closedDate => $currentTimeStamp), array(workID => $workID));
     // Appear in List any tasks having $workID as 'afterCompletionID'
     $success = execute_sqlUpdate("WORKS", array(work_status => $DE_GLOBALS_WORK_NEW), array(afterCompletionID => $workID, work_status => $DE_GLOBALS_WORK_TASKONTASK));
 }
Ejemplo n.º 2
0
 public function newMessage($fromUid, $toUid, $messageInBase64)
 {
     $success = execute_sqlInsert('tbl_DirectMessages', array('to_uid' => $toUid, 'from_uid' => $fromUid, 'msg_base64' => base64_encode(htmlentities(base64_decode($messageInBase64), ENT_QUOTES)), 'msg_plain' => base64_decode($messageInBase64), 'msgtime' => get_currentPHPTimestamp()));
 }
Ejemplo n.º 3
0
<?php

include_once "include_db.php";
include_once "include_functions.php";
checkUserSessionandCookie();
$username = $_SESSION["uname"];
$workid = @$_POST["fileupload_workid"];
$uploadname = basename($_FILES['uploadedfile']['name']);
$ruri = @$_POST["fileupload_requestURI"];
$tmp_uploadedOn = get_currentPHPTimestamp();
$tmp = getDirectorySize($target_path);
$currentsize = $tmp['size'];
$maxallowed = $_SESSION["pkgSpaceMb"] * 1024 * 1024;
// convert Mb into bytes
if ($currentsize > $maxallowed) {
    echo "<h1>You do not have enough free space for uploading any new files ! </h1>";
    exit;
}
Task_LogSystemComment($workid, "<B>{$username}</B> has uploaded file '{$uploadname}' {$thisfilesize}");
logUserEvent('Uploaded attachment to ' . $workid);
$fp = fopen($_FILES['uploadedfile']['tmp_name'], 'r');
$fp_size = filesize($_FILES['uploadedfile']['tmp_name']);
$somefile = bin2hex(fread($fp, $fp_size));
$success = execute_sqlInsert('attachments', array('workid' => $workid, 'uploadname' => $uploadname, 'uploadedby' => $username, 'filecontent' => $somefile, 'filesize' => $fp_size, 'uploadedOn' => $tmp_uploadedOn));
header("Location: " . $ruri);
Ejemplo n.º 4
0
function execute_sqlQuery($someQuery)
{
    global $DEVELOPMENT_MODE;
    global $GLOBAL_STRICT_NOLOGGING_QUERIES;
    if ($DEVELOPMENT_MODE) {
        $should_Log = !$GLOBAL_STRICT_NOLOGGING_QUERIES;
    } else {
        if ($GLOBAL_STRICT_NOLOGGING_QUERIES) {
            $should_Log = false;
        } else {
            global $GLOBAL_LOG_QUERIES;
            // is this an actions.php like page with update queuries
            if ($GLOBAL_LOG_QUERIES) {
                // even in actions.php ignore logging select queries
                $should_Log = strtolower(substr(trim($someQuery), 0, 6)) != 'select';
            } else {
                $should_Log = false;
            }
        }
    }
    if ($should_Log) {
        $ts = get_currentPHPTimestamp();
        $username = $_SESSION["uname"];
        global $GLOBAL_requestid;
        $r = mysql_query("insert into `whm_logs`.`queryLog` ( `querystring`, `queryuser`, `querytime`, `requestid`) values ( '" . mysql_real_escape_string($someQuery) . "', '{$username}', '{$ts}', '{$GLOBAL_requestid}')");
    }
    return mysql_query($someQuery);
}