Esempio n. 1
0
function changeFileNameImage($filename)
{
    $file = getFilename($filename);
    $str = strtotime(date('Y-m-d H:i:s'));
    $fileNameAfter = $file . '-' . $str;
    $extension = getExtension($filename);
    return $fileNameAfter . '.' . $extension;
}
Esempio n. 2
0
/**
 * This function does the action of forcing the browser to download the
 * specified file as well as feeds the bits of the file to the browser.
 * 
 * @param string $filePath is the path to the file that we want to download.
 * @return int Error code if one exists.  Return of 0 indicates no error.
 */
function download_file($filePath)
{
    $allowed_ext = array('zip' => 'application/zip', 'pdf' => 'application/pdf', 'doc' => 'application/msword', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'exe' => 'application/octet-stream', 'gif' => 'image/gif', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'mp3' => 'audio/mpeg', 'wav' => 'audio/x-wav', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mov' => 'video/quicktime', 'avi' => 'video/x-msvideo');
    $toReturn = 0;
    if ($filePath != "" && file_exists($filePath)) {
        $file_extension = strtolower(substr(strrchr($filePath, "."), 1));
        // get mime type of the file.
        $ctype = '';
        if (!array_key_exists($file_extension, $allowed_ext)) {
            // mime type is not set, get from server settings
            if (function_exists('mime_content_type')) {
                $ctype = mime_content_type($file_path);
            } else {
                if (function_exists('finfo_file')) {
                    $finfo = finfo_open(FILEINFO_MIME);
                    // return mime type
                    $ctype = finfo_file($finfo, $file_path);
                    finfo_close($finfo);
                }
            }
            if ($ctype == '') {
                $ctype = "application/force-download";
            }
        } else {
            // get mime type defined by admin
            $ctype = $allowed_ext[$file_extension];
        }
        $oldPath = getcwd();
        // get current working directory
        $filePathArray = getPathArray($filePath);
        changeDirectory($filePathArray);
        $filename = getFilename($filePath);
        // Tell the browser the mime type of the file to be downloaded.
        header('Content-type: ' . $ctype);
        // Tell the browser what to call the file.
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header("Content-Length: " . filesize($filename));
        ob_clean();
        flush();
        $bytesSent = readfile_chunked($filename);
        $reverseFilePath = array();
        for ($i = 0; $i < count($filePathArray); ++$i) {
            $reverseFilePath[] = "..";
        }
        changeDirectory($reverseFilePath);
        // change back to the original directory
        $toReturn = 0;
        //exit;
    } else {
        $toReturn = 404;
        // file not found
    }
    return $toReturn;
}
Esempio n. 3
0
function getSpecific()
{
    $family = $_GET['family'];
    if (!isset($_GET['family'])) {
        throw new Exception("No se especifico [family]");
    }
    date_default_timezone_set("America/Monterrey");
    if (false) {
        echo file_get_contents(getFilename('specific'));
    } else {
        $query = file_get_contents('sql/specific.sql');
        $DB = new MxOptix();
        $DB->setQuery($query);
        $DB->bind_vars(':family', $family);
        $DB->exec();
        echo $DB->json();
    }
}
Esempio n. 4
0
function up()
{
    $petId = $_REQUEST['pet_id'];
    $nameType = empty($_REQUEST['name_type']) ? 0 : $_REQUEST['name_type'];
    $dirPath = ROOT . '/' . FILEPATH;
    // 文件夹路径
    $fileName = getFilename($petId);
    // 检测参数是否完成
    if (!isset($petId) || empty($petId) || !isset($_FILES['image']['name']) || empty($_FILES['image']['name'])) {
        return showReturn('上传参数错误');
    }
    if (!is_dir($dirPath)) {
        mk_dir($dirPath);
        // 文件夹不存在创建
    }
    // 上传文件
    $fileName = upload($_FILES['image'], $dirPath, 'jpg,gif,png', 5, $fileName);
    // 检测上传后文件是否存在。不存在便错误
    if (!file_exists($dirPath . $fileName)) {
        return showReturn('上传文件错误');
    }
    return showReturn('ok', TRUE, 'json', $fileName);
}
Esempio n. 5
0
 /**
  * Returns the HTML search <form> source, re-forms the SQL query for the
  * searh arguments, and over-writes the old querystring with the "search"
  * modified query string.
  *
  * @param  array   An array of searchable fields included in the SQL query
  * @return string  Returns the HTML search <form>
  * @access private
  */
 function _getSearchForm(&$strSqlQuery, &$arrSearchFields, &$intInstanceId)
 {
     global $HTTP_SERVER_VARS;
     $rty = $strSqlQuery;
     $rty = strpos($rty, 'ebpls_user');
     $strEol = $this->_strEol;
     $strDisplay = "";
     // set the new action argument for <form>
     $strNewQueryString = $this->updateQueryString(array("dhtoffset_{$intInstanceId}", "dhtorder_{$intInstanceId}", "dhtfield_{$intInstanceId}", "dhtkey_{$intInstanceId}"), null);
     // set the <form> source
     $strDisplay .= "<form method=\"POST\" name=\"_FRM\" action=\"" . $this->_strCurrScript . "?" . $strNewQueryString . "\">{$strEol}";
     $strDisplay .= "Search <input type=\"TEXT\" name=\"dhtkey_{$intInstanceId}\" value=\"\" size=\"10\" /> in {$strEol}";
     $strDisplay .= "<select name=\"dhtfield_{$intInstanceId}\">{$strEol}";
     foreach ($arrSearchFields as $key => $val) {
         $strLabel = is_numeric($key) ? $val : $key;
         $strDisplay .= "<option value=\"{$val}\">{$strLabel}</option>{$strEol}";
     }
     $strDisplay .= "</select>{$strEol}";
     $strDisplay .= "<input type=\"SUBMIT\" name=\"dhtSubmit_{$intInstanceId}\" value=\" Go \" /><br />{$strEol}<br>";
     if ($rty > 0) {
         $strDisplay .= "<span><input type=\"HIDDEN\" name=\"frmThreadId\" value=\"\"><input type=\"BUTTON\" name=\"frmBtnAdd\" value=\"Add User\" onClick=\"javascript:\npopwin('" . getFilename(eBPLS_PAGE_USER_ADD) . "?frmDomain={$strCurDomain}', 'adduser');\"> &nbsp;\n&nbsp;\n\n\n<input type=\"BUTTON\" name=\"frmBtnEdit\" value=\"Edit User\" onClick=\"javascript: EditUserCheck();\"> &nbsp; &nbsp;\n<input type=\"BUTTON\" name=\"BtnKick\" value=\"Kick User\" onClick=\"javascript: KickUser();\"> &nbsp; &nbsp;\n\n<input type=\"SUBMIT\" name=\"BtnUnlock\" value=\"Unlock User\" onClick=\"javascript: UnlockUser();\">\n<input type=\"BUTTON\" name=\"frmBtnDelete\" value=\"Delete User\" onClick=\"javascript: DeleteUserCheck();\">{$strEol} &nbsp; &nbsp;</span>";
     }
     //  $strDisplay .= "</form>$strEol";
     // re-form the SQL query for the search parameter
     if (!empty($GLOBALS["dhtkey_{$intInstanceId}"])) {
         $strCurWhere = $this->_getSqlClauseArgument($strSqlQuery, "WHERE");
         $strCurKey = str_replace(array('*', '?'), array('%', '_'), $GLOBALS["dhtkey_{$intInstanceId}"]);
         if ($GLOBALS["dhtfield_{$intInstanceId}"] == 'userlevel') {
             if ($strCurKey == 'CTC Officer') {
                 $strCurKey = '0';
             } elseif ($strCurKey == 'Application Officer') {
                 $strCurKey = '1';
             } elseif ($strCurKey == 'Assessment Officer') {
                 $strCurKey = '2';
             } elseif ($strCurKey == 'Payment Officer') {
                 $strCurKey = '3';
             } elseif ($strCurKey == 'Approving Officer') {
                 $strCurKey = '4';
             } elseif ($strCurKey == 'Releasing Officer') {
                 $strCurKey = '5';
             } elseif ($strCurKey == 'eBPLS Administrator') {
                 $strCurKey = '6';
             } elseif ($strCurKey == 'Root Administrator') {
                 $strCurKey = '7';
             }
         }
         $strNewWhere = $strCurWhere ? $strCurWhere . " AND " . $GLOBALS["dhtfield_{$intInstanceId}"] . " LIKE '%{$strCurKey}%'" : $GLOBALS["dhtfield_{$intInstanceId}"] . " LIKE '{$strCurKey}'";
         $strSqlQuery = $this->_setSqlClauseArgument($strSqlQuery, "WHERE", $strNewWhere);
         $HTTP_SERVER_VARS['QUERY_STRING'] = $this->updateQueryString(array("dhtkey_{$intInstanceId}", "dhtfield_{$intInstanceId}"), array($GLOBALS["dhtkey_{$intInstanceId}"], $GLOBALS["dhtfield_{$intInstanceId}"]));
     }
     return $strDisplay;
 }
Esempio n. 6
0
  	 <!-- form begins here-->
    <form name="prefSetForm" method="POST" action="?part=4&itemID_=6&busItem=Settings&permit_type=Settings&settings_type=Syssettings&item_id=Settings">
	<tr><td colspan=2 class=header align=center width=100%>SETTINGS</td></tr>
    
      <?php 
if ($GLOBALS['watbrowser'] == 'msie') {
    $getun = mysql_query("select * from ebpls_user where id = '{$ThUserData['id']}'");
    $geth = mysql_fetch_assoc($getun);
    $slevele = crypt_md5($geth[level], $decoder);
}
//echo "intUserLevel ==>".$intUserLevel."<BR>";
if ($GLOBALS['intUserLevel'] == eBPLS_USER_ADMIN || $GLOBALS['intUserLevel'] == eBPLS_ROOT_ADMIN) {
    ?>
      <!--
      |&nbsp;<A HREF="javascript:popitup4('<?php 
    echo getFilename(eBPLS_PAGE_REL_PENDQUEUE);
    ?>
')"><b>View Message Queue</b></A>&nbsp;
      |&nbsp;<A HREF="<?php 
    echo getURI(eBPLS_PAGE_MSGSTAT_LIST);
    ?>
"><b>Customer Support Groups</b></A>&nbsp;
      |&nbsp;<A HREF="<?php 
    echo getURI(eBPLS_PAGE_CATEG_LIST);
    ?>
"><b>Category Manager</b></A>&nbsp;|
        <br>
      
      |&nbsp;<A HREF="<?php 
    echo getURI(eBPLS_PAGE_ALLOWED_IP_LIST);
    ?>
Esempio n. 7
0
function contentManagerUpdates()
{
    //Database migration
    try {
        //update module name
        \Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "modules` (`id`, `name`, `distributor`, `description_variable`, `status`, `is_required`, `is_core`, `is_active`, `is_licensed`) VALUES ('72', 'ContentManager', 'DEV', 'TXT_CONTENTMANAGER_MODULE_DESCRIPTION', 'n', '0', '1', '1', '1')");
        //update navigation url
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=ContentManager&act=new' WHERE `area_id` = 5");
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=ContentManager' WHERE `area_id` = 6");
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "backend_areas` SET `uri` = 'index.php?cmd=ContentManager' WHERE `area_id` = 161");
        //Alter the content_page table structure
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'content_page', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'node_id' => array('type' => 'INT(11)', 'notnull' => false, 'after' => 'id'), 'nodeIdShadowed' => array('type' => 'INT(11)', 'notnull' => false, 'after' => 'node_id'), 'lang' => array('type' => 'INT(11)', 'after' => 'nodeIdShadowed'), 'type' => array('type' => 'VARCHAR(16)', 'after' => 'lang'), 'caching' => array('type' => 'TINYINT(1)', 'after' => 'type'), 'updatedAt' => array('type' => 'timestamp', 'after' => 'caching'), 'updatedBy' => array('type' => 'CHAR(40)', 'after' => 'updatedAt'), 'title' => array('type' => 'VARCHAR(255)', 'after' => 'updatedBy'), 'linkTarget' => array('type' => 'VARCHAR(16)', 'notnull' => false, 'after' => 'title'), 'contentTitle' => array('type' => 'VARCHAR(255)', 'after' => 'linkTarget'), 'slug' => array('type' => 'VARCHAR(255)', 'after' => 'contentTitle'), 'content' => array('type' => 'longtext', 'after' => 'slug'), 'sourceMode' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => '0', 'after' => 'content'), 'customContent' => array('type' => 'VARCHAR(64)', 'notnull' => false, 'after' => 'sourceMode'), 'useCustomContentForAllChannels' => array('type' => 'INT(2)', 'notnull' => false, 'after' => 'customContent'), 'applicationTemplate' => array('type' => 'VARCHAR(100)', 'notnull' => false, 'after' => 'useCustomContentForAllChannels'), 'useCustomApplicationTemplateForAllChannels' => array('type' => 'TINYINT(2)', 'after' => 'applicationTemplate'), 'cssName' => array('type' => 'VARCHAR(255)', 'notnull' => false, 'after' => 'useCustomApplicationTemplateForAllChannels'), 'cssNavName' => array('type' => 'VARCHAR(255)', 'notnull' => false, 'after' => 'cssName'), 'skin' => array('type' => 'INT(11)', 'notnull' => false, 'after' => 'cssNavName'), 'useSkinForAllChannels' => array('type' => 'INT(2)', 'notnull' => false, 'after' => 'skin'), 'metatitle' => array('type' => 'VARCHAR(255)', 'notnull' => false, 'after' => 'useSkinForAllChannels'), 'metadesc' => array('type' => 'text', 'after' => 'metatitle'), 'metakeys' => array('type' => 'text', 'after' => 'metadesc'), 'metarobots' => array('type' => 'VARCHAR(7)', 'notnull' => false, 'after' => 'metakeys'), 'start' => array('type' => 'timestamp', 'after' => 'metarobots'), 'end' => array('type' => 'timestamp', 'after' => 'start'), 'editingStatus' => array('type' => 'VARCHAR(16)', 'after' => 'end'), 'protection' => array('type' => 'INT(11)', 'after' => 'editingStatus'), 'frontendAccessId' => array('type' => 'INT(11)', 'after' => 'protection'), 'backendAccessId' => array('type' => 'INT(11)', 'after' => 'frontendAccessId'), 'display' => array('type' => 'TINYINT(1)', 'after' => 'backendAccessId'), 'active' => array('type' => 'TINYINT(1)', 'after' => 'display'), 'target' => array('type' => 'VARCHAR(255)', 'notnull' => false, 'after' => 'active'), 'module' => array('type' => 'VARCHAR(255)', 'notnull' => false, 'after' => 'target'), 'cmd' => array('type' => 'VARCHAR(50)', 'notnull' => true, 'default' => '', 'after' => 'module')), array('node_id' => array('fields' => array('node_id', 'lang'), 'type' => 'UNIQUE'), 'IDX_D8E86F54460D9FD7' => array('fields' => array('node_id'))), 'InnoDB', '', array('node_id' => array('table' => DBPREFIX . 'content_node', 'column' => 'id', 'onDelete' => 'SET NULL', 'onUpdate' => 'NO ACTION')));
    } catch (\Cx\Lib\UpdateException $e) {
        return "Error: {$e->sql}";
    }
    $virtualComponents = array('Agb', 'Ids', 'Imprint', 'Privacy');
    //migrating custom application template
    $pageRepo = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
    $themeRepo = new \Cx\Core\View\Model\Repository\ThemeRepository();
    $pages = $pageRepo->findBy(array('type' => \Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION));
    foreach ($pages as $page) {
        try {
            //virtual components do not migrating custom application template
            if (in_array(ucfirst($page->getModule()), $virtualComponents)) {
                continue;
            }
            $designTemplateName = $page->getSkin() ? $themeRepo->findById($page->getSkin())->getFoldername() : $themeRepo->getDefaultTheme()->getFoldername();
            $cmd = !$page->getCmd() ? 'Default' : ucfirst($page->getCmd());
            $moduleFolderName = contrexx_isCoreModule($page->getModule()) ? 'core_modules' : 'modules';
            $themesPath = ASCMS_THEMES_PATH . '/' . $designTemplateName;
            //check common module or core_module folder exists
            if (!file_exists($themesPath . '/' . $moduleFolderName)) {
                \Cx\Lib\FileSystem\FileSystem::make_folder($themesPath . '/' . $moduleFolderName);
            }
            //check module's folder exists
            if (!file_exists($themesPath . '/' . $moduleFolderName . '/' . $page->getModule())) {
                \Cx\Lib\FileSystem\FileSystem::make_folder($themesPath . '/' . $moduleFolderName . '/' . $page->getModule());
            }
            //check module's template folder exists
            if (!file_exists($themesPath . '/' . $moduleFolderName . '/' . $page->getModule() . '/Template')) {
                \Cx\Lib\FileSystem\FileSystem::make_folder($themesPath . '/' . $moduleFolderName . '/' . $page->getModule() . '/Template');
            }
            //check module's Frontend folder exists
            if (!file_exists($themesPath . '/' . $moduleFolderName . '/' . $page->getModule() . '/Template/Frontend')) {
                \Cx\Lib\FileSystem\FileSystem::make_folder($themesPath . '/' . $moduleFolderName . '/' . $page->getModule() . '/Template/Frontend');
            }
            $targetPath = $themesPath . '/' . $moduleFolderName . '/' . $page->getModule() . '/Template/Frontend';
            $applicationTemplateName = getFilename($targetPath, $cmd . '_custom_' . FWLanguage::getLanguageCodeById($page->getLang()));
            if (file_exists($targetPath)) {
                //create a application template file
                $file = new \Cx\Lib\FileSystem\File($targetPath . '/' . $applicationTemplateName);
                $file->write($page->getContent());
            }
            //update application template
            $page->setContent('{APPLICATION_DATA}');
            $page->setApplicationTemplate($applicationTemplateName);
            $page->setUseCustomApplicationTemplateForAllChannels(1);
            \Env::get('em')->persist($page);
            \Env::get('em')->flush();
        } catch (\Exception $e) {
            throw new \Exception('Error :' . $e);
        }
    }
    return 'Application template migrated successfully.';
}
Esempio n. 8
0
function clearLog()
{
    $handle = fopen(getFilename(), 'w');
    if ($handle === false) {
        printDebug("DEBUG: ERROR: could not open file.");
        return 0;
    }
    fclose($handle);
}
function loadFile($type, $name)
{
    static $files = array();
    if (isset($files[$type][$name])) {
        return TRUE;
    }
    $filename = getFilename($type, $name);
    if ($filename) {
        include_once "{$filename}";
        $files[$type][$name] = TRUE;
        return TRUE;
    }
    return FALSE;
}
Esempio n. 10
0
        // and return the id.
        if (isset($_FILES['file'])) {
            // read body from uploaded form
            $file = $_FILES['file'];
            $id = uniqid();
            $filename = getFilename($id);
            move_uploaded_file($file['tmp_name'], $filename);
            echo $id;
        } else {
            // read raw body from post request
            $body = @file_get_contents('php://input');
            if ($body === false) {
                $body = '';
            }
            $id = uniqid();
            file_put_contents(getFilename($id), $body);
            echo $id;
        }
    }
}
// cleanup files older than 1 hour
// http://stackoverflow.com/q/6411451/1262753
if ($dir = opendir($tmp)) {
    $now = time();
    while (false !== ($file = readdir($dir))) {
        $filename = "{$tmp}/{$file}";
        if (is_file($filename) && filemtime($filename) <= $now - 60 * 60) {
            unlink($filename);
        }
    }
    closedir($dir);
function getFilename($path, $name, $iter = 0)
{
    $check = $path . safeFilename($name) . ($iter != 0 ? "-" . $iter : "") . ".nzb";
    if (!file_exists($check)) {
        return $check;
    } else {
        return getFilename($path, $name, ++$iter);
    }
}
Esempio n. 12
0
 echo '<form name="actions" action="index.php?multComp" method="post">';
 echo '<input type="hidden" value="" name="action">';
 boxTop();
 $handle = opendir("pictures/multcomp/");
 $file = "";
 $num = 0;
 $pics = array();
 while (false !== ($file = readdir($handle))) {
     if ($file != "." && $file != ".." && substr($file, 0, 3) != "tn_") {
         $pics[] = $file;
     }
 }
 sort($pics, SORT_NUMERIC);
 foreach ($pics as $pic) {
     $num++;
     $count = getFilename($pic);
     if ($num == 1) {
         echo '<h2>At Present, 4 Designs</h2><br />';
         echo $clickToEnlarge;
     }
     echo '<div class="black-box">';
     echo '<p><a href="pictures/multcomp/' . $pic . '"';
     if ($num >= 1 && $num < 4) {
         echo ' onmouseover="doTooltip(event,\'<b style=font-size:16px;>Revolution, Revelation, Evolution...</b><br />Understanding change comes only after a Revelation... Revolution &amp; Evolution.\')" onmouseout="hideTip()"';
     } elseif ($num >= 4 && $num < 7) {
         echo ' onmouseover="doTooltip(event,\'<b style=font-size:16px;>Number, Weigh, Divide</b><br />Inspired by early Christian story of Gods graffiti, solution to problems at hand.<br />Biblical reference: Daniel Chapter 5, Bible\')" onmouseout="hideTip()"';
     } elseif ($num >= 7 && $num < 10) {
         echo ' onmouseover="doTooltip(event,\'<b style=font-size:16px;>Hallelujah</b><br />Calling for peace. The issue continually aborted throughout the years.\')" onmouseout="hideTip()"';
     } elseif ($num >= 10 && $num < 13) {
         echo ' onmouseover="doTooltip(event,\'<b style=font-size:16px;>Delete the Need to Understand</b><br />Was provoked by the current president at the time. It remains to be a talisman for energy to draw out one wo/man in the name of love.\')" onmouseout="hideTip()"';
     }
     increaseCount($results["pitch"], $pitch);
 }
 // $stmt2->bind_param("i", $i);
 // $stmt2->execute();
 // $stmt2->bind_result($data);
 // $stmt2->fetch();
 if ($num_submissions >= 2) {
     // when >= 3: at least 60% of submissions must agree
     // when 2: both must agree
     $threshold = $num_submissions == 2 ? 2 : $num_submissions * 0.6;
     $prediction = array();
     getPrediction($prediction, $results["symbol"], "symbol", $threshold);
     getPrediction($prediction, $results["duration"], "duration", $threshold);
     getPrediction($prediction, $results["pitch"], "pitch", $threshold);
     if (count($prediction) == 3) {
         $filename = getFilename($prediction, $i);
         $res = $mysqli->query("SELECT data FROM pictures WHERE id = {$i}");
         $row = $res->fetch_row();
         $data = $row[0];
         if (saveFile($filename, $data)) {
             echo "{$filename} saved";
             $exported++;
         } else {
             echo "could not save file";
         }
     } else {
         echo "skipped: inconclusive submissions";
     }
 } else {
     echo "skipped: not enough submissions";
 }
Esempio n. 14
0
?frmThreadId='+document._FRM.frmThreadId.value+'&frmDomain=<?php 
echo $strCurDomain;
?>
', 'deleteuser');
	return true;
}
function EditUserCheck()
{
	var _FRM = document._FRM;
	if (isNaN(_FRM.frmThreadId.value) == true)
	{
		alert("Select Valid User.");
		return false;
	}
	popwin('<?php 
echo getFilename(eBPLS_PAGE_USER_UPDATE);
?>
?frmThreadId='+_FRM.frmThreadId.value+'&frmDomain=<?php 
echo $strCurDomain;
?>
', 'edituser');
	return true;
}
function UnlockUser()
{
	var _FRM = document._FRM;
	if (isNaN(_FRM.frmThreadId.value) == true)
	{
		alert("Select Valid User.");
		return false;
	}
Esempio n. 15
0
<?php

include 'include/config.php';
include 'include/db.php';
dbconnect();
include 'include/checklogin.php';
$id = $_GET['id'];
$data = $_GET['data'];
$image = getImg($_COOKIE['user_id'], $id);
$filename = getFilename($_COOKIE['user_id'], $id);
$file_extension = strtolower(substr(strrchr($filename, "."), 1));
$ctype = "";
switch ($file_extension) {
    case "gif":
        $ctype = "image/gif";
        break;
    case "png":
        $ctype = "image/png";
        break;
    case "jpeg":
    case "jpg":
        $ctype = "image/jpg";
        break;
    case "GIF":
        $ctype = "image/gif";
        break;
    case "PNG":
        $ctype = "image/png";
        break;
    case "JPEG":
    case "JPG":
Esempio n. 16
0
	</head>
		<?php 
}
if (!isset($part)) {
    $part = "";
}
// 2008.04.25
if (empty($part) || $part == eBPLS_PAGE_LOGIN || intval($intUserLevel) < 0) {
    // if not logged-in you start in log-in page else you start in main page
    if ($part != 4) {
        $part = $intUserLevel < 0 ? eBPLS_PAGE_LOGIN : eBPLS_PAGE_MAIN;
    }
}
/*
*/
include_once getFilename($part);
if ($part != 1) {
    require_once "includes/eBPLS_footer.php";
}
if ($GLOBALS['watbrowser'] == 'msie') {
    // log this system activity for ie
    if ($ThUserData[id] != '') {
        foreach ($GLOBALS['HTTP_POST_VARS'] as $key => $val) {
            $strPostVarData[] = "{$key} = {$val}";
        }
        //if (is_array($strPostVarData)) $strPostVarData = implode('|-|', $strPostVarData);
        $strUpdatePostVar = $strPostVarData ? "postvarval = '{$strPostVarData}'," : "";
        $intPartId = empty($GLOBALS['part']) ? getCurrFilePartNum() : $GLOBALS['part'];
        $getun = mysql_query("select * from ebpls_user where id = '{$ThUserData['id']}'");
        $geth = mysql_fetch_assoc($getun);
        $levele = crypt_md5($geth[level], $decoder);
Esempio n. 17
0
 /**
  * Appends file mod time as querystring only if this is a locally hosted file
  * @todo account for an already existing querystring on the file
  * @param   string  $file   the file relative to the include path (or remote asset)
  * @return  mixed   the file with appended mod time or false if file doesn't exist
  */
 public function appendFileModTime($file)
 {
     // this is not a remotely hosted file
     if (strpos($file, 'http') !== 0) {
         // if it doesn't exist locally skip it
         if (!\file_exists_incpath($file)) {
             return false;
         }
         // append the filetime to force a reload if the file contents changes
         $file .= '?' . \filemtime(\getFilename($file));
     }
     return $file;
 }