function test_MAX_aclRecompileAll() { DataGenerator::cleanUp(array('acls')); $doBanners = OA_Dal::factoryDO('banners'); $bannerId = DataGenerator::generateOne($doBanners); $doAcls = OA_Dal::factoryDO('acls'); $doAcls->bannerid = $bannerId; $doAcls->logical = 'and'; $doAcls->type = 'Dummy:Dummy'; $doAcls->comparison = '=~'; $doAcls->data = '0,1'; $doAcls->executionorder = 1; $aclsId1 = DataGenerator::generateOne($doAcls); $doAcls = OA_Dal::factoryDO('acls'); $doAcls->bannerid = $bannerId; $doAcls->logical = 'and'; $doAcls->type = 'Dummy:Dummy'; $doAcls->comparison = '!~'; $doAcls->data = 'openx.org'; $doAcls->executionorder = 0; $aclsId2 = DataGenerator::generateOne($doAcls); $this->assertTrue(MAX_AclReCompileAll()); $doBanners =& OA_Dal::staticGetDO('banners', $bannerId); $this->assertEqual("MAX_checkDummy_Dummy('openx.org', '!~') and MAX_checkDummy_Dummy('0,1', '=~')", $doBanners->compiledlimitation); $this->assertEqual("Dummy:Dummy", $doBanners->acl_plugins); }
<?php /* +---------------------------------------------------------------------------+ | Revive Adserver | | http://www.revive-adserver.com | | | | Copyright: See the COPYRIGHT.txt file. | | License: GPLv2 or later, see the LICENSE.txt file. | +---------------------------------------------------------------------------+ */ require_once MAX_PATH . '/lib/max/other/lib-acl.inc.php'; //$oMessages initialized by runner OA_Upgrade::runPostUpgradeTask $oMessages->logInfo('Recompiling Acls'); if (PEAR::isError($result)) { $oMessages->logError($result->getCode() . ': ' . $result->getMessage()); } else { $oMessages->logInfo('OK'); } $oMessages->logInfo('Starting Acls Recompilation'); $upgradeTaskResult = MAX_AclReCompileAll(true); if (PEAR::isError($upgradeTaskResult)) { $oMessages->logError($upgradeTaskResult->getCode() . ': ' . $upgradeTaskResult->getMessage()); } $oMessages->logInfo('Acls Recompilation: ' . ($upgradeTaskResult ? 'Complete' : 'Failed'));
require_once MAX_PATH . '/lib/max/Plugin.php'; require_once MAX_PATH . '/lib/max/other/lib-acl.inc.php'; require_once MAX_PATH . '/www/admin/lib-maintenance.inc.php'; // Security check OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN); phpAds_registerGlobal('action'); /*-------------------------------------------------------*/ /* HTML framework */ /*-------------------------------------------------------*/ phpAds_PageHeader("maintenance-index"); phpAds_MaintenanceSelection("acls"); /*-------------------------------------------------------*/ /* Main code */ /*-------------------------------------------------------*/ if (!empty($action) && $action == 'Recompile') { MAX_AclReCompileAll(); echo "<strong>{$strAllBannerChannelCompiled}</strong><br />"; } echo $strBannerChannelResult; phpAds_ShowBreak(); // Check the ACLs in the database against the compiled limitation strings... echo "<strong>" . $strChannels . ":</strong>"; phpAds_showBreak(); // Check all the channels... OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance')); $dalChannel = OA_Dal::factoryDAL('channel'); $rsChannel = $dalChannel->getChannelsAndAffiliates(); $rsChannel->find(); $allChannelsValid = true; while ($rsChannel->fetch() && ($row = $rsChannel->toArray())) { if (!MAX_AclValidate('channel-acl.php', array('channelid' => $row['channelid']))) {
| the Free Software Foundation; either version 2 of the License, or | | (at your option) any later version. | | | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | | | | You should have received a copy of the GNU General Public License | | along with this program; if not, write to the Free Software | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | +---------------------------------------------------------------------------+ $Id: openads_upgrade_task_Recompile_Acls.php 37157 2009-05-28 12:31:10Z andrew.hill $ */ require_once MAX_PATH . '/lib/max/other/lib-acl.inc.php'; $upgradeTaskError[] = 'Recompiling Acls'; if (PEAR::isError($result)) { $upgradeTaskError[] = $result->getMessage(); $upgradeTaskError[] = $result->getCode(); } else { $upgradeTaskError[] = 'OK'; } if (!$upgradeTaskMessage) { $upgradeTaskMessage = array(); } $upgradeTaskError[] = 'Starting Acls Recompilation'; $result = MAX_AclReCompileAll(true); if (is_null($upgradeTaskResult) || $upgradeTaskResult) { $upgradeTaskResult = $result; } $upgradeTaskError[] = ' Acls Recompilation: ' . ($result ? 'Complete' : 'Failed');