1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Fixes #2095 - Deactivation of extended fields.

This commit is contained in:
Cameron 2017-01-10 11:25:57 -08:00
parent 010b1ca3ff
commit 10c9e53afd

View File

@ -596,7 +596,7 @@ e107::js('footer-inline', js());
// do something
}
function addPageActivate()
private function addPageActivate()
{
$ue = e107::getUserExt();
$tp = e107::getParser();
@ -636,7 +636,35 @@ e107::js('footer-inline', js());
}
private function addPageDeactivate()
{
$tp = e107::getParser();
$sql = e107::getDb();
$ue = e107::getUserExt();
$ret = "";
foreach(array_keys($_POST['deactivate']) as $f)
{
$f = $tp->filter($f);
if($ue->user_extended_remove($f, $f))
{
$ret .= EXTLAN_68." $f ".EXTLAN_72."<br />";
if(is_readable(e_CORE."sql/extended_".$f.".php"))
{
$ret .= ($sql->gen("DROP TABLE ".MPREFIX."user_extended_".$f)) ? LAN_DELETED." user_extended_".$f."<br />" : LAN_DELETED_FAILED." user_extended_".$f."<br />";
}
}
else
{
$ret .= EXTLAN_70." $f ".EXTLAN_73."<br />";
}
}
e107::getLog()->add('EUF_12',implode(', ',$_POST['deactivate']),E_LOG_INFORMATIVE,'');
e107::getMessage()->addSuccess($ret);
return $ret;
}
@ -647,6 +675,7 @@ e107::js('footer-inline', js());
$ue = e107::getUserExt();
$this->addPageActivate();
$this->addPageDeactivate();
// Get list of current extended fields