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:
@@ -343,7 +343,6 @@ class pluginManager{
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* e_PLUGIN is writable - continue */
|
/* e_PLUGIN is writable - continue */
|
||||||
$pref['upload_storagetype'] = "1";
|
|
||||||
require_once(e_HANDLER."upload_handler.php");
|
require_once(e_HANDLER."upload_handler.php");
|
||||||
$fileName = $file_userfile['name'][0];
|
$fileName = $file_userfile['name'][0];
|
||||||
$fileSize = $file_userfile['size'][0];
|
$fileSize = $file_userfile['size'][0];
|
||||||
@@ -367,12 +366,7 @@ class pluginManager{
|
|||||||
|
|
||||||
if ($fileSize)
|
if ($fileSize)
|
||||||
{
|
{
|
||||||
|
|
||||||
$opref = $pref['upload_storagetype'];
|
|
||||||
$pref['upload_storagetype'] = 1; /* temporarily set upload type pref to flatfile */
|
|
||||||
$uploaded = file_upload(e_PLUGIN);
|
$uploaded = file_upload(e_PLUGIN);
|
||||||
$pref['upload_storagetype'] = $opref;
|
|
||||||
|
|
||||||
$archiveName = $uploaded[0]['name'];
|
$archiveName = $uploaded[0]['name'];
|
||||||
|
|
||||||
/* attempt to unarchive ... */
|
/* attempt to unarchive ... */
|
||||||
@@ -407,7 +401,7 @@ class pluginManager{
|
|||||||
|
|
||||||
/* ok it looks like the unarc succeeded - continue */
|
/* 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'], "/")));
|
$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"))
|
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 */
|
/* upload is a plugin */
|
||||||
e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
|
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 */
|
/* upload is a menu */
|
||||||
e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
|
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 */
|
/* attempt to delete uploaded archive */
|
||||||
@unlink(e_PLUGIN.$archiveName);
|
@unlink(e_PLUGIN.$archiveName);
|
||||||
@@ -648,7 +647,6 @@ class pluginManager{
|
|||||||
<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
|
<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
|
||||||
<input class='tbox' type='file' name='file_userfile[]' size='50' />
|
<input class='tbox' type='file' name='file_userfile[]' size='50' />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -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_40", "Admin Message");
|
||||||
define("EPL_ADLAN_41", "That file does not appear to be a valid .zip or .tar archive.");
|
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_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_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_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:");
|
define("EPL_ADLAN_46", "PCLZIP extract error:");
|
||||||
|
Reference in New Issue
Block a user