<?php /** * Blog init file * * @author Matthew McNaney <mcnaney at gmail dot com> * @version $Id$ */ PHPWS_Core::configRequireOnce('blog', 'config.php'); PHPWS_Core::initModClass('blog', 'Blog_User.php');
/** * boost install file for users * * @author Matthew McNaney <mcnaney at gmail dot com> * @version $Id$ */ function users_install(&$content) { PHPWS_Core::initModClass('users', 'Users.php'); PHPWS_Core::initModClass('users', 'Action.php'); PHPWS_Core::configRequireOnce('users', 'config.php'); if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'branch') { $db = new PHPWS_DB(); PHPWS_Settings::clear(); if (!createLocalAuthScript()) { $content[] = 'Could not create authorization script.'; return false; } Branch::loadHubDB(); $db = new PHPWS_DB('mod_settings'); $db->addWhere('module', 'users'); $db->addWhere('setting_name', 'site_contact'); $db->addColumn('small_char'); $site_contact = $db->select('one'); $db = new PHPWS_DB('users'); $sql = 'select a.password, b.* from user_authorization as a, users as b where b.deity = 1 and a.username = b.username'; $deities = $db->getAll($sql); if (PHPWS_Error::isError($deities)) { PHPWS_Error::log($deities); $content[] = dgettext('users', 'Could not access hub database.'); Branch::restoreBranchDB(); return FALSE; } elseif (empty($deities)) { $content[] = dgettext('users', 'Could not find any hub deities.'); Branch::restoreBranchDB(); return FALSE; } else { Branch::restoreBranchDB(); PHPWS_Settings::set('users', 'site_contact', $site_contact); PHPWS_Settings::save('users'); $auth_db = new PHPWS_DB('user_authorization'); $user_db = new PHPWS_DB('users'); $group_db = new PHPWS_DB('users_groups'); foreach ($deities as $deity) { $auth_db->addValue('username', $deity['username']); $auth_db->addValue('password', $deity['password']); $result = $auth_db->insert(); if (PHPWS_Error::isError($result)) { PHPWS_Error::log($result); $content[] = dgettext('users', 'Unable to copy deity login to branch.'); continue; } unset($deity['password']); $user_db->addValue($deity); $result = $user_db->insert(); if (PHPWS_Error::isError($result)) { PHPWS_Error::log($result); $content[] = dgettext('users', 'Unable to copy deity users to branch.'); Branch::loadBranchDB(); return FALSE; } $group_db->addValue('active', 1); $group_db->addValue('name', $deity['username']); $group_db->addValue('user_id', $result); if (PHPWS_Error::logIfError($group_db->insert())) { $content[] = dgettext('users', 'Unable to copy deity user group to branch.'); Branch::loadBranchDB(); return FALSE; } $group_db->reset(); $auth_db->reset(); $user_db->reset(); } $content[] = dgettext('users', 'Deity users copied to branch.'); } return TRUE; } if (!createLocalAuthScript()) { $content[] = 'Could not create local authorization script.'; return false; } $authorize_id = PHPWS_Settings::get('users', 'local_script'); $user = new PHPWS_User(); $content[] = '<hr />'; return TRUE; }
<?php /** * Controls the installation, update, and uninstallation * of modules in phpwebsite * * @author Matthew McNaney <mcnaney at gmail dot com> * @version $Id$ */ PHPWS_Core::initCoreClass('Module.php'); PHPWS_Core::configRequireOnce('boost', 'config.php'); define('BOOST_NEW', 0); define('BOOST_START', 1); define('BOOST_PENDING', 2); define('BOOST_DONE', 3); if (!defined('BOOST_BACKUP_DIRECTORIES')) { define('BOOST_BACKUP_DIRECTORIES', true); } if (!defined('BOOST_BACKUP_FILES')) { define('BOOST_BACKUP_FILES', true); } class PHPWS_Boost { public $modules = NULL; public $status = NULL; public $current = NULL; public $installedMods = NULL; public function addModule($module) { if (!is_object($module) || strtolower(get_class($module)) != 'phpws_module') { return PHPWS_Error::get(BOOST_ERR_NOT_MODULE, 'boost', 'setModule');
/** * Pseudoname of configRequireOnce */ public static function requireConfig($module, $file = NULL, $exitOnError = true) { return PHPWS_Core::configRequireOnce($module, $file, $exitOnError); }
* $form->add('testarea'); * * This would create a form element named 'testarea'. You can set the type and value via * the setType and setValue functions or you can just include them in the add. * Example: * $form->add('testarea', 'textarea', 'something something'); * * For many form elements, that may be all you need. * * @version $Id$ * @author Matthew McNaney <mcnaney at gmail dot com> * @author Don Seiler <don at seiler dot us> * @package Core * */ PHPWS_Core::configRequireOnce('core', 'formConfig.php', true); class PHPWS_Form { public $id = 'phpws_form'; /** * Array of form elements * @var array * @access private */ private $_elements = array(); /** * Directory destination of submitted form. * Note: if none is provided, getTemplate will try to use the core * home_http directory * * @var string
<?php /** * Wiki for phpWebSite * * See docs/CREDITS for copyright information * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * 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 * * @package Wiki * @author Greg Meiste <*****@*****.**> */ PHPWS_Core::configRequireOnce('wiki', 'config.php'); // Display on the home page if option is set if (!isset($_REQUEST['module']) && PHPWS_Settings::get('wiki', 'show_on_home')) { PHPWS_Core::initModClass('wiki', 'WikiManager.php'); WikiManager::action(); }
<?php /** * @author Matthew McNaney <mcnaney at gmail dot com> * @version $Id$ */ if (!defined('USERS_AUTH_PATH')) { define('USERS_AUTH_PATH', PHPWS_SOURCE_DIR . 'mod/users/scripts/'); } PHPWS_Core::configRequireOnce('users', 'config.php', TRUE); require_once PHPWS_SOURCE_DIR . 'mod/users/inc/errorDefines.php'; PHPWS_Core::configRequireOnce('users', 'tags.php'); PHPWS_Core::initModClass('users', 'Current_User.php');