. * * @category StatusNet * @package StatusNet * @author Luke Shumaker * @copyright 2010 Free Software Foundation, Inc http://www.fsf.org * * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ require('include.php'); function main() { // Check permissions if (!common_logged_in()) { // TRANS: Client error message thrown when trying to load plugin data while not logged in. echo(_('Not logged in.')."\n"); return false; } $user = common_current_user(); assert(!empty($user)); if (!$user->hasRight(Right::CONFIGURESITE)) { // TRANS: Client error message thrown when a user tries to load plugin data but has no access rights. echo(_('You cannot make changes to this site.')."\n"); return false; } // Do stuff $possibleFiles = StatusNet::pluginFiles('*'); foreach ($possibleFiles as $pattern) { $regex = '/'.str_replace('/','\/',str_replace('*','(.*)',$pattern)).'/'; $matches = glob($pattern); foreach ($matches as $file) { $name = preg_replace($regex,'\1',$file); loadPlugin($name,$file,$data); } } $redirect = isset($_SERVER['HTTP_REFERER']); $fileName = 'plugindata.out.php'; $fh = fopen($fileName, 'w'); if (!$fh) { $redirect = false; // TRANS: Client error message thrown when plugindata.out.php can't be opened echo(_("ERROR: cannot open 'plugindata.out.php' for writing.")."\n"); } fwrite($fh, "onPluginVersion($newData); foreach ($newData as $pluginInfo) { $data[$pluginName] = $pluginInfo; } } else { echo 'ERROR: Class "'.$pluginName."Plugin\" still does not exist\n"; } } main();