Esempio n. 1
0
 /**
  * Main class entry point
  *
  * @access	public
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Set up stuff
     //-----------------------------------------
     $this->form_code = 'module=settings&section=settings';
     $this->form_code_js = 'module=settings&section=settings';
     //-------------------------------
     // Grab, init and load settings
     //-------------------------------
     $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . '/modules_admin/settings/settings.php', 'admin_core_settings_settings');
     $settings = new $classToLoad($this->registry);
     $settings->makeRegistryShortcuts($this->registry);
     ipsRegistry::getClass('class_localization')->loadLanguageFile(array('admin_tools'), 'core');
     $settings->html = $this->registry->output->loadTemplate('cp_skin_settings', 'core');
     $settings->form_code = $settings->html->form_code = 'module=settings&section=settings';
     $settings->form_code_js = $settings->html->form_code_js = 'module=settings&section=settings';
     $this->request['conf_title_keyword'] = 'calendar';
     $settings->return_after_save = $this->settings['base_url'] . $this->form_code;
     $settings->_viewSettings();
     //-----------------------------------------
     // Pass to CP output hander
     //-----------------------------------------
     $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
     $this->registry->getClass('output')->sendOutput();
 }
Esempio n. 2
0
 /**
  * Constructor
  * 
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Hard limit - not used in Sphinx but may need to revisit if we bust IN()s */
     //IPSSearchRegistry::set('set.hardLimit', ( ipsRegistry::$settings['search_hardlimit'] ) ? ipsRegistry::$settings['search_hardlimit'] : 200 );
     /* Get class forums, used for displaying forum names on results */
     if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
         ipsRegistry::setClass('class_forums', new $classToLoad(ipsRegistry::instance()));
         ipsRegistry::getClass('class_forums')->strip_invisible = 1;
         ipsRegistry::getClass('class_forums')->forumsInit();
     }
     /* Get live or archive */
     $this->searchArchives = ipsRegistry::$request['search_app_filters']['forums']['liveOrArchive'] == 'archive' ? true : false;
     if ($this->searchArchives) {
         /* Load up archive class */
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/reader.php', 'classes_archive_reader');
         $this->archiveReader = new $classToLoad();
         $this->archiveReader->setApp('forums');
         $this->table = $this->archiveReader->getFields();
         $this->table['_table_'] = 'forums_archive_posts';
         $this->table['_prefix_'] = 'p.archive_';
         $this->table['forums_search_posts_main'] = 'forums_search_archive_main';
         $this->table['forums_search_posts_delta'] = 'forums_search_archive_delta';
         /* disable max days search */
         $this->settings['search_ucontent_days'] = 0;
     } else {
         $this->table = array('_table_' => 'posts', '_prefix_' => 'p.', 'pid' => 'pid', 'author_id' => 'author_id', 'author_name' => 'author_name', 'ip_address' => 'ip_address', 'post_date' => 'post_date', 'post' => 'post', 'queued' => 'queued', 'topic_id' => 'topic_id', 'new_topic' => 'new_topic', 'post_bwoptions' => 'post_bwoptions', 'post_key' => 'post_key', 'post_htmlstate' => 'post_htmlstate', 'use_sig' => 'use_sig', 'use_emo' => 'use_emo', 'append_edit' => 'append_edit', 'edit_time' => 'edit_time', 'edit_name' => 'edit_name', 'post_edit_reason' => 'post_edit_reason', 'forums_search_posts_main' => 'forums_search_posts_main', 'forums_search_posts_delta' => 'forums_search_posts_delta');
     }
     parent::__construct($registry);
 }
Esempio n. 3
0
 /**
  * Main function executed automatically by the controller
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Set up */
     $inapp = trim($this->request['inapp']);
     $do = !empty($this->request['do']) ? $this->request['do'] : 'all';
     /* Load navigation stuff */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build');
     $navigation = new $classToLoad($inapp);
     /* Show warning if offline */
     if ($this->settings['board_offline'] and !$this->memberData['g_access_offline']) {
         $row = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='offline_msg'"));
         IPSText::getTextClass('bbcode')->parse_bbcode = 1;
         IPSText::getTextClass('bbcode')->parse_html = 1;
         IPSText::getTextClass('bbcode')->parse_emoticons = 1;
         IPSText::getTextClass('bbcode')->parse_nl2br = 1;
         IPSText::getTextClass('bbcode')->parsing_section = 'global';
         $row['conf_value'] = IPSText::getTextClass('bbcode')->preDisplayParse(IPSText::getTextClass('bbcode')->preDbParse($row['conf_value']));
         return $this->returnHtml($this->registry->output->getTemplate('global_other')->quickNavigationOffline($row['conf_value']));
     }
     /* Return */
     if ($do == 'all') {
         return $this->returnHtml($this->registry->output->getTemplate('global_other')->quickNavigationWrapper($navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $navigation->getApp()));
     } else {
         return $this->returnHtml($this->registry->output->getTemplate('global_other')->quickNavigationPanel($navigation->loadNavigationData(), $navigation->getApp()));
     }
 }
Esempio n. 4
0
    /**
     * Generate sitemap entries:
     */
    public function generate()
    {
        if (!IPSLib::appIsInstalled('blog') || $this->settings['sitemap_priority_blogs'] == 0) {
            return;
        }
        // Check whether groups can access blog at all:
        $guestGroup = $this->DB->buildAndFetch(array('select' => 'g_blog_settings', 'from' => 'groups', 'where' => 'g_id = ' . $this->settings['guest_group']));
        // Default is to not allow access unless explicitly given:
        if (is_null($guestGroup['g_blog_settings'])) {
            return;
        }
        $settings = unserialize($guestGroup['g_blog_settings']);
        // Not allowed to access unless g_blog_allowview = 1
        if (!is_array($settings) || intval($settings['g_blog_allowview']) != 1) {
            return;
        }
        // Get blogs:
        $query = $this->DB->build(array('select' => 'blog_id, blog_seo_name, blog_last_udate', 'from' => 'blog_blogs', 'where' => 'blog_private = 0 
															AND blog_disabled = 0 
															AND blog_allowguests = 1 
															AND blog_view_level = \'public\''));
        $this->DB->execute();
        // Add blogs to sitemap:
        while ($blog = $this->DB->fetch()) {
            $url = $this->settings['board_url'] . '/index.php?app=blog&blogid=' . $blog['blog_id'];
            $url = ipSeo_FURL::build($url, 'none', $blog['blog_seo_name'], 'showblog');
            //$url = ipsRegistry::getClass('output')->buildSEOUrl($url, 'none', $blog['blog_seo_name'], 'showblog');
            $this->sitemap->addURL($url, $blog['blog_last_udate'], $this->settings['sitemap_priority_blogs']);
        }
    }
Esempio n. 5
0
 /**
  * Remove user's photo
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function remove_photo()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval($this->request['member_id']);
     //-----------------------------------------
     // Get member
     //-----------------------------------------
     $member = IPSMember::load($member_id);
     if (!$member['member_id']) {
         $this->returnJsonError($this->lang->words['m_noid']);
         exit;
     }
     //-----------------------------------------
     // Allowed to upload pics for administrators?
     //-----------------------------------------
     if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_photo_admin', 'members', 'members')) {
         $this->returnJsonError($this->lang->words['m_editadmin']);
         exit;
     }
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo');
     $photos = new $classToLoad($this->registry);
     $photos->remove($member_id);
     ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_imgremlog'], $member_id));
     $member = IPSMember::load($member_id);
     $member = IPSMember::buildDisplayData($member, 0);
     //-----------------------------------------
     // Return
     //-----------------------------------------
     $this->returnJsonArray(array('success' => 1, 'pp_main_photo' => $member['pp_main_photo'], 'pp_main_width' => $member['pp_main_width'], 'pp_main_height' => $member['pp_main_height']));
 }
 /**
  * Returns possible matches for the string input
  *
  * @access	private
  * @return	void		Outputs to screen
  */
 private function _getMemberNames()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $name = $this->convertAndMakeSafe(ipsRegistry::$request['name'], 0);
     //-----------------------------------------
     // Check length
     //-----------------------------------------
     if (IPSText::mbstrlen($name) < 3) {
         $this->returnJsonError('requestTooShort');
     }
     //-----------------------------------------
     // Try query...
     //-----------------------------------------
     $this->DB->build(array('select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', 'from' => array('members' => 'm'), 'where' => "LOWER(m.members_display_name) LIKE '" . $this->DB->addSlashes($name) . "%'", 'order' => $this->DB->buildLength('m.members_display_name') . ' ASC', 'limit' => array(0, 15), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => 'p.pp_member_id=m.member_id', 'type' => 'left'))));
     $this->DB->execute();
     //-----------------------------------------
     // Got any results?
     //-----------------------------------------
     if (!$this->DB->getTotalRows()) {
         $this->returnJsonArray(array());
     }
     $return = array();
     while ($r = $this->DB->fetch()) {
         $photo = IPSMember::buildProfilePhoto($r);
         $group = IPSLib::makeNameFormatted('', $r['member_group_id']);
         $return[$r['member_id']] = array('name' => $r['members_display_name'], 'showas' => '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')', 'img' => $photo['pp_thumb_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height']);
     }
     $this->returnJsonArray($return);
 }
Esempio n. 7
0
 /**
  * Constructor
  *
  */
 public function __construct()
 {
     /* Make registry objects */
     $this->registry = ipsRegistry::instance();
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     /* Check for class_forums */
     if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
         $this->registry->setClass('class_forums', new $classToLoad($this->registry));
         $this->registry->class_forums->forumsInit();
     }
     /* Load topic class */
     if (!$this->registry->isClassLoaded('topics')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums');
         $this->registry->setClass('topics', new $classToLoad($this->registry));
     }
     /* Language class */
     $this->registry->getClass('class_localization')->loadLanguageFile(array('public_global'), 'core');
     /* Fetch engine class */
     $this->settings['archive_engine'] = $this->settings['archive_engine'] ? $this->settings['archive_engine'] : 'sql';
     /* Load up archive class */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/reader/' . $this->settings['archive_engine'] . '.php', 'classes_archive_reader_' . $this->settings['archive_engine']);
     $this->engine = new $classToLoad();
     $this->fields = $this->registry->topics->getPostTableFields();
 }
Esempio n. 8
0
 public function doExecute(ipsRegistry $registry)
 {
     $this->kunena_prefix = 'kunena_';
     $forSome = array();
     // See if we specified a parent product
     $app = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'conv_apps', 'where' => "name='{$this->settings['conv_current']}'"));
     if (!$app['parent']) {
         $this->usingParent = FALSE;
         $forSome = array('forum_perms' => array(), 'groups' => array('forum_perms'), 'members' => array('groups', 'forum_perms'));
     }
     $forAll = array('forums' => array('forum_perms', 'groups'), 'topics' => array('members', 'forums'), 'posts' => array('members', 'topics'), 'reputation_index' => array('members', 'posts'), 'polls' => array('members', 'topics', 'forums'), 'attachments' => array('members', 'posts'));
     $this->actions = array_merge($forSome, $forAll);
     require_once IPSLib::getAppDir('convert') . '/sources/lib_master.php';
     require_once IPSLib::getAppDir('convert') . '/sources/lib_board.php';
     $this->lib = new lib_board($registry, $html, $this);
     $this->html = $this->lib->loadInterface();
     $this->lib->sendHeader('Kunena 2.x &rarr; IP.Board Converter');
     $this->HB = $this->lib->connect();
     if (array_key_exists($this->request['do'], $this->actions)) {
         call_user_func(array($this, 'convert_' . $this->request['do']));
     } else {
         $this->lib->menu();
     }
     $this->sendOutput();
 }
 /**
  * Class entry point
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* AJAX Class */
     require_once IPS_KERNEL_PATH . '/classAjax.php';
     $this->ajax = new classAjax($registry);
     /* Attachment Class */
     require_once IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php';
     $this->class_attach = new class_attach($registry);
     /* What to do... */
     switch ($this->request['do']) {
         case 'attach_upload_show':
             $this->ajax->returnHtml($this->attachmentUploadShow());
             break;
         case 'attach_upload_process':
             $this->attachmentUploadProcess();
             break;
         case 'attach_upload_remove':
             $this->attachmentUploadRemove();
             break;
             /* IFrame based  upload */
         /* IFrame based  upload */
         case 'attachiFrame':
             $this->attachiFrame();
             break;
         case 'attachUploadiFrame':
             $this->attachUploadiFrame();
             break;
         default:
             $this->showPostAttachment();
             break;
     }
 }
 /**
  * Class entry point
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Grab class
     //-----------------------------------------
     require_once IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php';
     $this->messengerFunctions = new messengerFunctions($registry);
     switch ($this->request['do']) {
         case 'addFolder':
             $this->_addFolder();
             break;
         case 'removeFolder':
             $this->_removeFolder();
             break;
         case 'renameFolder':
             $this->_renameFolder();
             break;
         case 'emptyFolder':
             $this->_emptyFolder();
             break;
         case 'getPMNotification':
             $this->_getPMNotification();
             break;
         case 'showQuickForm':
             $this->_showQuickForm();
             break;
         case 'PMSend':
             $this->_PMSend();
             break;
         default:
             break;
     }
 }
 public function generate()
 {
     if (!IPSLib::appIsInstalled('downloads') || $this->settings['sitemap_priority_downloads_files'] == 0) {
         return;
     }
     $addedCount = 0;
     $limitCount = 0;
     while ($addedCount < $this->settings['sitemap_count_downloads_files']) {
         if (ipSeo_SitemapGenerator::isCronJob()) {
             sleep(0.5);
         }
         // Get files:
         $permCheck = $this->DB->buildWherePermission(array($this->caches['group_cache'][$this->settings['guest_group']]['g_perm_id']), 'p.perm_2', true);
         $this->DB->build(array('select' => 'f.file_id, f.file_name_furl, f.file_updated', 'from' => array('downloads_files' => 'f'), 'add_join' => array(array('from' => array('downloads_categories' => 'c'), 'where' => "c.cid = f.file_cat", 'type' => 'left'), array('from' => array('permission_index' => 'p'), 'where' => "(p.app = 'downloads' AND p.perm_type = 'cat' AND p.perm_type_id = c.cid)", 'type' => 'left')), 'where' => "f.file_broken = 0 AND file_open = 1 AND c.copen = 1 AND ({$permCheck})", 'order' => 'f.file_updated DESC', 'limit' => array($limitCount, 100)));
         $result = $this->DB->execute();
         // Add blogs to sitemap:
         while ($file = $this->DB->fetch($result)) {
             if (!$file['file_updated']) {
                 $file['file_updated'] = $file['file_submitted'];
             }
             $url = $this->settings['board_url'] . '/index.php?app=downloads&showfile=' . $file['file_id'];
             $url = ipSeo_FURL::build($url, 'none', $file['file_name_furl'], 'idmshowfile');
             //$url = ipsRegistry::getClass('output')->buildSEOUrl($url, 'none', $file['file_name_furl'], 'idmshowfile');
             $addedCount = $this->sitemap->addURL($url, $file['file_updated'], $this->settings['sitemap_priority_downloads_files']);
         }
         $limitCount += 100;
         // If we've got back less rows than expected, we've probably got no more to pull:
         if ($this->DB->getTotalRows($result) < 100) {
             break;
         }
     }
 }
Esempio n. 12
0
 public function doExecute(ipsRegistry $registry)
 {
     $this->registry = $registry;
     // load libs.
     require_once IPSLib::getAppDir('convert') . '/sources/lib_master.php';
     require_once IPSLib::getAppDir('convert') . '/sources/lib_nexus.php';
     $this->lib = new lib_nexus($registry, $html, $this);
     $this->html = $this->lib->loadInterface();
     $this->lib->sendHeader('vBulletin &rarr; IP.Nexus Converter');
     $this->HB = $this->lib->connect();
     // populate actions
     $this->actions = array('nexus_customers' => array('members'), 'nexus_packages' => array('groups'), 'nexus_invoices' => array('nexus_packages', 'members'), 'nexus_purchases' => array('nexus_packages', 'nexus_invoices', 'members'));
     // Check for converted group
     $row = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'nexus_package_groups', 'where' => "pg_name='Converted' and pg_parent=0"));
     $this->convertGroup = $row['pg_id'];
     if (!$row['pg_id']) {
         // Insert conversion group into Nexus
         $this->DB->insert('nexus_package_groups', array('pg_name' => 'Converted', 'pg_seo_name' => 'converted', 'pg_parent' => 0, 'pg_position' => 1));
         $id = $this->DB->getInsertId();
         $this->lib->addLink($id, $id, 'nexus_package_groups');
     }
     if (array_key_exists($this->request['do'], $this->actions)) {
         call_user_func(array($this, 'convert_' . $this->request['do']));
     } else {
         $this->lib->menu();
     }
     $this->sendOutput();
 }
Esempio n. 13
0
 /**
  * Main function executed automatically by the controller
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Get forums class
     //-----------------------------------------
     if (!$this->registry->isClassLoaded('class_forums')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
         $this->registry->setClass('class_forums', new $classToLoad($this->registry));
         $this->registry->getClass('class_forums')->strip_invisible = 1;
         $this->registry->getClass('class_forums')->forumsInit();
     }
     $this->lang->loadLanguageFile(array('public_search'));
     //-----------------------------------------
     // What to do?
     //-----------------------------------------
     switch ($this->request['do']) {
         default:
         case 'showForumsVncFilter':
             $this->showForm();
             break;
         case 'saveForumsVncFilter':
             $this->saveForm();
             break;
         case 'saveFollow':
             $this->saveFollow();
             break;
     }
 }
 /**
  * Run SQL files
  * 
  * @access	public
  * @param	int
  */
 public function _importTemplates()
 {
     $templates = array();
     $this->DB->build(array('select' => '*', 'from' => 'ccs_template_blocks'));
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         if (!preg_match("/_(\\d+)\$/", $r['tpb_name'])) {
             $templates[$r['tpb_name']] = $r;
         }
     }
     $content = file_get_contents(IPSLib::getAppDir('ccs') . '/xml/block_templates.xml');
     require_once IPS_KERNEL_PATH . 'classXML.php';
     $xml = new classXML(IPS_DOC_CHAR_SET);
     $xml->loadXML($content);
     foreach ($xml->fetchElements('template') as $template) {
         $_template = $xml->fetchElementsFromRecord($template);
         if ($_template['tpb_name']) {
             unset($_template['tpb_id']);
             if (array_key_exists($_template['tpb_name'], $templates)) {
                 $this->DB->update("ccs_template_blocks", $_template, "tpb_id={$templates[$_template['tpb_name']]['tpb_id']}");
             } else {
                 $this->DB->insert("ccs_template_blocks", $_template);
             }
         }
     }
 }
 public function generate()
 {
     $galleryClassFile = IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php';
     if (!IPSLib::appIsInstalled('gallery') || $this->settings['sitemap_priority_gallery_albums'] == 0 || !is_file($galleryClassFile)) {
         return;
     }
     $classToLoad = IPSLib::loadLibrary($galleryClassFile, 'ipsGallery', 'gallery');
     $this->registry->setClass('gallery', new $classToLoad($this->registry));
     $limitCount = 0;
     while (1) {
         if (ipSeo_SitemapGenerator::isCronJob()) {
             sleep(0.5);
         }
         $filters = array('sortOrder' => 'desc', 'sortKey' => 'date', 'offset' => $limitCount, 'limit' => 100, 'isViewable' => true, 'memberData' => array('member_id' => 0));
         $albums = $this->registry->gallery->helper('albums')->fetchAlbumsByFilters($filters);
         foreach ($albums as $album) {
             $url = "{$this->settings['board_url']}/index.php?app=gallery&album={$album['album_id']}";
             $url = ipSeo_FURL::build($url, 'none', $album['album_name_seo'], 'viewalbum');
             $addedCount = $this->sitemap->addUrl($url, $album['album_last_img_date'], $this->settings['sitemap_priority_gallery_albums']);
         }
         $limitCount += 100;
         if (count($albums) < 100) {
             break;
         }
     }
 }
Esempio n. 16
0
 /**
  * Main class entry point
  *
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Load editor stuff */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
     $this->editor = new $classToLoad();
     $this->lang->loadLanguageFile('public_editors', 'core');
     /* What to do? */
     switch ($this->request['do']) {
         case 'autoSave':
             $this->_autoSave();
             break;
         case 'switch':
             $this->_switch();
             break;
         case 'showSettings':
             $this->_showSettings();
             break;
         case 'getEmoticons':
             $this->_getEmoticons();
             break;
         case 'saveSettings':
             $this->_saveSettings();
             break;
     }
 }
Esempio n. 17
0
 /**
  * Main executable
  *
  * @param	object	registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     $registry->getClass('class_localization')->loadLanguageFile(array('admin_templates'), 'core');
     //-----------------------------------------
     // Load functions and cache classes
     //-----------------------------------------
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions');
     $this->userAgentFunctions = new $classToLoad($registry);
     //-----------------------------------------
     // What shall we do?
     //-----------------------------------------
     switch ($this->request['do']) {
         case 'saveuAgent':
             if (!$registry->getClass('class_permissions')->checkPermission('ua_manage', ipsRegistry::$current_application, 'tools')) {
                 $this->returnJsonError($registry->getClass('class_localization')->words['sk_ajax_noperm']);
             }
             $this->_saveuAgent();
             break;
         case 'removeuAgent':
             if (!$registry->getClass('class_permissions')->checkPermission('ua_remove', ipsRegistry::$current_application, 'tools')) {
                 $this->returnJsonError($registry->getClass('class_localization')->words['sk_ajax_noperm']);
             }
             $this->_removeuAgent();
             break;
     }
 }
Esempio n. 18
0
 /**
  * Main class entry point
  *
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Require and run
     //-----------------------------------------
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager');
     /*noLibHook*/
     $functions = new $classToLoad($registry);
     //-----------------------------------------
     // Check shutdown functions
     //-----------------------------------------
     if (IPS_USE_SHUTDOWN) {
         define('IS_SHUTDOWN', 1);
         register_shutdown_function(array($functions, 'runTask'));
     } else {
         $functions->runTask();
     }
     if ($functions->type != 'cron' && !$_SERVER['SHELL']) {
         //-----------------------------------------
         // Print out the 'blank' gif
         //-----------------------------------------
         ob_start();
         @header("Content-Type: image/gif");
         print base64_decode("R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==");
     }
 }
Esempio n. 19
0
 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Load handler...
     //-----------------------------------------
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login');
     $this->han_login = new $classToLoad($this->registry);
     $this->han_login->init();
     $this->registry->getClass('class_localization')->loadLanguageFile(array('public_login'), 'core');
     //-----------------------------------------
     // Show form or process login?
     //-----------------------------------------
     if ($this->request['do'] == 'showForm') {
         $additional_data = $this->han_login->additionalFormHTML();
         $replace = false;
         $data = array();
         if (!is_null($additional_data) and is_array($additional_data) and count($additional_data)) {
             $replace = $additional_data[0];
             $data = $additional_data[1];
         }
         $this->returnHtml($this->registry->getClass('output')->getTemplate('global')->loginForm($replace == 'replace' ? true : false, $data));
     } else {
         if ($this->request['do'] == 'authenticateUser') {
             return $this->_authenticateUser();
         } else {
             return $this->_doLogIn();
         }
     }
 }
 public function generate()
 {
     $galleryClassFile = IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php';
     if (!IPSLib::appIsInstalled('gallery') || $this->settings['sitemap_priority_gallery_images'] == 0 || !is_file($galleryClassFile)) {
         return;
     }
     $classToLoad = IPSLib::loadLibrary($galleryClassFile, 'ipsGallery', 'gallery');
     $this->registry->setClass('gallery', new $classToLoad($this->registry));
     $max = $this->settings['sitemap_count_gallery_images'];
     if (!ipSeo_SitemapGenerator::isCronJob() && ($max > 10000 || $max == -1)) {
         $max = 10000;
     } elseif (ipSeo_SitemapGenerator::isCronJob() && $max == -1) {
         $max = 500000000;
     }
     $addedCount = 0;
     $limitCount = 0;
     while ($addedCount < $max) {
         if (ipSeo_SitemapGenerator::isCronJob()) {
             sleep(0.5);
         }
         $filters = array('sortOrder' => 'desc', 'sortKey' => 'date', 'offset' => $limitCount, 'limit' => 100, 'getLatestComment' => 1);
         $memberId = 0;
         $images = $this->registry->gallery->helper('image')->fetchImages($memberId, $filters);
         foreach ($images as $image) {
             $url = "{$this->settings['board_url']}/index.php?app=gallery&image={$image['image_id']}";
             $url = ipSeo_FURL::build($url, 'none', $image['image_caption_seo'], 'viewimage');
             $lastMod = is_null($image['comment_post_date']) ? $image['image_date'] : $image['comment_post_date'];
             $addedCount = $this->sitemap->addUrl($url, $lastMod, $this->settings['sitemap_priority_gallery_images']);
         }
         $limitCount += 100;
         if (count($images) < 100) {
             break;
         }
     }
 }
Esempio n. 21
0
 /**
  * Run this task
  *
  * @return	@e void
  */
 public function runTask()
 {
     /* Language class */
     $this->registry->getClass('class_localization')->loadLanguageFile(array('public_global'), 'core');
     /* Load up archive class */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer');
     $archiveWriter = new $classToLoad();
     $archiveWriter->setApp('forums');
     /* Do it! DO IT */
     $count = $archiveWriter->processBatch();
     $this->class->appendTaskLog($this->task, sprintf($this->lang->words['task_archiveprocess'], intval($count)));
     /* Load up restore class */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore');
     $archiveRestore = new $classToLoad();
     $archiveRestore->setApp('forums');
     /* Do it! DO IT */
     $count = $archiveRestore->processBatch();
     if ($count) {
         $this->class->appendTaskLog($this->task, sprintf($this->lang->words['task_unarchiveprocess'], $count));
     }
     //-----------------------------------------
     // Unlock Task: DO NOT MODIFY!
     //-----------------------------------------
     $this->class->unlockTask($this->task);
 }
Esempio n. 22
0
 public function generate()
 {
     if (!IPSLib::appIsInstalled('ccs')) {
         return;
     }
     $maxPages = 10000;
     $curPages = 0;
     while ($curPages < $maxPages) {
         $permCheck = $this->DB->buildWherePermission(array($this->caches['group_cache'][$this->settings['guest_group']]['g_perm_id']), 'page_view_perms', true);
         $this->DB->build(array('select' => '*', 'from' => 'ccs_pages', 'where' => "({$permCheck}) AND page_content_type = 'page'", 'order' => 'page_last_edited DESC', 'limit' => array($curPages, 100)));
         $result = $this->DB->execute();
         if ($result) {
             // Add the resulting rows to the sitemap:
             while ($row = $this->DB->fetch($result)) {
                 if (!$this->registry->isClassLoaded('ccsFunctions')) {
                     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('ccs') . '/sources/functions.php', 'ccsFunctions', 'ccs');
                     $this->registry->setClass('ccsFunctions', new $classToLoad($this->registry));
                 }
                 $url = $this->registry->ccsFunctions->returnPageUrl($row);
                 $priority = $row['page_folder'] == '' && $row['page_seo_name'] == $this->settings['ccs_default_page'] ? $this->settings['sitemap_priority_ccs_index'] : $this->settings['sitemap_priority_ccs_page'];
                 $this->sitemap->addURL($url, $row['page_last_edited'], $priority);
             }
             // If we've got back less rows than expected, we've probably got no more to pull:
             $pulledRows = $this->DB->getTotalRows($result);
             $curPages += $pulledRows;
             if ($pulledRows < 100) {
                 break;
             }
         }
     }
 }
Esempio n. 23
0
 /**
  * Main entry point
  *
  * @param	object		ipsRegistry reference
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Load lang and skin */
     $this->registry->class_localization->loadLanguageFile(array('admin_tools'));
     $this->html = $this->registry->output->loadTemplate('cp_skin_tools');
     /* URLs */
     $this->form_code = $this->html->form_code = 'module=tools&amp;section=licensekey';
     $this->form_code_js = $this->html->form_code_js = 'module=tools&section=licensekey';
     /* What to do */
     switch ($this->request['do']) {
         case 'activate':
             $this->activate();
             break;
         case 'remove':
             IPSLib::updateSettings(array('ipb_reg_number' => ''));
             $this->settings['ipb_reg_number'] = '';
             // Deliberately no break as we'll do onto recahce and then default action
         // Deliberately no break as we'll do onto recahce and then default action
         case 'refresh':
             $this->recache();
             // Deliberately no break as we'll go on to the default action
         // Deliberately no break as we'll go on to the default action
         default:
             if ($this->settings['ipb_reg_number']) {
                 $this->overview();
             } else {
                 $this->activateForm();
             }
     }
     /* Output */
     $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
     $this->registry->output->sendOutput();
 }
Esempio n. 24
0
 /**
  * Grab the RSS document content and return it
  *
  * @return	string		RSS document
  */
 public function returnRSSDocument()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval(ipsRegistry::$request['member_id']);
     $secure_key = IPSText::md5Clean(ipsRegistry::$request['rss_key']);
     $rss_data = array();
     $to_print = '';
     if ($secure_key and $member_id) {
         if ($member_id == ipsRegistry::member()->getProperty('member_id')) {
             //-----------------------------------------
             // Get RSS export
             //-----------------------------------------
             $rss_data = ipsRegistry::DB()->buildAndFetch(array('select' => 'rss_cache', 'from' => 'rc_modpref', 'where' => "mem_id=" . $member_id . " AND rss_key='" . $secure_key . "'"));
             //-----------------------------------------
             // Got one?
             //-----------------------------------------
             if ($rss_data['rss_cache']) {
                 return $rss_data['rss_cache'];
             }
         }
         //-----------------------------------------
         // Create a dummy one
         //-----------------------------------------
         ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_reports'), 'core');
         $classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classRss.php', 'classRss');
         $rss = new $classToLoad();
         $channel_id = $rss->createNewChannel(array('title' => ipsRegistry::getClass('class_localization')->words['rss_feed_title'], 'link' => ipsRegistry::$settings['board_url'], 'description' => ipsRegistry::getClass('class_localization')->words['reports_rss_desc'], 'pubDate' => $rss->formatDate(time())));
         $rss->createRssDocument();
         return $rss->rss_document;
     }
 }
Esempio n. 25
0
 /**
  * Method constructor
  *
  * If you pass false as the key, it will not save out the imported GUIDs
  * @access	public
  * @return	@e void
  * 
  */
 public function __construct($config = array())
 {
     $this->_config = $config;
     $classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement');
     $this->_cfm = new $classToLoad();
     $this->_cfm->timeout = 15;
 }
Esempio n. 26
0
 /**
  * Main function executed automatically by the controller
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Load Class */
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . '/sources/classes/class_taskmanager.php', 'class_taskmanager');
     $this->func_taskmanager = new $classToLoad($registry);
     /* Load Skin and Language */
     $this->html = $this->registry->output->loadTemplate('cp_skin_system');
     $this->registry->class_localization->loadLanguageFile(array('admin_system'));
     $this->registry->output->core_nav[] = array($this->settings['base_url'] . 'module=logs&section=tasklogs', $this->lang->words['sched_error_logs']);
     /* URLs */
     $this->form_code = $this->html->form_code = 'module=logs&amp;section=tasklogs';
     $this->form_code_js = $this->html->form_code_js = 'module=logs&section=tasklogs';
     switch ($this->request['do']) {
         default:
         case 'task_logs':
             $this->registry->getClass('class_permissions')->checkPermissionAutoMsg('tasklogs_view', '', 'system');
             $this->taskLogsOverview();
             break;
         case 'task_log_show':
             $this->registry->getClass('class_permissions')->checkPermissionAutoMsg('tasklogs_view', '', 'system');
             $this->taskLogsShow();
             break;
         case 'task_log_delete':
             $this->registry->getClass('class_permissions')->checkPermissionAutoMsg('tasklogs_delete', '', 'system');
             $this->taskLogsDelete();
             break;
     }
     /* Output */
     $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
     $this->registry->output->sendOutput();
 }
Esempio n. 27
0
 /**
  * Get topics from a forum
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _getTopics()
 {
     //-----------------------------------------
     // Reset input
     //-----------------------------------------
     $_GET['showforum'] = intval($_GET['f']);
     ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['f']);
     if ($_GET['showforum'] < 1) {
         $this->returnJsonArray(array('error' => 'incorrect_f'));
     }
     //-----------------------------------------
     // Get the forum controller
     //-----------------------------------------
     $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('forums') . '/modules_public/forums/forums.php', 'public_forums_forums_forums');
     $forums = new $classToLoad();
     $forums->makeRegistryShortcuts($this->registry);
     $forums->initForums();
     $forums->buildPermissions();
     $data = $forums->renderForum();
     $html = '';
     if (is_array($data['topic_data']) && count($data['topic_data'])) {
         foreach ($data['topic_data'] as $idx => $tdata) {
             $html .= $this->registry->output->getTemplate('forum')->topic($tdata, $data['other_data']['forum_data'], $data['other_data'], 1);
         }
     }
     $this->returnJsonArray(array('topics' => $html, 'pages' => $data['other_data']['forum_data']['SHOW_PAGES'], 'hasMore' => $data['other_data']['hasMore']), true);
 }
Esempio n. 28
0
 /**
  * Grab the RSS document content and return it
  * 
  * @return	string		RSS document
  */
 public function returnRSSDocument()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $cal_id = intval(ipsRegistry::$request['id']);
     $rss_data = array();
     $to_print = '';
     $this->expires = time();
     $_calendarCache = ipsRegistry::cache()->getCache('calendars');
     //-----------------------------------------
     // Get RSS export
     //-----------------------------------------
     $rss_data = $_calendarCache[$cal_id];
     //-----------------------------------------
     // Got one?
     //-----------------------------------------
     if ($rss_data['cal_id'] and $rss_data['cal_rss_export']) {
         //-----------------------------------------
         // Correct expires time
         //-----------------------------------------
         $this->expires = $rss_data['cal_rss_update_last'] + $rss_data['cal_rss_update'] * 60;
         //-----------------------------------------
         // Need to recache?
         //-----------------------------------------
         if (!$rss_data['cal_rss_cache'] or time() - $rss_data['cal_rss_update'] * 60 > $rss_data['cal_rss_update_last']) {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('calendar') . '/sources/cache.php', 'calendar_cache', 'calendar');
             $rss_export = new $classToLoad(ipsRegistry::instance());
             return $rss_export->rebuildCalendarRSSCache($rss_data['cal_id']);
         } else {
             return $rss_data['cal_rss_cache'];
         }
     }
 }
Esempio n. 29
0
 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Attachment Controller Class */
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/attach/controller.php', 'classes_attach_controller');
     $controller = new $classToLoad($registry);
     $controller->run($this->request['do']);
 }
Esempio n. 30
0
 /**
  * Gets the uploader form/data for ajaxy stuffs
  */
 protected function _getForumsAppUploader()
 {
     $this->registry->getClass('class_localization')->loadLanguageFile(array('public_post', 'public_topics'), 'forums');
     $attach_post_key = trim($this->request['attach_post_key']);
     $attach_rel_id = intval($this->request['attach_rel_id']);
     $forum_id = intval($this->request['forum_id']);
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php', 'class_attach');
     $class_attach = new $classToLoad($this->registry);
     $class_attach->type = 'post';
     $class_attach->attach_post_key = $attach_post_key;
     $class_attach->init();
     $class_attach->getUploadFormSettings();
     $html = $this->registry->getClass('output')->getTemplate('post')->uploadForm($this->post_key, 'post', $class_attach->attach_stats, $attach_rel_id, $forum_id);
     /* Need to make sure they are unique - if we implement, change template to accept a prefix */
     $html = str_replace("id='add_files_attach_", "id='add_files_attach_pu_", $html);
     $html = str_replace("id='nojs_attach_", "id='nojs_attach_pu_", $html);
     $html = str_replace("id='help_msg'", "id='pu_help_msg'", $html);
     $html = str_replace("id='space_info_attach_", "id='space_info_attach_pu_", $html);
     $html = str_replace("<ul id='attachments'>", "<ul id='pu_attachments'>", $html);
     /* Remove help msg */
     /* remove inline execution */
     preg_match_all('#<script type=\'text/javascript\'>(.+?)</script>#is', $html, $matches, PREG_SET_ORDER);
     foreach ($matches as $val) {
         $all = $val[0];
         $javascript = $val[1];
         if (stristr($all, 'ipb.attach.registerUploader')) {
             $html = str_replace($all, '', $html);
         }
     }
     $this->returnHtml($html);
 }