implementation of PRG + minor fixes
This commit is contained in:
72
index.php
72
index.php
@@ -178,29 +178,30 @@ if($bUserOk && $sAction!=Databap::EXT_ACCESS)
|
||||
case 'css':
|
||||
$sResult = $oDatabap->getStyleSheet();
|
||||
break;
|
||||
}
|
||||
|
||||
//Admin actions
|
||||
if($oDatabap->getUserClearance()==Databap::CLEARANCE_ADMIN)
|
||||
{
|
||||
switch($sAction)
|
||||
{
|
||||
case 'add_user':
|
||||
$asInfo = explode('-', strtolower($oUser));
|
||||
$sResult = 'User added. Id='.$oDatabap->addUser($asInfo[0], $asInfo[1], $asInfo[2], array_key_exists(3, $asInfo)?$asInfo[3]:'');
|
||||
break;
|
||||
case 'build_index':
|
||||
$oDatabap->buildCompleteIndex();
|
||||
$sResult = 'Index ok';
|
||||
break;
|
||||
case 'install_queries':
|
||||
$oMySqlInstall = new MySqlManager(Settings::DB_SERVER, Settings::DB_LOGIN, Settings::DB_PASS, Settings::DB_NAME, Databap::getSqlOptions(), Settings::DB_ENC);
|
||||
$sResult = $oMySqlInstall->getFullInstallQuery();
|
||||
break;
|
||||
case 'reset_chan_safe_names':
|
||||
$sResult = $oDatabap->resetChanSafeNames();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
//Admin actions
|
||||
if($oDatabap->getUserClearance()==Databap::CLEARANCE_ADMIN)
|
||||
{
|
||||
switch($sAction)
|
||||
{
|
||||
case 'add_user':
|
||||
$asInfo = explode('-', strtolower($oUser));
|
||||
$sResult = 'User added. Id='.$oDatabap->addUser($asInfo[0], $asInfo[1], $asInfo[2], array_key_exists(3, $asInfo)?$asInfo[3]:'');
|
||||
break;
|
||||
case 'build_index':
|
||||
$oDatabap->buildCompleteIndex();
|
||||
$sResult = 'Index ok';
|
||||
break;
|
||||
case 'install_queries':
|
||||
$oMySqlInstall = new MySqlManager(Settings::DB_SERVER, Settings::DB_LOGIN, Settings::DB_PASS, Settings::DB_NAME, Databap::getSqlOptions(), Settings::DB_ENC);
|
||||
$sResult = $oMySqlInstall->getFullInstallQuery();
|
||||
break;
|
||||
case 'reset_chan_safe_names':
|
||||
$sResult = $oDatabap->resetChanSafeNames();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Loading a page
|
||||
@@ -218,19 +219,20 @@ elseif($bUserOk && $sAction==Databap::EXT_ACCESS)
|
||||
case 'rss': //RSS Feed
|
||||
$sResult = $oDatabap->getRss($sCategory);
|
||||
break;
|
||||
default:
|
||||
//Restricted actions
|
||||
if($oDatabap->getUserClearance()==Databap::CLEARANCE_ADMIN)
|
||||
{
|
||||
switch($sPage)
|
||||
{
|
||||
case 'sap_blog': //Syncing SAP BW Blog with database & spreading the news on chat
|
||||
$sResult = $oDatabap->syncSapBlog();
|
||||
break;
|
||||
}
|
||||
}
|
||||
elseif($sResult=='') $sResult = 'No Clearance';
|
||||
break;
|
||||
}
|
||||
|
||||
//Restricted actions
|
||||
if($oDatabap->getUserClearance()==Databap::CLEARANCE_ADMIN)
|
||||
{
|
||||
switch($sPage)
|
||||
{
|
||||
case 'sap_blog': //Syncing SAP BW Blog with database & spreading the news on chat
|
||||
$sResult = $oDatabap->syncSapBlog();
|
||||
break;
|
||||
}
|
||||
}
|
||||
elseif($sResult=='') $sResult = 'No Clearance';
|
||||
}
|
||||
elseif($sAction!='')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user