function commit_update() { require_once 'AMP/Content/RSS/Subscription/Subscription.php'; $current_subscription_list =& AMPContent_Lookup::instance('RSS_Subscriptions'); foreach ($current_subscription_list as $subscription_id => $subscription_name) { $sub = new RSS_Subscription(AMP_Registry::getDbcon(), $subscription_id); $sub->update(); } AMP_flush_common_cache(); ampredirect(AMP_SYSTEM_URL_RSS_AGGREGATOR); }
function restore() { $target_id = $this->getData('id'); if (!$target_id) { return false; } require_once 'AMP/Content/Template.inc.php'; $template =& new AMPContent_Template($this->dbcon, $target_id); $template->save_version(); $template->mergeData($this->getData()); $result = $template->save(); if (!$result) { return false; } AMP_flush_common_cache(); $flash =& AMP_System_Flash::instance(); $flash->add_message(sprintf(AMP_TEXT_DATA_RESTORE_SUCCESS, $this->getName())); ampredirect(AMP_url_update(AMP_SYSTEM_URL_TEMPLATE, array('id' => $target_id))); return $result; }
function do_request() { if (!$this->_request->execute()) { return false; } if (!AMP_DISPLAYMODE_DEBUG) { ampredirect(AMP_url_update($_SERVER['REQUEST_URI'])); } if ($affected_qty = $this->_request->getAffectedQty()) { $this->message(sprintf(AMP_TEXT_LIST_ACTION_SUCCESS, ucfirst(AMP_PastParticiple($this->_request->getPerformedAction())), $affected_qty)); AMP_flush_common_cache(); } else { $this->message(sprintf(AMP_TEXT_LIST_ACTION_FAIL, AMP_PastParticiple($this->_request->getPerformedAction()))); } $this->_after_request(); }
<?php /***** * * AMP Authentication Handler * * The inclusion of this file will require authentication to succeed before * allowing access to any pages. It provides username and password information * by setting the $_SYSTEM['REMOTE_USER'] and $_SYSTEM['REMOTE_GROUP'] * *****/ //ob_start(); require_once 'AMP/Auth/Handler.inc.php'; $AMP_Authen_Handler = new AMP_Authentication_Handler($dbcon); // we have disabled old school default passwords if (isset($_POST['AMPLogin_password']) && ($_POST['AMPLogin_password'] == 'changeme' || $_POST['AMPLogin_password'] == 'chang#th1s')) { $AMP_Authen_Handler->set_message('Default Passwords are no longer available. Please contact <a style="color:#a5e2ff" href="mailto:help@radicaldesigns.org">help@radicaldesigns.org</a> for a new password.'); $AMP_Authen_Handler->do_login(); } if (!$AMP_Authen_Handler->is_authenticated()) { $AMP_Authen_Handler->do_login(); } else { define('AMP_USERMODE_ADMIN', true); } AMP_init_user(); $AMP_Authen_Handler->redirect_page(); if (!empty($_POST)) { AMP_flush_common_cache(); }