1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 18:14:26 +02:00

Make code a bit more robust, fix table format

This commit is contained in:
e107steved
2010-10-21 13:07:40 +00:00
parent 346d71c352
commit bc45f2809b
2 changed files with 8 additions and 10 deletions

View File

@@ -343,7 +343,6 @@ class pluginManager{
else
{
/* e_PLUGIN is writable - continue */
$pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php");
$fileName = $file_userfile['name'][0];
$fileSize = $file_userfile['size'][0];
@@ -367,12 +366,7 @@ class pluginManager{
if ($fileSize)
{
$opref = $pref['upload_storagetype'];
$pref['upload_storagetype'] = 1; /* temporarily set upload type pref to flatfile */
$uploaded = file_upload(e_PLUGIN);
$pref['upload_storagetype'] = $opref;
$archiveName = $uploaded[0]['name'];
/* attempt to unarchive ... */
@@ -407,7 +401,7 @@ class pluginManager{
/* ok it looks like the unarc succeeded - continue */
/* get folder name ... */
/* get folder name ... */
$folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
if(file_exists(e_PLUGIN.$folderName."/plugin.php") || file_exists(e_PLUGIN.$folderName."/plugin.xml"))
@@ -415,11 +409,16 @@ class pluginManager{
/* upload is a plugin */
e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
}
else
elseif(file_exists(e_PLUGIN.$folderName."/theme.php") || file_exists(e_PLUGIN.$folderName."/theme.xml"))
{
/* upload is a menu */
e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
}
else
{
/* upload is unlocatable */
e107::getRender()->tablerender(EPL_ADLAN_40, 'Unknown file: '.$fileList[0]['stored_filename']);
}
/* attempt to delete uploaded archive */
@unlink(e_PLUGIN.$archiveName);
@@ -648,7 +647,6 @@ class pluginManager{
<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
<input class='tbox' type='file' name='file_userfile[]' size='50' />
</td>
</tr>
</tr>
</table>