1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +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>

View File

@@ -54,7 +54,7 @@ define("EPL_ADLAN_39", "The file could not be uploaded as the ".e_PLUGIN." folde
define("EPL_ADLAN_40", "Admin Message");
define("EPL_ADLAN_41", "That file does not appear to be a valid .zip or .tar archive.");
define("EPL_ADLAN_42", "An error has occurred, unable to un-archive the file");
define("EPL_ADLAN_43", "Your plugin has been uploaded and unzipped, please scroll down to see your plugin in the list.");
define("EPL_ADLAN_43", "Your plugin has been uploaded and unzipped; to install go to <a href='".e_ADMIN."plugin.php?avail'>the uninstalled plugins page</a>.");
define("EPL_ADLAN_44", "Auto plugin upload and extraction is disabled as upload to your plugins folder is not allowed at present - if you want to be able to do this, please change the permissions on your ".e_PLUGIN." folder to allow uploads.");
define("EPL_ADLAN_45", "Your menu item has been uploaded and unzipped, to activate go to <a href='".e_ADMIN."menus.php'>your menus page</a>.");
define("EPL_ADLAN_46", "PCLZIP extract error:");