示例#1
0
if ($showperms) {
    echo '<th class="file_perms right">' . i18n_r('PERMS') . '</th>';
}
echo '<th class="file_date right">' . i18n_r('DATE') . '</th>';
echo '<th class="file_actions"><!-- actions --></th></tr>';
echo '</thead><tbody>';
if (count($dirsSorted) != 0) {
    $foldercount = 0;
    // show folders
    foreach ($dirsSorted as $upload) {
        # check to see if folder is empty
        $directory_delete = null;
        if (check_empty_folder($path . $upload['name']) && $allowdelete) {
            $directory_delete = '<a class="delconfirm" title="' . i18n_r('DELETE_FOLDER') . ': ' . rawurlencode($upload['name']) . '" href="deletefile.php?path=' . $urlPath . '&amp;folder=' . rawurlencode($upload['name']) . '&amp;nonce=' . get_nonce("delete", "deletefile.php") . '">&times;</a>';
        }
        $directory_size = '<span>' . folder_items($path . $upload['name']) . ' ' . i18n_r('ITEMS') . '</span>';
        echo '<tr class="all folder ' . $upload['name'] . '" >';
        // echo '<td class="imgthumb"><i class="file ext- fa fa-3x fa-fw fa-folder-o"></i></td>';
        echo '<td class="imgthumb"></td>';
        $adm = getRelPath($path, GSDATAUPLOADPATH) . rawurlencode($upload['name']);
        $folderhref = 'upload.php?' . merge_queryString(array('path' => $adm));
        echo '<td>' . getUploadIcon('.') . '</span><a href="' . $folderhref . '" ><strong>' . htmlspecialchars($upload['name']) . '</strong></a></td>';
        echo '<td class="file_size right"><span>' . $directory_size . '</span></td>';
        // get the file permissions.
        if ($showperms) {
            $filePerms = substr(sprintf('%o', fileperms($path . $upload['name'])), -4);
            if ($isUnixHost) {
                $fileOwner = function_exists('posix_getpwuid') ? posix_getpwuid(fileowner($path . $upload['name'])) : '';
                $fileOwnerName = isset($fileOwner['name']) ? $fileOwner['name'] : '';
            } else {
                $fileOwnerName = getenv('USERNAME');
示例#2
0
/**
 * Is Folder Empty
 *
 * Check to see if a folder is empty or not
 * 
 * @param string $folder
 * @return bool true if empty
 */
function check_empty_folder($folder)
{
    return folder_items($folder) == 0;
}
示例#3
0
function gs_anonymousdata()
{
    #grab data from this installation
    if (isset($_POST['preview'])) {
        global $LANG, $TIMEZONE, $SITEURL, $live_plugins, $thisfile_anony;
        $missing_modules = array();
        $php_modules = get_loaded_extensions();
        if (!in_arrayi('curl', $php_modules)) {
            $missing_modules[] = 'curl';
            $email_not_curl = true;
        } else {
            $email_not_curl = false;
        }
        if (!in_arrayi('gd', $php_modules)) {
            $missing_modules[] = 'GD';
        }
        if (!in_arrayi('zip', $php_modules)) {
            $missing_modules[] = 'ZipArchive';
        }
        if (!in_arrayi('SimpleXML', $php_modules)) {
            $missing_modules[] = 'SimpleXML';
        }
        if (function_exists('apache_get_modules')) {
            if (!in_arrayi('mod_rewrite', apache_get_modules())) {
                $missing_modules[] = 'mod_rewrite';
            }
        }
        $lastModified = @filemtime(GSDATAOTHERPATH . '.htaccess');
        if ($lastModified == NULL) {
            $lastModified = filemtime(utf8_decode(GSDATAOTHERPATH . '.htaccess'));
        }
        $preview_data = @new SimpleXMLExtended('<data></data>');
        $preview_data->addChild('submission_date', date('c'));
        $preview_data->addChild('getsimple_version', get_site_version(false));
        $preview_data->addChild('language', $LANG);
        $preview_data->addChild('timezone', $TIMEZONE);
        $preview_data->addChild('php_version', PHP_VERSION);
        $preview_data->addChild('server_type', PHP_OS);
        $preview_data->addChild('modules_missing', json_encode($missing_modules));
        $preview_data->addChild('number_pages', folder_items(GSDATAPAGESPATH) - 1);
        $preview_data->addChild('number_plugins', count($live_plugins));
        $preview_data->addChild('number_files', count(glob_recursive(GSDATAUPLOADPATH . '*')));
        $preview_data->addChild('number_themes', folder_items(GSTHEMESPATH));
        $preview_data->addChild('number_backups', count(getFiles(GSBACKUPSPATH . 'zip')));
        $preview_data->addChild('number_users', folder_items(GSUSERSPATH) - 1);
        $preview_data->addChild('domain_tld', get_tld_from_url($SITEURL));
        $preview_data->addChild('install_date', date('m-d-Y', $lastModified));
        $preview_data->addChild('category', $_POST['category']);
        $preview_data->addChild('link_back', $_POST['link_back']);
        XMLsave($preview_data, GSDATAOTHERPATH . 'anonymous_data.xml');
    }
    # post data to server
    if (isset($_POST['send'])) {
        global $thisfile_anony;
        $xml = file_get_contents(GSDATAOTHERPATH . 'anonymous_data.xml');
        $success = i18n_r($thisfile_anony . '/ANONY_SUCCESS');
        $php_modules = get_loaded_extensions();
        if (in_arrayi('curl', $php_modules)) {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_TIMEOUT, 4);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_URL, 'http://get-simple.info/api/anonymous/?data=' . urlencode($xml));
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml'));
            $result = curl_exec($ch);
            curl_close($ch);
        } else {
            sendmail('*****@*****.**', 'Anonymous Data Submission', $xml);
        }
    }
    global $thisfile_anony;
    ?>
	<style>
		form#anondata p {margin-bottom:5px;}
		form#anondata label {display:block;width:220px;float:left;line-height:35px;}
		form#anondata select.text {width:auto;float:left;}
	</style>
	<h3><?php 
    i18n($thisfile_anony . '/ANONY_TITLE');
    ?>
</h3>
	
	<?php 
    if (isset($success)) {
        echo '<p style="color:#669933;"><b>' . $success . '</b></p>';
    }
    ?>
	
	<form method="post" id="anondata" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
">
		
		<?php 
    if (isset($preview_data)) {
        ?>
			<p><?php 
        i18n($thisfile_anony . '/ANONY_CONFIRM');
        ?>
</p>
			<div class="unformatted"><code><?php 
        echo htmlentities(formatXmlString(file_get_contents(GSDATAOTHERPATH . 'anonymous_data.xml')));
        ?>
</code></div>
			<p class="submit"><br /><input type="submit" class="submit" value="<?php 
        i18n($thisfile_anony . '/ANONY_SEND_BTN');
        ?>
" name="send" /> &nbsp;&nbsp;<?php 
        i18n('OR');
        ?>
&nbsp;&nbsp; <a class="cancel" href="plugins.php?cancel"><?php 
        i18n('CANCEL');
        ?>
</a></p>		
		<?php 
    } else {
        ?>
 
			<p><?php 
        i18n($thisfile_anony . '/ANONY_PARAGRAPH');
        ?>
</p>
			<p><?php 
        i18n($thisfile_anony . '/ANONY_PARAGRAPH2');
        ?>
</p>
			<p class="clearfix" ><label><?php 
        i18n($thisfile_anony . '/ANONY_CATEGORY');
        ?>
:</label>
					<select name="category" class="text">
						<option value=""></option>
						<option value="Arts"><?php 
        i18n($thisfile_anony . '/ANONY_ARTS');
        ?>
</option>
						<option value="Business"><?php 
        i18n($thisfile_anony . '/ANONY_BUSINESS');
        ?>
</option>
						<option value="Children"><?php 
        i18n($thisfile_anony . '/ANONY_CHILDREN');
        ?>
</option>
						<option value="Computer &amp; Internet"><?php 
        i18n($thisfile_anony . '/ANONY_INTERNET');
        ?>
</option>
						<option value="Culture &amp; Religion"><?php 
        i18n($thisfile_anony . '/ANONY_RELIGION');
        ?>
</option>
						<option value="Education"><?php 
        i18n($thisfile_anony . '/ANONY_EDUCATION');
        ?>
</option>
						<option value="Employment"><?php 
        i18n($thisfile_anony . '/ANONY_EMPLOYMENT');
        ?>
</option>
						<option value="Entertainment"><?php 
        i18n($thisfile_anony . '/ANONY_ENTERTAINMENT');
        ?>
</option>
						<option value="Money &amp; Finance"><?php 
        i18n($thisfile_anony . '/ANONY_FINANCE');
        ?>
</option>
						<option value="Food"><?php 
        i18n($thisfile_anony . '/ANONY_FOOD');
        ?>
</option>
						<option value="Games"><?php 
        i18n($thisfile_anony . '/ANONY_GAMES');
        ?>
</option>
						<option value="Government"><?php 
        i18n($thisfile_anony . '/ANONY_GOVERNMENT');
        ?>
</option>
						<option value="Health &amp; Fitness"><?php 
        i18n($thisfile_anony . '/ANONY_HEALTHFITNESS');
        ?>
</option>
						<option value="HighTech"><?php 
        i18n($thisfile_anony . '/ANONY_HIGHTECH');
        ?>
</option>
						<option value="Hobbies &amp; Interests"><?php 
        i18n($thisfile_anony . '/ANONY_HOBBIES');
        ?>
</option>
						<option value="Law"><?php 
        i18n($thisfile_anony . '/ANONY_LAW');
        ?>
</option>
						<option value="Life Family Issues"><?php 
        i18n($thisfile_anony . '/ANONY_LIFEFAMILY');
        ?>
</option>
						<option value="Marketing"><?php 
        i18n($thisfile_anony . '/ANONY_MARKETING');
        ?>
</option>
						<option value="Media"><?php 
        i18n($thisfile_anony . '/ANONY_MEDIA');
        ?>
</option>
						<option value="Misc"><?php 
        i18n($thisfile_anony . '/ANONY_MISC');
        ?>
</option>
						<option value="Movies &amp; Television"><?php 
        i18n($thisfile_anony . '/ANONY_MOVIES');
        ?>
</option>
						<option value="Music &amp; Radio"><?php 
        i18n($thisfile_anony . '/ANONY_MUSIC');
        ?>
</option>
						<option value="Nature"><?php 
        i18n($thisfile_anony . '/ANONY_NATURE');
        ?>
</option>
						<option value="Non-Profit"><?php 
        i18n($thisfile_anony . '/ANONY_NONPROFIT');
        ?>
</option>
						<option value="Personal Homepages"><?php 
        i18n($thisfile_anony . '/ANONY_PERSONAL');
        ?>
</option>
						<option value="Pets"><?php 
        i18n($thisfile_anony . '/ANONY_PETS');
        ?>
</option>
						<option value="Home &amp; Garden"><?php 
        i18n($thisfile_anony . '/ANONY_HOMEGARDEN');
        ?>
</option>
						<option value="Real Estate"><?php 
        i18n($thisfile_anony . '/ANONY_REALESTATE');
        ?>
</option>
						<option value="Science &amp; Technology"><?php 
        i18n($thisfile_anony . '/ANONY_SCIENCE');
        ?>
</option>
						<option value="Shopping &amp; Services"><?php 
        i18n($thisfile_anony . '/ANONY_SHOPPING');
        ?>
</option>
						<option value="Society"><?php 
        i18n($thisfile_anony . '/ANONY_SOCIETY');
        ?>
</option>
						<option value="Sports"><?php 
        i18n($thisfile_anony . '/ANONY_SPORTS');
        ?>
</option>
						<option value="Tourism"><?php 
        i18n($thisfile_anony . '/ANONY_TOURISM');
        ?>
</option>
						<option value="Transportation"><?php 
        i18n($thisfile_anony . '/ANONY_TRANSPORTATION');
        ?>
</option>
						<option value="Travel"><?php 
        i18n($thisfile_anony . '/ANONY_TRAVEL');
        ?>
</option>
						<option value="X-rated"><?php 
        i18n($thisfile_anony . '/ANONY_XRATED');
        ?>
</option>
					</select>
			</p>
			<p class="clearfix" ><label><?php 
        i18n($thisfile_anony . '/ANONY_LINK');
        ?>
</label><select class="text" name="link_back"><option></option><option value="yes" ><?php 
        i18n($thisfile_anony . '/ANONY_YES');
        ?>
</option><option value="no" ><?php 
        i18n($thisfile_anony . '/ANONY_NO');
        ?>
</option></select></p>
			<p style="color:#cc0000;font-size:11px;" >* <?php 
        i18n($thisfile_anony . '/ANONY_DISCLAIMER');
        ?>
</p>
			<p class="submit"><br /><input type="submit" class="submit" value="<?php 
        i18n($thisfile_anony . '/ANONY_PREVIEW_BTN');
        ?>
" name="preview" /> &nbsp;&nbsp;<?php 
        i18n('OR');
        ?>
&nbsp;&nbsp; <a class="cancel" href="plugins.php?cancel"><?php 
        i18n('CANCEL');
        ?>
</a></p>
		<?php 
    }
    ?>
	</form>

	<?php 
}