diff --git a/upload/admin/api/api_core.php b/upload/admin/api/api_core.php index 6857d239..b20b7a9e 100644 --- a/upload/admin/api/api_core.php +++ b/upload/admin/api/api_core.php @@ -1,83 +1,98 @@ - * Invision Power Services - * IP.Board v3.1.4 - * API: Core - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ + * @file api_core.php Core functions for the API classes + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ + * @since - + * $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $ + * @version v3.2.3 + * $Revision: 8129 $ */ +/** + * + * @class apiCore + * @brief Core functions for the API classes + */ class apiCore { /** * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches */ + protected $registry; protected $DB; protected $settings; protected $request; protected $lang; protected $member; - protected $cache; - protected $registry; + protected $memberData; + protected $cache; + protected $caches; /** - * API Error string + * Array of the API errors * - * @var array Errors + * @var $api_error */ public $api_error = array(); /** - * API Path to IPB root (where init.php/index.php is) + * API Path to IPB root (where initdata.php/index.php is) * - * @var string Path to IPB root folder + * @var $path_to_ipb */ public $path_to_ipb = ''; /** - * Loads the API Classes + * Loads the registry class * - * @return void + * @return @e void */ public function init() { + /* Path not set? */ if( !$this->path_to_ipb ) { + /* Constant available? */ if( defined('DOC_IPS_ROOT_PATH') ) { $this->path_to_ipb = DOC_IPS_ROOT_PATH; } else { + /* Fallback.. */ $this->path_to_ipb = dirname(__FILE__) . '/../../'; } } /* Load the registry */ - require_once( $this->path_to_ipb . 'initdata.php' ); - require_once( $this->path_to_ipb . CP_DIRECTORY . '/sources/base/ipsRegistry.php' ); + require_once( $this->path_to_ipb . 'initdata.php' );/*noLibHook*/ + require_once( $this->path_to_ipb . CP_DIRECTORY . '/sources/base/ipsRegistry.php' );/*noLibHook*/ $this->registry = ipsRegistry::instance(); $this->registry->init(); - /* Make Shortcuts */ - $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(); + /* Make registry shortcuts */ + $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(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); /* INIT Child? */ if( method_exists( $this, 'childInit' ) ) diff --git a/upload/admin/api/blog/api_blog.php b/upload/admin/api/blog/api_blog.php deleted file mode 100644 index 92f6d7e0..00000000 --- a/upload/admin/api/blog/api_blog.php +++ /dev/null @@ -1,212 +0,0 @@ - - * Invision Power Services - * IP.Board v3.1.4 - * Blog API file - * Last Updated: $Date: 2010-10-22 14:06:33 -0400 (Fri, 22 Oct 2010) $ - * - * - * @author $Author: ips_terabyte $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Blog - * @link http://www.invisionpower.com - * @version $Rev: 7018 $ - * @since 2.2.0 - * - */ - -if ( ! class_exists( 'apiCore' ) ) -{ - require_once( IPS_ROOT_PATH . 'api/api_core.php' ); -} - -/** - * apiBlog class - * @package IP.Blog - */ -class apiBlog extends apiCore -{ - /** - * Constructor. Calls parent init() method - * - * @access public - * @return void - */ - public function __construct() - { - $this->init(); - - if( ! ipsRegistry::isClassLoaded( 'blogFunctions' ) ) - { - /* Load the Blog functions library */ - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'blog' ) . '/sources/classes/blogFunctions.php', 'blogFunctions', 'blog' ); - $this->registry->setClass( 'blogFunctions', new $classToLoad( $this->registry ) ); - } - } - - /** - * Retrieve the Blog ID of a member - * THIS IS DEPRECATED - use fetchBlogIds - * - * @param int Member ID - * @return int Blog ID ( 0 if no Blog found ) - */ - public function getBlogID( $member_id=0 ) - { - $member_id = intval( $member_id ); - - //----------------------------------------- - // We entered here on member id, find blog_id and redirect them to here - //----------------------------------------- - $blog = $this->DB->buildAndFetch( array( - 'select' => 'blog_id, blog_name', - 'from' => 'blog_blogs', - 'where' => "member_id={$member_id}" - ) ); - if( ! $blog['blog_id'] or ! $blog['blog_name'] ) - { - return 0; - } - else - { - return $blog['blog_id']; - } - } - - /** - * Retrieve blog IDs this member can author in - * - * @access public - * @param int Member ID - * @return array array of ids with basic information, like: array( blog_id => array( 'blog_name', 'blog_seo_name' ) - */ - public function fetchBlogIds( $member_id=0 ) - { - $return = array(); - $member_id = intval( $member_id ); - $data = $this->registry->getClass('blogFunctions')->fetchMyBlogs( IPSMember::load( $member_id ) ); - - if ( is_array( $data ) AND count( $data ) ) - { - foreach( $data as $id => $blog ) - { - if ( $blog['_canPostIn'] ) - { - $return[ $id ] = $blog; - } - } - } - - return $return; - } - - /** - * Retrieve the Blog ID of a member - * - * @param int Blog ID - * @return string Blog URL - */ - public function getBlogUrl( $blog_id=0 ) - { - $blog_id = intval( $blog_id ); - - //----------------------------------------- - // We entered here on member id, find blog_id and redirect them to here - //----------------------------------------- - $blog = $this->DB->buildAndFetch( array ( - 'select' => 'blog_id, blog_name, blog_seo_name', - 'from' => 'blog_blogs', - 'where' => "blog_id={$blog_id}" - ) ); - if( ! $blog['blog_id'] or ! $blog['blog_name'] ) - { - return ''; - } - else - { - return $this->registry->output->buildSEOUrl( 'app=blog&blogid=' . $blog_id, 'public', $blog['blog_seo_name'], 'showblog' ); - } - } - - /** - * Retrieve the last x entries of a Blog - * Only public publishes entries are returned - * - * @param string Either 'member' or 'blog' - * @param int Blog ID or Member ID - * @param int Number of entries (to return) - * @return array Array of last X entries - */ - public function lastXEntries( $type, $id, $number_of_entries=10 ) - { - /* INIT */ - $id = intval( $id ); - $return_array = array(); - $where = array(); - - /* Build permissions */ - $modData = $this->registry->blogFunctions->buildPerms(); - - /* Got permission to view blog entries? */ - if ( $this->memberData['g_blog_settings']['g_blog_allowview'] ) - { - $this->DB->build( array( 'select' => "e.*, b.*", - 'from' => array('blog_entries' => 'e'), - 'where' => ( $type == 'member' ? "b.member_id={$id}" : "b.blog_id={$id}" ) . " AND b.blog_type='local' AND e.entry_status='published'", - 'order' => 'e.entry_date DESC', - 'limit' => array( 0, intval( $number_of_entries ) ), - 'add_join' => array( array( 'select' => 'b.blog_name, b.blog_seo_name', - 'from' => array( 'blog_blogs' => 'b' ), - 'where' => "e.blog_id=b.blog_id", - 'type' => 'left' ) ) ) ); - - $outer = $this->DB->execute(); - - while( $entry = $this->DB->fetch($outer) ) - { - if ( !$this->memberData['member_id'] or !$modData['_blogmod']['moderate_can_view_private'] ) - { - switch ( $entry['blog_view_level'] ) - { - case 'public': - if ( !$this->memberData['member_id'] and !$entry['blog_allowguests'] ) - { - continue 2; - } - break; - - case 'private': - if ( !$this->memberData['member_id'] or $this->memberData['member_id'] != $entry['member_id'] ) - { - continue 2; - } - break; - - case 'privateclub': - if ( !$this->memberData['member_id'] or !in_array( $this->memberData['member_id'], explode( ',', $entry['blog_authorized_users'] ) ) ) - { - continue 2; - } - break; - } - } - - $entry['blog_url'] = $this->registry->blogFunctions->getBlogUrl( $entry['blog_id'] ); - $entry['entry_url'] = $entry['blog_url'] . 'showentry='.$entry['entry_id']; - - $return_array[] = $entry; - } - return $return_array; - } - else - { - return array(); - } - } - -} - -?> \ No newline at end of file diff --git a/upload/admin/api/forums/api_topic_view.php b/upload/admin/api/forums/api_topic_view.php index 9fdda218..27bc7bef 100644 --- a/upload/admin/api/forums/api_topic_view.php +++ b/upload/admin/api/forums/api_topic_view.php @@ -1,82 +1,67 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Forums topic view API file - * Last Updated: $Date: 2010-10-25 11:20:47 -0400 (Mon, 25 Oct 2010) $ - * - * - * @author $Author: ips_terabyte $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Forums - * @link http://www.invisionpower.com - * @version $Rev: 7036 $ + * @file api_topic_view.php Forums topic view API + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 2.2.0 - * + * $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $ + * @version v3.2.3 + * $Revision: 8129 $ */ if ( ! class_exists( 'apiCore' ) ) { - require_once( IPS_ROOT_PATH . 'api/api_core.php' ); + require_once( IPS_ROOT_PATH . 'api/api_core.php' );/*noLibHook*/ } /** - * apiTopicView class - * @package IP.Board - * @subpackage Forums + * + * @class apiTopicView + * @brief Forums topic view API */ class apiTopicView extends apiCore { /** - * Topic list config + * Configuration array for the topic list * - * @access public - * @var array + * @var $topic_list_config */ - public $topic_list_config = array( 'offset' => 0, + public $topic_list_config = array( 'offset' => 0, 'limit' => 5, 'forums' => '*', 'order_field' => 'last_post', - 'order_by' => 'DESC' ); - + 'order_by' => 'DESC' + ); + /** - * Attachment pids + * Array of post IDs with attachments * - * @access protected - * @var array + * @var $attach_pids */ protected $attach_pids = array(); /** - * Constructor. Calls parent init() method + * Constructor: calls parent init() method and runs other additional calls * - * @access public - * @return void + * @return @e void */ public function __construct() { $this->init(); - //----------------------------------------- - // Get some classes - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' ); - $appClass = new $classToLoad( $this->registry ); + /* Load forums app main class */ + ipsRegistry::getAppClass( 'forums' ); } /** - * Returns an array of gallery data + * Returns an array of topics * - * @access public - * @param bool View as guest? - * @return mixed Array of data, or void + * @param boolean Load only topics viewable by guests? + * @return @e array Array of topics data */ - public function return_topic_list_data( $view_as_guest=0 ) + public function return_topic_list_data( $view_as_guest=false ) { //----------------------------------------- // INIT @@ -84,14 +69,14 @@ class apiTopicView extends apiCore $topics = array(); - if( !$view_as_guest ) + if( $view_as_guest ) { - $this->registry->class_forums->strip_invisible = false; + $this->registry->class_forums->strip_invisible = true; $this->registry->class_forums->forumsInit(); } else { - $this->registry->class_forums->strip_invisible = true; + $this->registry->class_forums->strip_invisible = false; $this->registry->class_forums->forumsInit(); } @@ -139,9 +124,11 @@ class apiTopicView extends apiCore // Get from the DB //----------------------------------------- + $_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' ); + $this->DB->build( array( 'select' => 't.*', 'from' => array( 'topics' => 't' ), - 'where' => 't.approved=1 AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')', + 'where' => $_approved . ' AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')', 'order' => $this->topic_list_config['order_field'].' '.$this->topic_list_config['order_by'], 'limit' => array( $this->topic_list_config['offset'], $this->topic_list_config['limit'] ), 'add_join' => array( @@ -292,5 +279,4 @@ class apiTopicView extends apiCore return $topics; } } - } \ No newline at end of file diff --git a/upload/admin/api/forums/index.html b/upload/admin/api/forums/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/api/forums/index.html +++ b/upload/admin/api/forums/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/api/gallery/api_gallery.php b/upload/admin/api/gallery/api_gallery.php deleted file mode 100644 index 5bde56d1..00000000 --- a/upload/admin/api/gallery/api_gallery.php +++ /dev/null @@ -1,195 +0,0 @@ - - * Invision Power Services - * IP.Board v3.1.4 - * Gallery API file - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Gallery - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ - * @since 2.2.0 - * - */ - -if ( ! class_exists( 'apiCore' ) ) -{ - require_once( IPS_ROOT_PATH . 'api/api_core.php' ); -} - -/** - * apiGallery class - * @package IP.Gallery - */ -class apiGallery extends apiCore -{ - /** - * Gallery library object - * - * @access public - * @var object - */ - public $glib; - - /** - * Gallery category object - * - * @access public - * @var object - */ - public $category; - - /** - * Total images found for result - * - * @access public - * @var integer - */ - public $total = 0; - - /** - * Database result resource - * - * @access public - * @var resource - */ - public $res; - - /** - * Constructor. Calls parent init() method - * - * @access public - * @return void - */ - public function __construct() - { - $this->init(); - } - - /** - * Returns an array of gallery data - * - * @access public - * @param integer Member id - * @param integer Limit - * @param integer true pulls the image results and returns them, false leaves the result set as $this->res - * @return mixed Array of gallery data, or void - */ - function return_gallery_data( $member_id=0, $limit=5, $do_pull=true ) - { - if( !$member_id ) - { - return array(); - } - - //----------------------------------------- - // INIT - //----------------------------------------- - - $images = array(); - - $member_id = intval($member_id); - - $categories = $this->category->getAllowedCats( 0 ); - $albums = $this->glib->getAllowedAlbums(); - - if( !count($categories) AND !count($albums) ) - { - return array(); - } - - $where = array(); - $where_statement = ""; - - if( count($categories) ) - { - $where[] = "i.category_id IN (".implode( ',', $categories ).")"; - } - - if( is_array($albums) AND count($albums) ) - { - $where[] = "i.album_id IN (".implode( ",", $albums ).")"; - } - else if( $albums == true AND count($categories) ) - { - $dewhere .= " ( i.album_id > 0 AND a.category_id IN ( ".implode( ",", $categories )." ) "; - - if( !$this->memberData['g_mod_albums'] ) - { - $dewhere .= " AND ( a.public_album=1 OR a.member_id={$this->memberData['member_id']} ) "; - } - - $dewhere .= ")"; - - $where[] = $dewhere; - } - - if( !count($where) ) - { - return array(); - } - else - { - $where_statement = implode( " OR ", $where ); - } - - - $this->DB->build( array( - 'select' => 'i.*', - 'from' => array( 'gallery_images' => 'i' ), - 'where' => "i.approved=1 AND i.member_id={$member_id} AND ({$where_statement})", - 'add_join' => array( - array( - 'type' => 'left', - 'select' => 'a.name as album_name, a.public_album', - 'from' => array( 'gallery_albums' => 'a' ), - 'where' => 'a.id=i.album_id', - ), - array( - 'type' => 'left', - 'select' => 'c.name as category_name', - 'from' => array( 'gallery_categories' => 'c' ), - 'where' => "c.id=i.category_id", - ), - array( - 'type' => 'left', - 'select' => 'm.members_display_name', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=i.member_id", - ), - array( - 'type' => 'left', - 'select' => 'r.id as rated, r.rate as my_rate', - 'from' => array( 'gallery_ratings' => 'r' ), - 'where' => "r.img_id=i.id AND r.member_id={$this->memberData['member_id']}", - ) - ), - 'order' => 'i.idate DESC', - 'limit' => array( 0, $limit ) - ) ); - - $this->res = $this->DB->execute(); - - $this->total = $this->DB->getTotalRows( $this->res ); - - if( $do_pull ) - { - while( $r = $this->DB->fetch() ) - { - $r['_my_rate'] = $r['my_rate']; - - $images[] = $r; - } - - return $images; - } - - } - -} \ No newline at end of file diff --git a/upload/admin/api/index.html b/upload/admin/api/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/api/index.html +++ b/upload/admin/api/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/admin/group_form.php b/upload/admin/applications/core/extensions/admin/group_form.php new file mode 100644 index 00000000..45d3c176 --- /dev/null +++ b/upload/admin/applications/core/extensions/admin/group_form.php @@ -0,0 +1,220 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @interface admin_group_form__core + * @brief Core group editing form + * + */ +class admin_group_form__core implements admin_group_form +{ + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Tab name (leave it blank to use the default application title) + * + * @var $tab_name + */ + public $tab_name = ""; + + /** + * Constructor + * + * @return @e void + */ + public function __construct() + { + //----------------------------------------- + // Make shortcuts + //----------------------------------------- + + $this->registry = ipsRegistry::instance(); + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + + $this->tab_name = ipsRegistry::getClass('class_localization')->words['tab_groupform_rc']; + } + + /** + * Returns HTML tabs content for the page + * + * @param array $group Group data + * @param integer $tabsUsed Number of tabs used so far (your ids should be this +1) + * @return @e array Array of 'tabs' (HTML for the tabs), 'content' (HTML for the content), 'tabsUsed' (number of tabs you have used) + */ + public function getDisplayContent( $group=array(), $tabsUsed = 2 ) + { + //----------------------------------------- + // Load skin + //----------------------------------------- + + $this->html = ipsRegistry::getClass('output')->loadTemplate( 'cp_skin_group_core', 'core' ); + + //----------------------------------------- + // Get report center plugins and sort perms + //----------------------------------------- + + $_canView = array(); + $_canSend = array(); + $_plugins = array(); + + $this->DB->build( array( 'select' => '*', 'from' => 'rc_classes', 'order' => 'class_title' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $senders = explode( ',', IPSText::cleanPermString( $r['group_can_report'] ) ); + $viewers = explode( ',', IPSText::cleanPermString( $r['mod_group_perm'] ) ); + + if( in_array( $group['g_id'], $senders ) ) + { + $_canSend[] = $r['com_id']; + } + + if( in_array( $group['g_id'], $viewers ) ) + { + $_canView[] = $r['com_id']; + } + + $_plugins[ $r['com_id'] ] = $r; + } + + //----------------------------------------- + // Show... + //----------------------------------------- + + return array( 'tabs' => $this->html->acp_group_form_tabs( $group, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_group_form_main( $group, ( $tabsUsed + 1 ), $_plugins, $_canView, $_canSend ), 'tabsUsed' => 1 ); + } + + /** + * Process the entries for saving and return + * + * @return @e array Array of keys => values for saving + */ + public function getForSave() + { + return array(); + } + + /** + * Post-process the entries for saving + * + * @author Brandon Farber + * @param int $groupId Group id + * @return @e void + */ + public function postSave( $groupId ) + { + $this->DB->build( array( 'select' => 'com_id, group_can_report, mod_group_perm', 'from' => 'rc_classes' ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $senders = explode( ',', IPSText::cleanPermString( $r['group_can_report'] ) ); + $viewers = explode( ',', IPSText::cleanPermString( $r['mod_group_perm'] ) ); + $canView = 0; + $canSend = 0; + + if( $this->request['rc_send_' . $r['com_id'] ] ) + { + $canSend = 1; + } + + if( $this->request['rc_view_' . $r['com_id'] ] ) + { + $canView = 1; + } + + $_newSenders = array(); + $_newViewers = array(); + + foreach( $senders as $sender ) + { + if( $sender == $groupId ) + { + if( $canSend ) + { + $_newSenders[ $sender ] = $sender; + } + } + else + { + $_newSenders[ $sender ] = $sender; + } + } + + if( $canSend ) + { + $_newSenders[ $groupId ] = $groupId; + } + + foreach( $viewers as $viewer ) + { + if( $viewer == $groupId ) + { + if( $canView ) + { + $_newViewers[ $viewer ] = $viewer; + } + } + else + { + $_newViewers[ $viewer ] = $viewer; + } + } + + if( $canView ) + { + $_newViewers[ $groupId ] = $groupId; + } + + $this->DB->update( 'rc_classes', array( 'group_can_report' => ',' . implode( ',', $_newSenders ) . ',', 'mod_group_perm' => ',' . implode( ',', $_newViewers ) . ',' ), 'com_id=' . $r['com_id'] ); + } + + $this->cache->rebuildCache( 'report_plugins', 'global' ); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/admin/index.html b/upload/admin/applications/core/extensions/admin/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/extensions/admin/index.html +++ b/upload/admin/applications/core/extensions/admin/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/admin/member_form.php b/upload/admin/applications/core/extensions/admin/member_form.php index b114cc7f..ab55b519 100644 --- a/upload/admin/applications/core/extensions/admin/member_form.php +++ b/upload/admin/applications/core/extensions/admin/member_form.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Member property updater (AJAX)
- * Last Updated: $Date: 2010-01-15 14:28:09 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
  * 
* - * @author $Author: josh $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 1st march 2002 - * @version $Revision: 5715 $ + * @version $Revision: 7442 $ * */ @@ -32,7 +32,6 @@ class admin_member_form__core implements admin_member_form * This can be left blank and the application title will * be used * - * @access public * @var string */ public $tab_name = ""; @@ -51,7 +50,6 @@ class admin_member_form__core implements admin_member_form * Use the format: * $array[] = array( 'img' => '', 'url' => '', 'title' => '' ); * - * @access public * @author Matt Mecham * @param array Member data * @return array Array of links @@ -64,7 +62,7 @@ class admin_member_form__core implements admin_member_form { $array[] = array( 'img' => '', 'url' => "app=members&module=members&section=tools&do=do_locked&auth_key=".ipsRegistry::member()->form_hash."&mid_{$member['member_id']}=1&type=unlock", - 'title' => $this->lang->words['reset_failed_logins'] ); + 'title' => ipsRegistry::getClass('class_localization')->words['reset_failed_logins'] ); } return $array; @@ -73,7 +71,6 @@ class admin_member_form__core implements admin_member_form /** * Returns content for the page. * - * @access public * @author Matt Mecham * @param array Member data * @return array Array of tabs, content @@ -86,7 +83,6 @@ class admin_member_form__core implements admin_member_form /** * Process the entries for saving and return * - * @access public * @author Brandon Farber * @return array Multi-dimensional array (core, extendedProfile) for saving */ diff --git a/upload/admin/applications/forums/extensions/portalPlugins/index.html b/upload/admin/applications/core/extensions/comments/index.html similarity index 81% rename from upload/admin/applications/forums/extensions/portalPlugins/index.html rename to upload/admin/applications/core/extensions/comments/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/forums/extensions/portalPlugins/index.html +++ b/upload/admin/applications/core/extensions/comments/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/comments/reports.php b/upload/admin/applications/core/extensions/comments/reports.php new file mode 100644 index 00000000..fdb5595a --- /dev/null +++ b/upload/admin/applications/core/extensions/comments/reports.php @@ -0,0 +1,340 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class comments_core_reports extends classes_comments_renderer +{ + /** + * Internal remap array + * + * @param array + */ + protected $_remap = array( 'comment_id' => 'id', + 'comment_author_id' => 'comment_by', + 'comment_author_name' => 'author_name', + 'comment_text' => 'comment', + 'comment_ip_address' => 'ip_address', + 'comment_edit_date' => 'edit_date', + 'comment_date' => 'comment_date', + 'comment_approved' => 'approved', + 'comment_parent_id' => 'rid' ); + + /** + * Internal parent remap array + * + * @param array + */ + protected $_parentRemap = array( 'parent_id' => 'id', + 'parent_owner_id' => 'updated_by', + 'parent_parent_id' => 'uid', + 'parent_title' => 'title', + 'parent_seo_title' => 'seoname', + 'parent_date' => 'date_created' ); + + /** + * Parent SEO template + * + * @return string + */ + public function seoTemplate() + { + return ''; + } + + /** + * Who am I? + * + * @return string + */ + public function whoAmI() + { + return 'core-reports'; + } + + /** + * Comment table + * + * @return string + */ + public function table() + { + return 'rc_comments'; + } + + /** + * Enable reputation? + * + * @return string + */ + public function reputationEnabled() + { + return false; + } + + /** + * Fetch parent + * + * @return array + */ + public function fetchParent( $id ) + { + static $cachedReports = array(); + + if( !isset($cachedReports[ $id ]) ) + { + $cachedReports[ $id ] = $this->DB->buildAndFetch( array( + 'select' => 'i.*', + 'from' => array( 'rc_reports_index' => 'i' ), + 'where' => "i.id=" . intval($id), + 'add_join' => array( + array( + 'select' => 'c.*', + 'from' => array( 'rc_classes' => 'c' ), + 'where' => 'c.com_id=i.rc_class', + 'type' => 'left', + ) + ) + ) ); + } + + return $cachedReports[ $id ]; + } + + /** + * Fetch settings + * + * @return array + */ + public function settings() + { + return array( 'urls-showParent' => "app=core&module=reports&do=show_report&rid=%s", + 'urls-report' => '' ); + } + + /** + * Number of items per page + * + * @return int + */ + public function perPage() + { + return 100; + } + + /** + * Pre save + * Accepts an array of GENERIC data and allows manipulation before it's added to DB + * + * @param string Type of save (edit/add) + * @param array Array of GENERIC data (comment_xxxx) + * @param int Comment id (if available) + * @param int Parent id + * @return array Array of GENERIC data + */ + public function preSave( $type, array $array, $commentId=0, $parentId=0 ) + { + return $array; + } + + /** + * Post save + * Accepts an array of GENERIC data and allows manipulation after it's added to DB + * + * @param string Type of action (edit/add) + * @param array Array of GENERIC data (comment_xxxx) + * @param int Comment id (if available) + * @param int Parent id + * @return array Array of GENERIC data + */ + public function postSave( $type, array $array, $commentId=0, $parentId=0 ) + { + $_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) ); + $this->DB->update( 'rc_reports_index', array( 'num_comments' => $_cnt['total'], 'date_updated' => time(), 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId ); + + //$this->DB->setDataType( 'num_comments', 'int' ); + //$this->DB->update( 'rc_reports_index', array( 'num_comments' => 'plus:1', 'date_updated' => time(), 'updated_by' => $array['comment_author_id'] ), "id=" . $parentId ); + + //----------------------------------------- + // Notify other moderators + //----------------------------------------- + + $report = $this->fetchParent( $parentId ); + + $this->registry->class_localization->loadLanguageFile( array( 'public_reports' ) ); + + $this->DB->loadCacheFile( IPSLib::getAppDir('core') . '/sql/' . ips_DBRegistry::getDriverType() . '_report_queries.php', 'report_sql_queries' ); + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') .'/sources/classes/reportLibrary.php', 'reportLibrary' ); + $this->registry->setClass( 'reportLibrary', new $classToLoad( $this->registry ) ); + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/reportNotifications.php', 'reportNotifications' ); + $notify = new $classToLoad( $this->registry ); + + $this->registry->getClass('reportLibrary')->loadPlugin( $report['my_class'], $report['app'] ); + + if( is_object($this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]) ) + { + if( $report['extra_data'] && $report['extra_data'] != 'N;' ) + { + $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = unserialize( $report['extra_data'] ); + } + else + { + $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->_extra = array(); + } + + $report_data = $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->formatReportData( $report ); + + $notify->initNotify( $this->registry->getClass('reportLibrary')->plugins[ $report['my_class'] ]->getNotificationList( IPSText::cleanPermString( $report['mod_group_perm'] ), $report_data ), $report_data ); + $notify->sendReplyNotifications( $array['comment_text'] ); + } + + return $array; + } + + /** + * Post delete. Can do stuff and that + * + * @param array Array of comment IDs to be deleted + * @param int Parent ID + * @return void + */ + public function postDelete( $commentIds, $parentId ) + { + /* Determine most recent comment or report... */ + $_comment = $this->DB->buildAndFetch( array( 'select' => 'comment_by, comment_date', 'from' => 'rc_comments', 'where' => 'approved=1 AND rid=' . $parentId, 'order' => 'comment_date DESC', 'limit' => array( 1 ) ) ); + $_report = $this->DB->buildAndFetch( array( 'select' => 'report_by, date_reported', 'from' => 'rc_reports', 'where' => 'rid=' . $parentId, 'order' => 'date_reported DESC', 'limit' => array( 1 ) ) ); + + $_date_updated = 0; + $_updated_by = 0; + + if( $_comment['comment_date'] ) + { + $_date_updated = $_comment['comment_date']; + $_updated_by = $_comment['comment_by']; + } + + if( $_report['date_reported'] > $_date_updated ) + { + $_date_updated = $_report['date_reported']; + $_updated_by = $_report['report_by']; + } + + $_cnt = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments', 'where' => 'rid=' . $parentId ) ); + $this->DB->update( 'rc_reports_index', array( 'num_comments' => $_cnt['total'], 'date_updated' => $_date_updated, 'updated_by' => $_updated_by ), "id=" . $parentId ); + + //$this->DB->setDataType( 'num_comments', 'int' ); + //$this->DB->update( 'rc_reports_index', array( 'num_comments' => 'minus:' . count($commentIds) ), "id=" . $parentId ); + } + + /** + * Toggles visibility + * + * @param string on/off + * @param array Array of comment IDs to be deleted + * @param int Parent ID + * @return void + */ + public function postVisibility( $toggle, $commentIds, $parentId ) + { + } + + /** + * Fetch a total count of comments we can see + * + * @param mixed parent Id or parent array + * @return int + */ + public function count( $parent ) + { + /* Get parent */ + if ( is_numeric( $parent ) ) + { + $parent = $this->fetchParent( $parent ); + } + + return intval($parent['num_comments']); + } + + /** + * Perform a permission check + * + * @param string Type of check (add/edit/delete/editall/deleteall/approve all) + * @param array Array of GENERIC data + * @return true or string to be used in exception + */ + public function can( $type, array $array ) + { + /* Init */ + $comment = array(); + + /* Got data? */ + if ( empty( $array['comment_parent_id'] ) ) + { + trigger_error( "No parent ID passed to " . __FILE__, E_USER_WARNING ); + } + + /* Get the file */ + $event = $this->fetchParent( $array['comment_parent_id'] ); + + /* Fetch comment */ + if ( $array['comment_id'] ) + { + $comment = $this->fetchById( $array['comment_id'] ); + } + + /* Check permissions */ + switch( $type ) + { + case 'view': + return true; + break; + + case 'edit': + if( $this->memberData['g_is_supmod'] OR $this->memberData['member_id'] != $comment['comment_mid'] ) + { + return true; + } + + return 'NO_PERMISSION'; + break; + + case 'add': + return true; + break; + + case 'delete': + return $this->memberData['g_is_supmod'] ? true : 'NO_PERMISSION'; + break; + + case 'visibility': + case 'moderate': + return 'NO_PERMISSION'; + break; + } + } + + /** + * Returns remap keys (generic => local) + * + * @return array + */ + public function remapKeys( $type='comment' ) + { + return ( $type == 'comment' ) ? $this->_remap : $this->_parentRemap; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/coreExtensions.php b/upload/admin/applications/core/extensions/coreExtensions.php index bcd679eb..0b2ea3c1 100644 --- a/upload/admin/applications/core/extensions/coreExtensions.php +++ b/upload/admin/applications/core/extensions/coreExtensions.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Core Sessions
- * Last Updated: $Date: 2010-01-21 03:39:17 -0500 (Thu, 21 Jan 2010) $
+ * Last Updated: $Date: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
  * 
* - * @author $Author: matt $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 5732 $ + * @version $Rev: 9495 $ * */ @@ -25,6 +25,101 @@ if ( ! defined( 'IN_IPB' ) ) exit(); } +/** + *
+ * Invision Power Services
+ * IP.Board v3.2.3
+ * Item Marking
+ * Last Updated: $Date: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
+ * 
+ * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Downloads + * @link http://hatynka.in + * @version $Rev: 9495 $ + * + */ + +class itemMarking__core +{ + /**#@+ + * Registry Object Shortcuts + * + * @var object + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + /**#@-*/ + + /** + * I'm a constructor, twisted constructor + * + * @param object ipsRegistry reference + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make objects */ + $this->registry = $registry; + $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(); + } + + /** + * Convert Data + * Takes an array of app specific data and remaps it to the DB table fields + * + * @param array + * @return array + */ + public function convertData( $data ) + { + return $data; + } + + /** + * Fetch unread count + * + * Grab the number of items truly unread + * This is called upon by 'markRead' when the number of items + * left hits zero (or less). + * + * + * @param array Array of data + * @param array Array of read itemIDs + * @param int Last global reset + * @return integer Last unread count + */ + public function fetchUnreadCount( $data, $readItems, $lastReset ) + { + $readItems = is_array( $readItems ) ? $readItems : array( 0 ); + + $_count = $this->DB->buildAndFetch( array( + 'select' => 'COUNT(*) as cnt, MIN(date_updated) AS lastItem', + 'from' => 'rc_reports_index', + 'where' => "id NOT IN(" . implode( ",", array_keys( $readItems ) ) . ") AND date_updated > " . intval($lastReset) + ) ); + + return array( 'count' => intval( $_count['cnt'] ), + 'lastItem' => intval( $_count['lastItem'] ) ); + } +} + /** * Main loader class */ @@ -36,7 +131,6 @@ class publicSessions__core * current_appcomponent, current_module and current_section are automatically * stored. This function allows you to add specific variables in. * - * @access public * @author Matt Mecham * @return array */ @@ -50,6 +144,12 @@ class publicSessions__core 'location_1_id' => 0, 'location_2_type' => '', 'location_2_id' => 0 ); + + /* @link http://community.invisionpower.com/tracker/issue-33345-start-new-topic-reply-to-this-topic-online-list-location */ + if( ipsRegistry::$request['module'] == 'attach' ) + { + define( 'NO_SESSION_UPDATE', true ); + } return $array; } @@ -57,7 +157,6 @@ class publicSessions__core /** * Parse/format the online list data for the records * - * @access public * @author Brandon Farber * @param array Online list rows to check against * @return array Online list rows parsed diff --git a/upload/admin/applications/core/extensions/coreVariables.php b/upload/admin/applications/core/extensions/coreVariables.php index 385701e8..de69e3b2 100644 --- a/upload/admin/applications/core/extensions/coreVariables.php +++ b/upload/admin/applications/core/extensions/coreVariables.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Core registered caches, redirect resets and bitwise settings
- * Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
+ * Last Updated: $Date: 2011-03-15 18:03:09 -0400 (Tue, 15 Mar 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 6882 $ + * @version $Rev: 8085 $ * */ @@ -29,6 +29,11 @@ if ( ! defined( 'IN_IPB' ) ) */ $_LOAD = array(); +if( IN_ACP AND ( !isset($_GET['module']) OR $_GET['module'] == 'mycp' ) ) +{ + $_LOAD['stats'] = 1; +} + if( isset($_GET['module']) ) { if ( $_GET['module'] == 'search' ) @@ -45,6 +50,8 @@ if( isset($_GET['module']) ) $_LOAD['ranks'] = 1; $_LOAD['bbcode'] = 1; $_LOAD['emoticons'] = 1; + $_LOAD['reputation_levels'] = 1; + $_LOAD['moderators'] = 1; } if( $_GET['module'] == 'usercp' ) @@ -53,6 +60,31 @@ if( isset($_GET['module']) ) $_LOAD['reputation_levels'] = 1; $_LOAD['emoticons'] = 1; } + + if ( $_GET['module'] == 'modcp' ) + { + $_LOAD['moderators'] = 1; + $_LOAD['ranks'] = 1; + $_LOAD['bbcode'] = 1; + $_LOAD['emoticons'] = 1; + $_LOAD['reputation_levels'] = 1; + $_LOAD['attachtypes'] = 1; + } + + if( IN_ACP AND $_GET['module'] == 'applications' AND $_GET['section'] == 'hooks' ) + { + $_LOAD['disabledHooksCache'] = 1; + } +} +else if( IN_ACP ) +{ + $_LOAD['ranks'] = 1; + $_LOAD['reputation_levels'] = 1; + $_LOAD['emoticons'] = 1; + $_LOAD['moderators'] = 1; + $_LOAD['adminnotes'] = 1; + $_LOAD['performanceCache'] = 1; + $_LOAD['sphinx_config'] = 1; } diff --git a/upload/admin/applications/core/extensions/dashboardNotifications.php b/upload/admin/applications/core/extensions/dashboardNotifications.php index b4177d44..a2029330 100644 --- a/upload/admin/applications/core/extensions/dashboardNotifications.php +++ b/upload/admin/applications/core/extensions/dashboardNotifications.php @@ -2,17 +2,17 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Dashboard Notifications
  * Last Updated: $Date
  *
  * @author 		$Author: ips_terabyte $
  * @copyright	(c) 2001 - 2009 Invision Power Services, Inc.
- * @license		http://www.invisionpower.com/community/board/license.html
+ * @license		This is NULLED!
  * @package		IP.Board
  * @subpackage	Core
- * @link		http://www.invisionpower.com
- * @version		$Rev: 6980 $
+ * @link		http://hatynka.in
+ * @version		$Rev: 9551 $
  */
 
 if ( ! defined( 'IN_IPB' ) )
@@ -35,6 +35,7 @@ class dashboardNotifications__core
 	public $lang;
 	public $cache;
 	public $caches;
+	public $DB;
 	
 	public function __construct()
 	{
@@ -42,6 +43,7 @@ class dashboardNotifications__core
 		$this->lang		= ipsRegistry::getClass('class_localization');
 		$this->caches	=& ipsRegistry::cache()->fetchCaches();
 		$this->cache	= ipsRegistry::cache();
+		$this->DB		= ipsRegistry::DB();
 	}
 	
 	public function get()
@@ -49,15 +51,117 @@ class dashboardNotifications__core
 		/* INIT */
 		$entries = array();
 		
+		if( ! $this->settings['ipb_reg_number'] )
+		{
+			$entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) );
+		}
+		else
+		{
+			/* We need a classFileManagement object */
+			$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
+			$classFileManagement = new $classToLoad();
+			
+			/* Try to automatically update if expired */
+			$licenseData = $this->cache->getCache( 'licenseData' );
+			
+			if( ! $licenseData || ( $licenseData['key']['_expires'] != 9999999999 AND $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW ) )
+			{
+				/* Query the api */
+				$response = $classFileManagement->getFileContents( "http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" );
+	
+					/* Get License Data */
+					$licenseData = json_decode( $response, true );
+					
+					/* Copyright Removal? */
+					if ( $licenseData['cr'] )
+					{
+						IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) );
+					}
+					elseif ( $this->settings['ips_cp_purchase'] )
+					{
+						IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) );
+					}
+		
+					/* Save to cache */
+					$licenseData['_cached_date']	= time();
+					$licenseData['key']['_expires']	= $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999;
+					$licenseData['key']['expires']	= $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999;
+					
+					$this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) );
+
+			}
+			
+			/* Query the api */			
+			$response = $classFileManagement->getFileContents("http://myipb.in/license.php?api=checkService&service=ipb&lk={$this->settings['ipb_reg_number']}&domain={$this->settings['board_url']}" );
+
+			/* Get License Data */
+			$response = json_decode( $response, true );
+
+				/* Is the Spam Service Working? */
+				if ( $this->settings['spam_service_enabled'] )
+				{
+					//$lastLog = $this->DB->buildAndFetch( array( 'select' => 'log_code', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 1 ) ); // Order on ID since log_date has no index
+					
+					//if ( $lastLog['log_code'] === '0' )
+					
+					/* Get last 5 logs, and if all 5 are errors, show message */
+					$_errors	= 0;
+					$_entries	= 0;
+					$_lastError	= '';
+					
+					$this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) );
+					$this->DB->execute();
+					
+					while( $_r = $this->DB->fetch() )
+					{
+						$_entries++;
+						
+						if( $_r['log_code'] === '0' )
+						{
+							$_errors++;
+							
+							if( !$_lastError )
+							{
+								$_lastError	= $_r['log_msg'];
+							}
+						}
+					}
+					
+					if( $_entries > 0 && $_errors == $_entries )
+					{
+						$entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) );
+					}
+				}
+				/* If it's disabled, are we entitiled to it? */
+				else
+				{
+					$licenseData = $this->cache->getCache( 'licenseData' );
+					
+					if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
+					{
+						foreach ( $licenseData['ipbMain'] as $data )
+						{
+							if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
+							{
+								$entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] );
+								break;
+							}
+						}
+					}
+					
+				}
+			
+		}
+		
 		/* FURL cache OOD? */
-		if ( file_exists( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
+		if ( is_file( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
 		{
 			$mtime = intval( @filemtime( IPS_CACHE_PATH . 'cache/furlCache.php' ) );
 
 			/* Check mtimes on extensions.. */
 			foreach( ipsRegistry::$applications as $app_dir => $application )
 			{
-				if ( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
+				if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
 				{
 					$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) );
 
@@ -69,30 +173,46 @@ class dashboardNotifications__core
 				}
 			}
 		}
+		
+		/* Sphinx cache OOD? */
+		if ( $this->settings['search_method'] == 'sphinx' )
+		{
+			$mtime = intval( $this->cache->getCache('sphinx_config') );
 
+			/* Check mtimes on extensions.. */
+			foreach( ipsRegistry::$applications as $app_dir => $application )
+			{
+				if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) )
+				{
+					$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) );
+
+					if ( !$mtime OR $_mtime > $mtime )
+					{
+						$entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "{$this->lang->words['rebuild_sphinx_config']}" );
+						break;
+					}
+				}
+			}
+		}
+		
 		/* Minify on but /cache/tmp not writeable? */
-		if ( isset( $this->settings['_use_minify'] ) AND $this->settings['_use_minify'] )
+		if ( !empty( $this->settings['_use_minify'] ) )
 		{
 			$entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] );
 		}
 		
 		/* Installer Check */
-		if( @file_exists( IPS_ROOT_PATH . 'install/index.php' ) )
+		if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) )
 		{
-			if ( ! @file_exists( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
+			if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
 			{
 				$this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY );
 				$entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] );
 			}
 		}
-		else if( @is_dir( IPS_ROOT_PATH . 'applications_addon/ips/convert/' ) and !@file_exists( DOC_IPS_ROOT_PATH . 'cache/converter_lock.php' ) and $this->caches['app_cache']['convert'] )
-		{
-			$this->lang->words['cp_warning_converter']	= sprintf( $this->lang->words['cp_warning_converter'], $this->settings['_base_url'] );
-			$entries[] = array( $this->lang->words['cp_unlocked_converter'], $this->lang->words['cp_warning_converter'] );
-		}
 
 		/* Unfinished Upgrade */
-		require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );
+		require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/
 		$versions	= IPSSetUp::fetchAppVersionNumbers( 'core' );
 
 		if( $versions['current'][0] != $versions['latest'][0] )
@@ -108,16 +228,22 @@ class dashboardNotifications__core
 			$entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'],  PHP_VERSION ), $this->lang->words['cp_php_warning'] );
 		}
 
+		/* Outgoing email address specified */
+		if ( !$this->settings['email_out'] OR !$this->settings['email_in'] )
+		{
+			$entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_missingemail2']}" ); + } + /* Board Offline Check */ if ( $this->settings['board_offline'] ) { - $entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_boardoffline2']}" ); + $entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_boardoffline2']}" ); } /* Fulltext Check */ if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] ) { - $entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}

{$this->lang->words['_raquo']} {$this->lang->words['fulltext_find']}" ); + $entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}

{$this->lang->words['_raquo']} {$this->lang->words['fulltext_find']}" ); } /* Make sure the profile directory is writable */ @@ -176,7 +302,7 @@ class dashboardNotifications__core } /* SQL error check */ - if ( file_exists( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ) + /*if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ) { $unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ); @@ -187,10 +313,10 @@ class dashboardNotifications__core if ( $mtime == $now ) { - /* Display a message */ + // Display a message } } - } + }*/ return $entries; } diff --git a/upload/admin/applications/core/extensions/dataHookLocations.php b/upload/admin/applications/core/extensions/dataHookLocations.php new file mode 100644 index 00000000..a2435cce --- /dev/null +++ b/upload/admin/applications/core/extensions/dataHookLocations.php @@ -0,0 +1,25 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Define data hook locations (core) + * Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 May 2011) $ + *
+ * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Board + * @subpackage Core + * @link http://hatynka.in + * @version $Rev: 8812 $ + */ + +$dataHookLocations = array( + + /* POSTING LIBRARY DATA LOCATIONS */ + array( 'warnLogs', 'Insert Warn Log' ), + + +); \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/editorSections.php b/upload/admin/applications/core/extensions/editorSections.php index 151ca348..eb35e4d3 100644 --- a/upload/admin/applications/core/extensions/editorSections.php +++ b/upload/admin/applications/core/extensions/editorSections.php @@ -3,18 +3,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * BBCode Management : Determines if bbcode can be used in this section
- * Last Updated: $LastChangedDate: 2010-01-21 03:39:17 -0500 (Thu, 21 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-04-20 18:01:37 -0400 (Wed, 20 Apr 2011) $
  * 
* - * @author $Author: matt $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 5732 $ + * @link http://hatynka.in + * @version $Rev: 8419 $ * */ @@ -31,5 +31,6 @@ if ( ! defined( 'IN_IPB' ) ) * */ $BBCODE = array( - 'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'], + 'reports' => ipsRegistry::getClass('class_localization')->words['ctype__reports'], + 'global_comments' => ipsRegistry::getClass('class_localization')->words['ctype__comments'], ); \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/furlIdTemplates.php b/upload/admin/applications/core/extensions/furlIdTemplates.php index fd282df3..e1e9be09 100644 --- a/upload/admin/applications/core/extensions/furlIdTemplates.php +++ b/upload/admin/applications/core/extensions/furlIdTemplates.php @@ -9,10 +9,10 @@ * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 * @version $Rev: 6596 $ * diff --git a/upload/admin/applications/core/extensions/furlTemplates.php b/upload/admin/applications/core/extensions/furlTemplates.php index 510d709d..a6121f8b 100644 --- a/upload/admin/applications/core/extensions/furlTemplates.php +++ b/upload/admin/applications/core/extensions/furlTemplates.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Sets up SEO templates
- * Last Updated: $Date: 2010-07-01 18:13:46 -0400 (Thu, 01 Jul 2010) $
+ * Last Updated: $Date: 2011-09-16 07:16:26 -0400 (Fri, 16 Sep 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 6596 $ + * @version $Rev: 9496 $ * */ @@ -50,8 +50,12 @@ $_SEOTEMPLATES = array( 'allowRedirect' => 0, 'out' => array( '#app=core(&|&)module=global(&|&)section=register(&|&|$)#i', 'register/$3' ), 'in' => array( 'regex' => "#/register(/|$|\?)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ), - + 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ), +'likeunsubscribe' => array( 'app' => 'core', + 'allowRedirect' => 0, + 'out' => array( '#app=core(&|&)module=global(&|&)section=like(&|&)do=unsubscribe(&|&)key=(\S+?)(&|&|$)#i', 'unsubscribe/$5/' ), + 'in' => array( 'regex' => "#/unsubscribe/(\S+?)/$#i", + 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'like' ), array( 'do', 'unsubscribe' ), array( 'key', '$1' ) ) ) ), 'section=rss' => array( 'app' => 'core', 'allowRedirect' => 0, 'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)$#i', 'rss/$4/' ), diff --git a/upload/admin/applications/core/extensions/index.html b/upload/admin/applications/core/extensions/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/extensions/index.html +++ b/upload/admin/applications/core/extensions/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/navigation/generate.php b/upload/admin/applications/core/extensions/navigation/generate.php new file mode 100644 index 00000000..4eb0e20f --- /dev/null +++ b/upload/admin/applications/core/extensions/navigation/generate.php @@ -0,0 +1,98 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class navigation_core + * @brief Provide ability to share attachments via editor + */ +class navigation_core +{ + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @return @e void + */ + public function __construct() + { + $this->registry = ipsRegistry::instance(); + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + + /** + * Return the tab title + * + * @return @e string + */ + public function getTabName() + { + return $this->lang->words['quicknav_comm_link']; + } + + /** + * Returns navigation data + * + * @return @e array array( array( 0 => array( 'title' => 'x', 'url' => 'x' ) ) ); + */ + public function getNavigationData() + { + $blocks = array(); + $links = array(); + + $links[] = array( 'title' => $this->lang->words['view_new_posts'] , 'url' => $this->registry->output->buildUrl( 'app=core&module=search&do=viewNewContent&search_app=forums', 'public') ); + $links[] = array( 'title' => $this->lang->words['online_user_link'] , 'url' => $this->registry->output->buildUrl( 'app=members&module=online&sort_order=desc', 'public') ); + $links[] = array( 'title' => $this->lang->words['registered_users_link'], 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=list', 'public', 'false', 'members_list' ) ); + $links[] = array( 'title' => $this->lang->words['status_updates_link'] , 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=profile&section=status', 'public', 'false', 'members_status_all' ) ); + + /* Add to blocks */ + $blocks[] = array( 'title' => '', 'links' => $links ); + + return $blocks; + } +} \ No newline at end of file diff --git a/upload/admin/api/blog/index.html b/upload/admin/applications/core/extensions/navigation/index.html similarity index 81% rename from upload/admin/api/blog/index.html rename to upload/admin/applications/core/extensions/navigation/index.html index dfdb4ca9..bae2d5ed 100644 --- a/upload/admin/api/blog/index.html +++ b/upload/admin/applications/core/extensions/navigation/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/notifications.php b/upload/admin/applications/core/extensions/notifications.php index a2e32dc2..9133840c 100644 --- a/upload/admin/applications/core/extensions/notifications.php +++ b/upload/admin/applications/core/extensions/notifications.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Define the core notification types
- * Last Updated: $Date: 2010-10-25 10:10:56 -0400 (Mon, 25 Oct 2010) $
+ * Last Updated: $Date: 2011-03-11 06:59:39 -0500 (Fri, 11 Mar 2011) $
  * 
* - * @author $Author: mmecham $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 7030 $ + * @version $Rev: 8031 $ * */ @@ -37,9 +37,9 @@ class core_notifications $_NOTIFY = array( // Future... // array( 'key' => 'reputation_received', 'default' => array( 'inline' ), 'disabled' => array() ), - array( 'key' => 'report_center', 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => TRUE , 'icon' => 'notify_reportcenter' ), + array( 'key' => 'report_center', 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => TRUE, 'icon' => 'notify_reportcenter' ), array( 'key' => 'new_comment' , 'default' => array( 'email' ), 'disabled' => array(), 'show_callback' => false, 'icon' => 'notify_profilecomment' ), - ); + );/*noLibHook*/ return $_NOTIFY; } diff --git a/upload/admin/applications/core/extensions/reportPlugins/default.php b/upload/admin/applications/core/extensions/reportPlugins/default.php index a40c17dc..86ce4810 100644 --- a/upload/admin/applications/core/extensions/reportPlugins/default.php +++ b/upload/admin/applications/core/extensions/reportPlugins/default.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Report Center :: Default plugin
- * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @author Based on original "Report Center" by Luke Scott * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -25,25 +25,32 @@ if ( ! defined( 'IN_IPB' ) ) class default_plugin { - /**#@+ - * Registry objects + /** + * Registry Object Shortcuts * - * @access protected - * @var object - */ + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ protected $registry; protected $DB; protected $settings; protected $request; protected $lang; protected $member; + protected $memberData; protected $cache; - /**#@-*/ + protected $caches; /** * Holds extra data for the plugin * - * @access private * @var array Data specific to the plugin */ public $_extra; @@ -51,9 +58,8 @@ class default_plugin /** * Constructor * - * @access public - * @param object Registry object - * @return void + * @param object $registry Registry object + * @return @e void */ public function __construct( ipsRegistry $registry ) { @@ -74,7 +80,6 @@ class default_plugin /** * Display the form for extra data in the ACP * - * @access public * @param array Plugin data * @param object HTML object * @return string HTML to add to the form @@ -122,12 +127,12 @@ EOF; $return .= $html->addRow( "URL String", "The formatted URL that is used to point to the reported content. If the URL does not contain 'http://' the board's base url will be inserted. You may also include input data: {input_id}", $this->registry->output->formInput('string_url', $plugin_data['string_url']) - ); + );/*noLibHook*/ $return .= $html->addRow( "Title String", "The formatted title that is shown on the reporting page and when reports are listed. You may include input data: {input_id}. If you would like the report center to pull the page title, use #PAGE_TITLE#", $this->registry->output->formInput('string_title', $plugin_data['string_title']) - ); + );/*noLibHook*/ return $return; } @@ -135,7 +140,6 @@ EOF; /** * Process the plugin's form fields for saving * - * @access public * @param array Plugin data for save * @return string Error message */ @@ -176,7 +180,6 @@ EOF; /** * Update timestamp for report * - * @access public * @param array New reports * @param array New members cache * @return boolean @@ -189,7 +192,6 @@ EOF; /** * Get report permissions * - * @access public * @param string Type of perms to check * @param array Permissions data * @param array group ids @@ -211,7 +213,6 @@ EOF; /** * Show the report form for this module * - * @access public * @param array Application data * @return string HTML form information */ @@ -236,7 +237,6 @@ EOF; /** * Process the basic forum data * - * @access public * @param array Application data * @param string URL * @param string Title @@ -317,7 +317,6 @@ EOF; /** * Get section and link * - * @access public * @param array Report data * @return array Section/link */ @@ -332,7 +331,6 @@ EOF; /** * Process a report and save the data appropriate * - * @access public * @param array Report data * @return array Data from saving the report */ @@ -417,13 +415,28 @@ EOF; return $return_data; } + + /** + * Accepts an array of data from rc_reports_index and returns an array formatted nearly identical to processReport() + * + * @param array Report data + * @return array Formatted report data + */ + public function formatReportData( $report_data ) + { + return array( + 'REDIRECT_URL' => $report_data['url'], + 'REPORT_INDEX' => $report_data['id'], + 'SAVED_URL' => $report_data['url'], + 'REPORT' => '', + ); + } /** * Where to send user after report is submitted * - * @access public * @param array Report data - * @return void + * @return @e void */ public function reportRedirect( $report_data ) { @@ -433,11 +446,10 @@ EOF; /** * Loads an HTML page and grabs its title * - * @access private * @param string Web URL * @return string */ - private function _getPageTitle( $URL ) + protected function _getPageTitle( $URL ) { $html_code = file_get_contents( $URL ); @@ -455,7 +467,6 @@ EOF; /** * Retrieve list of users to send notifications to * - * @access public * @param string Group ids * @param array Report data * @return array Array of users to PM/Email @@ -465,16 +476,16 @@ EOF; $notify = array(); $this->DB->build( array( - 'select' => 'noti.*', - 'from' => array( 'rc_modpref' => 'noti' ), - 'where' => 'mem.member_group_id IN(' . $group_ids . ')', - 'add_join' => array( - array( - 'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id', - 'from' => array( 'members' => 'mem' ), - 'where' => 'mem.member_id=noti.mem_id', - ) + 'select' => 'mem.member_id, mem.members_display_name as name, mem.language, mem.members_disable_pm, mem.email, mem.member_group_id', + 'from' => array( 'members' => 'mem' ), + 'where' => 'mem.member_group_id IN(' . $group_ids . ')', + 'add_join' => array( + array( + 'select' => 'noti.*', + 'from' => array( 'rc_modpref' => 'noti' ), + 'where' => 'mem.member_id=noti.mem_id', ) + ) ) ); $this->DB->execute(); diff --git a/upload/admin/applications/core/extensions/reportPlugins/index.html b/upload/admin/applications/core/extensions/reportPlugins/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/extensions/reportPlugins/index.html +++ b/upload/admin/applications/core/extensions/reportPlugins/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/rssOutput.php b/upload/admin/applications/core/extensions/rssOutput.php index 9552b2af..5048a4cd 100644 --- a/upload/admin/applications/core/extensions/rssOutput.php +++ b/upload/admin/applications/core/extensions/rssOutput.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * RSS output plugin :: report center
- * Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
+ * Last Updated: $Date: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
  * 
* - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 6/24/2008 - * @version $Revision: 6980 $ + * @version $Revision: 8021 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -30,7 +30,7 @@ class rss_output_core * * @var integer Expiration timestamp */ - private $expires = 0; + protected $expires = 0; /** * Grab the RSS links diff --git a/upload/admin/applications/core/extensions/search/config.php b/upload/admin/applications/core/extensions/search/config.php index fea89127..cba2e621 100644 --- a/upload/admin/applications/core/extensions/search/config.php +++ b/upload/admin/applications/core/extensions/search/config.php @@ -1,20 +1,21 @@ * Invision Power Services - * IP.Board v3.1.4 + * IP.Board v3.2.3 * Config file - * Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $ + * Last Updated: $Date: 2011-04-13 23:15:13 -0400 (Wed, 13 Apr 2011) $ * * * @author $author$ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Forums - * @link http://www.invisionpower.com - * @version $Rev: 5855 $ - **/ + * @link http://hatynka.in + * @version $Rev: 8333 $ + */ if ( ! defined( 'IN_IPB' ) ) { @@ -23,13 +24,10 @@ if ( ! defined( 'IN_IPB' ) ) } /* Can search with this app */ -$CONFIG['can_search'] = 1; +$CONFIG['can_search'] = 1; /* Can view new content with this app */ -$CONFIG['can_viewNewContent'] = 0; - -/* Can fetch active content with this app */ -$CONFIG['can_activeContent'] = 0; +$CONFIG['can_viewNewContent'] = 0; /* Can fetch user generated content */ -$CONFIG['can_userContent'] = 0; \ No newline at end of file +$CONFIG['can_userContent'] = 0; \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/search/engines/index.html b/upload/admin/applications/core/extensions/search/engines/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/extensions/search/engines/index.html +++ b/upload/admin/applications/core/extensions/search/engines/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/search/engines/sql.php b/upload/admin/applications/core/extensions/search/engines/sql.php index 20f5cfc8..7fae8788 100644 --- a/upload/admin/applications/core/extensions/search/engines/sql.php +++ b/upload/admin/applications/core/extensions/search/engines/sql.php @@ -2,18 +2,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Basic Forum Search
- * Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 Feb 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: matt $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Forums - * @link http://www.invisionpower.com - * @version $Rev: 5861 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -26,6 +26,9 @@ class search_engine_core extends search_engine { /** * Constructor + * + * @param object ipsRegistry reference + * @return @e void */ public function __construct( ipsRegistry $registry ) { @@ -39,78 +42,50 @@ class search_engine_core extends search_engine * * So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25 * - * @access public * @return array */ public function search() { - /* INIT */ - $count = 0; - $results = array(); - $sort_by = IPSSearchRegistry::get('in.search_sort_by'); - $sort_order = IPSSearchRegistry::get('in.search_sort_order'); - $search_term = IPSSearchRegistry::get('in.clean_search_term'); - $content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly'); - $post_search_only = IPSSearchRegistry::get('opt.onlySearchPosts'); - $order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc'; - $sortKey = ''; - $sortType = ''; - $rows = array(); - $got = 0; - - if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('display.onlyTitles') ) - { - $group_by = 'h.id'; - } - + /* INIT */ + $sort_by = IPSSearchRegistry::get('in.search_sort_by'); + $sort_order = IPSSearchRegistry::get('in.search_sort_order'); + $search_term = IPSSearchRegistry::get('in.clean_search_term'); + $sortKey = ''; + $rows = array(); + /* Sorting */ switch( $sort_by ) { default: case 'date': - $sortKey = ( $content_title_only ) ? 'id' : 'id'; - $sortType = 'numerical'; + $sortKey = 'id'; break; case 'title': $sortKey = 'title'; - $sortType = 'string'; break; } /* Query the count */ $count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results', - 'from' => array( 'faq' => 'h' ), - 'where' => $this->_buildWhereStatement( $search_term, $content_title_only ), - 'group' => $group_by, - 'add_join' => array( array( 'from' => array( 'permission_index' => 'i' ), - 'where' => "i.perm_type='help' AND i.perm_type_id=1", - 'type' => 'left' ) ) ) ); + 'from' => 'faq', + 'where' => $this->_buildWhereStatement( $search_term ), + ) ); /* Fetch data */ - $this->DB->build( array( 'select' => 'h.*', - 'from' => array( 'faq' => 'h' ), - 'where' => $this->_buildWhereStatement( $search_term, $content_title_only ), - 'group' => $group_by, + $this->DB->build( array( 'select' => '*', + 'from' => 'faq', + 'where' => $this->_buildWhereStatement( $search_term ), 'order' => $sortKey . ' ' . $sort_order, 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), - 'add_join' => array( array( 'from' => array( 'permission_index' => 'i' ), - 'where' => "i.perm_type='help' AND i.perm_type_id=1", - 'type' => 'left' ) ) ) ); - - - - - + ) ); $this->DB->execute(); - /* Sort */ + /* Get results */ while ( $_row = $this->DB->fetch() ) { - $rows[ $got ] = $_row; - - $got++; + $rows[] = $_row; } /* Return it */ @@ -120,25 +95,30 @@ class search_engine_core extends search_engine /** * Builds the where portion of a search string * - * @access private * @param string $search_term The string to use in the search - * @param bool $content_title_only Search only title records * @return string - **/ - private function _buildWhereStatement( $search_term, $content_title_only=false ) + */ + protected function _buildWhereStatement( $search_term ) { /* INI */ $where_clause = array(); if( $search_term ) { - if( $content_title_only ) + switch( IPSSearchRegistry::get('opt.searchType') ) { - $where_clause[] = "h.title LIKE '%{$search_term}%'"; - } - else - { - $where_clause[] = "(h.title LIKE '%{$search_term}%' OR h.text LIKE '%{$search_term}%' OR h.description LIKE '%{$search_term}%')"; + case 'both': + default: + $where_clause[] = "(title LIKE '%{$search_term}%' OR text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')"; + break; + + case 'titles': + $where_clause[] = "title LIKE '%{$search_term}%'"; + break; + + case 'content': + $where_clause[] = "(text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')"; + break; } } @@ -154,9 +134,6 @@ class search_engine_core extends search_engine $where_clause[] = '( ' . implode( ' OR ', $this->whereConditions['OR'] ) . ' )'; } - /* Permissions */ - $where_clause[] = $this->DB->buildRegexp( "i.perm_view", $this->member->perm_id_array ); - /* Build and return the string */ return implode( " AND ", $where_clause ); } @@ -164,10 +141,9 @@ class search_engine_core extends search_engine /** * Remap standard columns (Apps can override ) * - * @access public * @param string $column sql table column for this condition * @return string column - * @return void + * @return @e void */ public function remapColumn( $column ) { @@ -182,26 +158,17 @@ class search_engine_core extends search_engine /** * Returns an array used in the searchplugin's setCondition method * - * @access public * @param array $data Array of forums to view * @return array Array with column, operator, and value keys, for use in the setCondition call - **/ + */ public function buildFilterSQL( $data ) { - /* INIT */ - $return = array(); - - /* Set up some defaults */ - IPSSearchRegistry::set( 'opt.noPostPreview' , false ); - IPSSearchRegistry::set( 'opt.onlySearchPosts', false ); - return array(); } /** * Can handle boolean searching * - * @access public * @return boolean */ public function isBoolean() diff --git a/upload/admin/applications/core/extensions/search/form.php b/upload/admin/applications/core/extensions/search/form.php index f3c7b98b..00ea6c3f 100644 --- a/upload/admin/applications/core/extensions/search/form.php +++ b/upload/admin/applications/core/extensions/search/form.php @@ -1,20 +1,21 @@ * Invision Power Services - * IP.Board v3.1.4 + * IP.Board v3.2.3 * Returns HTML for the form (optional class, not required) - * Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $ + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $ * * * @author $author$ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Forums - * @link http://www.invisionpower.com - * @version $Rev: 5855 $ - **/ + * @link http://hatynka.in + * @version $Rev: 8644 $ + */ if ( ! defined( 'IN_IPB' ) ) { @@ -27,6 +28,7 @@ class search_form_core /** * Construct * + * @return @e void */ public function __construct() { @@ -45,8 +47,6 @@ class search_form_core /** * Return sort drop down * - * - * @access public * @return array */ public function fetchSortDropDown() diff --git a/upload/admin/applications/core/extensions/search/format.php b/upload/admin/applications/core/extensions/search/format.php index 4cf6323a..a092d4a5 100644 --- a/upload/admin/applications/core/extensions/search/format.php +++ b/upload/admin/applications/core/extensions/search/format.php @@ -1,20 +1,21 @@ * Invision Power Services - * IP.Board v3.1.4 + * IP.Board v3.2.3 * Formats forum search results - * Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $ + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $ * * * @author $author$ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Forums - * @link http://www.invisionpower.com - * @version $Rev: 5855 $ - **/ + * @link http://hatynka.in + * @version $Rev: 8644 $ + */ if ( ! defined( 'IN_IPB' ) ) { @@ -26,6 +27,9 @@ class search_format_core extends search_format { /** * Constructor + * + * @param object ipsRegistry + * @return @e void */ public function __construct( ipsRegistry $registry ) { @@ -35,7 +39,6 @@ class search_format_core extends search_format /** * Parse search results * - * @access private * @param array $r Search result * @return array $html Blocks of HTML */ @@ -47,20 +50,18 @@ class search_format_core extends search_format /** * Formats the forum search result for display * - * @access public * @param array $search_row Array of data * @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content - **/ + */ public function formatContent( $data ) { - return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('display.onlyTitles') ), 0 ); + return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('opt.searchType') == 'titles' ? true : false ), 0 ); } /** * Formats / grabs extra data for results * Takes an array of IDS (can be IDs from anything) and returns an array of expanded data. * - * @access public * @return array */ public function processResults( $ids ) @@ -80,7 +81,7 @@ class search_format_core extends search_format * * @param array $r * @return array - **/ + */ public function genericizeResults( $r ) { $r['app'] = 'core'; @@ -92,5 +93,4 @@ class search_format_core extends search_format return $r; } - } \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/search/index.html b/upload/admin/applications/core/extensions/search/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/extensions/search/index.html +++ b/upload/admin/applications/core/extensions/search/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/members/extensions/portalPlugins/index.html b/upload/admin/applications/core/extensions/sharedmedia/index.html similarity index 81% rename from upload/admin/applications/members/extensions/portalPlugins/index.html rename to upload/admin/applications/core/extensions/sharedmedia/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/members/extensions/portalPlugins/index.html +++ b/upload/admin/applications/core/extensions/sharedmedia/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php b/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php new file mode 100644 index 00000000..003ed72c --- /dev/null +++ b/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php @@ -0,0 +1,232 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class plugin_core_attachments + * @brief Provide ability to share attachments via editor + */ +class plugin_core_attachments +{ + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Attachments class + * + * @var object + */ + protected $attach; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + //----------------------------------------- + // Make shortcuts + //----------------------------------------- + + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + + /** + * Return the tab title + * + * @return @e string + */ + public function getTab() + { + if( $this->memberData['member_id'] ) + { + return $this->lang->words['sharedmedia_attachments']; + } + } + + /** + * Return the HTML to display the tab + * + * @return @e string + */ + public function showTab( $string ) + { + //----------------------------------------- + // Are we a member? + //----------------------------------------- + + if( !$this->memberData['member_id'] ) + { + return ''; + } + + //----------------------------------------- + // How many attachments do we have? + //----------------------------------------- + + $mimes = $this->cache->getCache('attachtypes'); + $st = intval($this->request['st']); + $each = 30; + $where = ''; + + if( $string ) + { + $where = " AND attach_file LIKE '%{$string}%'"; + } + + $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as total', 'from' => 'attachments', 'where' => "attach_member_id={$this->memberData['member_id']}" . $where ) ); + $rows = array(); + + $pages = $this->registry->output->generatePagination( array( 'totalItems' => $count['total'], + 'itemsPerPage' => $each, + 'currentStartValue' => $st, + 'seoTitle' => '', + 'method' => 'nextPrevious', + 'noDropdown' => true, + 'ajaxLoad' => 'mymedia_content', + 'baseUrl' => "app=core&module=ajax&section=media&do=loadtab&tabapp=core&tabplugin=attachments&search=" . urlencode($string) ) ); + + $this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_member_id={$this->memberData['member_id']}" . $where, 'order' => 'attach_date DESC', 'limit' => array( $st, $each ) ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + if( $r['attach_thumb_location'] ) + { + $image = $this->settings['upload_url'] . '/' . $r['attach_thumb_location']; + + $dims = IPSLib::scaleImage( array( + 'cur_width' => $r['attach_thumb_width'], + 'cur_height' => $r['attach_thumb_height'], + 'max_width' => 80, + 'max_height' => 80, + ) ); + $width = $dims['img_width']; + $height = $dims['img_height']; + } + else + { + $image = $this->settings['public_dir'] . $mimes[ $r['attach_ext'] ]['atype_img']; + $width = 0; + $height = 0; + } + + $rows[] = array( + 'image' => $image, + 'width' => $width, + 'height' => $height, + 'title' => IPSText::truncate( $r['attach_file'], 25 ), + 'desc' => '', + 'insert' => "core:attachments:" . $r['attach_id'], + ); + } + + return $this->registry->output->getTemplate('editors')->mediaGenericWrapper( $rows, $pages, 'core', 'attachments' ); + } + + /** + * Return the HTML output to display + * + * @param int $attachId Attachment ID to show + * @return @e string + */ + public function getOutput( $attachId=0 ) + { + $attachId = intval($attachId); + + if( !$attachId ) + { + return ''; + } + + if( !is_object($this->attach) ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' ); + $this->attach = new $classToLoad( $this->registry ); + } + + $attachment = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id=' . $attachId ) ); + + $this->attach->type = $attachment['attach_rel_module']; + $this->attach->init(); + + $output = $this->attach->renderSingleAttachment( $attachment ); + + return $output; + } + + /** + * Verify current user has permission to post this + * + * @param int $attachId Attachment ID to show + * @return @e bool + */ + public function checkPostPermission( $attachId ) + { + $attachId = intval($attachId); + + if( !$attachId ) + { + return ''; + } + + if( $this->memberData['g_is_supmod'] OR $this->memberData['is_mod'] ) + { + return ''; + } + + $attachment = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id=' . $attachId ) ); + + if( $this->memberData['member_id'] AND $attachment['attach_member_id'] == $this->memberData['member_id'] ) + { + return ''; + } + + return 'no_permission_shared'; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/sphinxTemplate.php b/upload/admin/applications/core/extensions/sphinxTemplate.php index 2d2259ed..fdbb5ac9 100644 --- a/upload/admin/applications/core/extensions/sphinxTemplate.php +++ b/upload/admin/applications/core/extensions/sphinxTemplate.php @@ -3,18 +3,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Sphinx template file
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-08-31 20:57:38 -0400 (Wed, 31 Aug 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ + * @subpackage Forums + * @link http://hatynka.in + * @version $Rev: 9438 $ * @since 3.0.0 * */ @@ -27,62 +27,64 @@ if ( ! defined( 'IN_IPB' ) ) $appSphinxTemplate = <<core_tags_search_main : ipb_source_config { # Set our forum PID counter - sql_query_pre = REPLACE INTO cache_store VALUES( 'sphinx_core_counter', (SELECT max(id) FROM faq), '', 0, UNIX_TIMESTAMP() ) + sql_query_pre = REPLACE INTO cache_store VALUES( 'sphinx_core_tags_counter', (SELECT max(tag_id) FROM core_tags), 0, UNIX_TIMESTAMP(), 0 ) # Query posts for the main source - sql_query = SELECT f.*, f.id as search_id, \ - REPLACE( pi.perm_view, '*', 0 ) as perm_view \ - FROM faq f \ - LEFT JOIN permission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='help' ) \ - WHERE f.id <= ( SELECT cs_value FROM cache_store WHERE cs_key='sphinx_core_counter' ) + sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, t.tag_meta_area, \ + p.tag_perm_text, p.tag_perm_visible \ + FROM core_tags t \ + LEFT JOIN core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \ + WHERE t.tag_id <= ( SELECT cs_value FROM cache_store WHERE cs_key='sphinx_core_tags_counter' ) # Fields - sql_attr_uint = search_id - + sql_attr_uint = search_id + sql_attr_timestamp = tag_added + sql_attr_uint = tag_member_id + sql_attr_uint = tag_meta_id + sql_attr_uint = tag_meta_parent_id + sql_attr_uint = tag_perm_visible sql_ranged_throttle = 0 } -source core_search_delta : core_search_main +source core_tags_search_delta : core_tags_search_main { # Override the base sql_query_pre sql_query_pre = # Query posts for the main source - sql_query = SELECT f.*, f.id as search_id, \ - REPLACE( pi.perm_view, '*', 0 ) as perm_view \ - FROM faq f \ - LEFT JOIN permission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='help' ) \ - WHERE f.id > ( SELECT cs_value FROM cache_store WHERE cs_key='sphinx_core_counter' ) - - # Fields - sql_attr_uint = search_id - - sql_ranged_throttle = 0 + sql_query = SELECT t.tag_id, t.tag_id as search_id, t.tag_added, t.tag_member_id, t.tag_meta_id, t.tag_meta_parent_id, t.tag_text, t.tag_meta_app, t.tag_meta_area, \ + p.tag_perm_text, p.tag_perm_visible \ + FROM core_tags t \ + LEFT JOIN core_tags_perms p ON ( t.tag_aai_lookup=p.tag_perm_aai_lookup ) \ + WHERE t.tag_id > ( SELECT cs_value FROM cache_store WHERE cs_key='sphinx_core_tags_counter' ) } -index core_search_main +index core_tags_search_main { - source = core_search_main - path = /core_search_main + source = core_tags_search_main + path = /core_tags_search_main docinfo = extern mlock = 0 morphology = none min_word_len = 2 - charset_type = sbcs - html_strip = 0 + charset_type = utf-8 + html_strip = 0 + #infix_fields = tag_text + #min_infix_len = 3 + #enable_star = 1 } -index core_search_delta : core_search_main +index core_tags_search_delta : core_tags_search_main { - source = core_search_delta - path = /core_search_delta + source = core_tags_search_delta + path = /core_tags_search_delta } - EOF; + diff --git a/upload/admin/applications/core/extensions/usercpForms.php b/upload/admin/applications/core/extensions/usercpForms.php index b96019f3..96db61e4 100644 --- a/upload/admin/applications/core/extensions/usercpForms.php +++ b/upload/admin/applications/core/extensions/usercpForms.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Core user control panel plugin
- * Last Updated: $Date: 2010-10-25 06:54:59 -0400 (Mon, 25 Oct 2010) $
+ * Last Updated: $Date: 2011-10-10 16:21:29 -0400 (Mon, 10 Oct 2011) $
  * 
* - * @author $Author: mmecham $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 7029 $ + * @version $Rev: 9590 $ * */ @@ -36,6 +36,13 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte */ public $tab_name = "Настройки"; + /** + * Default area code + * + * @var string + */ + public $defaultAreaCode = 'profileinfo'; + /** * OK Message * This is an optional message to return back to the framework @@ -48,7 +55,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte /** * Hide 'save' button and form elements * Useful if you have custom output that doesn't - * require it + * need to use it * * @var bool */ @@ -67,11 +74,18 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte * @var boolean */ protected $_isFBUser = false; + + /** + * Flag to indicate compatibility + * + * @var int + */ + public $version = 32; /** * Initiate this module * - * @return void + * @return @e void */ public function init( ) { @@ -102,23 +116,26 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $array = array(); - $array[] = array( 'url' => 'area=settings', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['ucp_general_settings'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'settings' ? 1 : 0, - 'area' => 'settings' - ); - + $array[] = array( 'url' => 'area=profileinfo', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['change_settings'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'profileinfo' ? 1 : 0, + 'area' => 'profileinfo' + ); + + if ( $this->memberData['gbw_allow_customization'] AND ! $this->memberData['bw_disable_customization'] ) + { + $array[] = array( 'url' => 'area=customize', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_customize'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'customize' ? 1 : 0, + 'area' => 'customize' + ); + } + $array[] = array( 'url' => 'area=email', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['ucp_change_email'], + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_email_pass_change'], 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'email' ? 1 : 0, 'area' => 'email' ); - - $array[] = array( 'url' => 'area=password', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['ucp_change_password'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'password' ? 1 : 0, - 'area' => 'password' - ); if ( $this->settings['auth_allow_dnames'] == 1 AND $this->memberData['g_dname_changes'] > 0 ) { @@ -128,13 +145,51 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte 'area' => 'displayname' ); } - - $array[] = array( 'url' => 'area=notes', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_notes'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'notes' ? 1 : 0, - 'area' => 'notes' - ); - + + $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); + + if ( ! $sig_restrictions[0] OR ( $sig_restrictions[0] AND $this->memberData['g_sig_unit'] ) ) + { + $array[] = array( 'url' => 'area=signature', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_sig_info'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'signature' ? 1 : 0, + 'area' => 'signature' + ); + } + + $array[] = array( 'url' => 'area=ignoredusers', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_ignore_users'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'ignoredusers' ? 1 : 0, + 'area' => 'ignoredusers' + ); + + if ( IPSLib::fbc_enabled() === TRUE ) + { + $array[] = array( 'url' => 'area=facebook', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_facebook'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'facebook' ? 1 : 0, + 'area' => 'facebook' + ); + } + + if ( IPSLib::twitter_enabled() === TRUE ) + { + $array[] = array( 'url' => 'area=twitter', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_twitter'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'twitter' ? 1 : 0, + 'area' => 'twitter' + ); + } + + if ( IPSLib::vkontakte_enabled() === TRUE ) + { + $array[] = array( 'url' => 'area=vkontakte', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_vkontakte'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'vkontakte' ? 1 : 0, + 'area' => 'vkontakte' + ); + } + if ( $this->memberData['g_attach_max'] != -1 ) { $array[] = array( @@ -144,17 +199,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte 'area' => 'attachments' ); } - - if( IPSLib::haveAppsWithLike() ) - { - $array[] = array( - 'url' => 'area=likes', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_likesystem'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'likes' ? 1 : 0, - 'area' => 'likes' - ); - } - + $array[] = array( 'url' => 'area=notifications', 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_notifications'], 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'notifications' ? 1 : 0, @@ -200,6 +245,27 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte switch( $currentArea ) { + case 'removeIgnoredUser': + return $this->customEvent_removeIgnoredUser(); + break; + case 'toggleIgnoredUser': + return $this->customEvent_toggleIgnoredUser(); + break; + case 'facebookSync': + $html = $this->customEvent_facebookSync(); + break; + case 'facebookRemove': + $html = $this->customEvent_facebookRemove(); + break; + case 'vkontakteRemove': + $html = $this->customEvent_vkontakteRemove(); + break; + case 'twitterRemove': + $html = $this->customEvent_twitterRemove(); + break; + case 'facebookLink': + $html = $this->customEvent_facebookLink(); + break; case 'updateAttachments': return $this->customEvent_updateAttachments(); break; @@ -215,10 +281,6 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte case 'removeNotifications': return $this->customEvent_removeNotifications(); break; - - case 'moderateLikes': - return $this->customEvent_moderateLikeList(); - break; } //----------------------------------------- @@ -233,119 +295,6 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte return $html; } - - /** - * Moderate your list of liked content - * - * @author bfarber - * @return string HTML to display - */ - public function customEvent_moderateLikeList() - { - //----------------------------------------- - // Get the likes we selected - //----------------------------------------- - - $_likes = array(); - - if( is_array($this->request['likes']) AND count($this->request['likes']) ) - { - foreach( $this->request['likes'] as $_like ) - { - $_thisLike = explode( '-', $_like ); - $_likes[] = array( - 'app' => $_thisLike[0], - 'area' => $_thisLike[1], - 'id' => $_thisLike[2], - ); - } - } - - //----------------------------------------- - // Got any? - //----------------------------------------- - - if( !count($_likes) OR !is_array($_likes) ) - { - return $this->showLikeList( $this->lang->words['no_likes_for_del'] ); - } - - //----------------------------------------- - // Get like helper class - //----------------------------------------- - - $bootstraps = array(); - - require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' ); - - //----------------------------------------- - // Loop over and moderate - //----------------------------------------- - - foreach( $_likes as $_like ) - { - $_bootstrap = classes_like::bootstrap( $_like['app'], $_like['area'] ); - $_likeKey = classes_like_registry::getKey( $_like['id'], $this->memberData['member_id'] ); - $_frequencies = $_bootstrap->allowedFrequencies(); - - //----------------------------------------- - // What action to take? - //----------------------------------------- - - switch( $this->request['modaction'] ) - { - case 'delete': - $_bootstrap->remove( $_like['id'], $this->memberData['member_id'] ); - break; - - case 'change-donotify': - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - - case 'change-donotnotify': - $this->DB->update( 'core_like', array( 'like_notify_do' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - - case 'change-immediate': - if( in_array( 'immediate', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-offline': - if( in_array( 'offline', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'offline' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-daily': - if( in_array( 'daily', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'daily' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-weekly': - if( in_array( 'weekly', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'weekly' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-anon': - $this->DB->update( 'core_like', array( 'like_is_anon' => 1 ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - - case 'change-noanon': - $this->DB->update( 'core_like', array( 'like_is_anon' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - } - } - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=likes&confirm=1" ); - } /** * Delete attachments @@ -518,7 +467,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte } else { - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=notificationlog" ); + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); } } @@ -531,7 +480,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte } else { - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=notificationlog" ); + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); } } @@ -558,9 +507,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte } else { - $_returnTo = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $this->settings['base_url']; - - $this->registry->output->silentRedirect( $_returnTo ); + $this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); } } @@ -637,7 +584,271 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $this->_nav[] = array( $this->lang->words['m_arch_notify'], 'app=core&module=usercp&tab=core&area=notificationlog' ); return $this->registry->getClass('output')->getTemplate('ucp')->showNotification( $notification ); } + + /** + * Custom Event: Remove Twitter link + * + * @return @e void + */ + public function customEvent_twitterRemove() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + //----------------------------------------- + // Okay... + //----------------------------------------- + + if ( $this->memberData['twitter_id'] ) + { + /* Remove the link */ + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'twitter_id' => 0, 'twitter_token' => '', 'twitter_secret' => '' ) ) ); + } + + /* Log the user out */ + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); + } + + /** + * Custom Event: Remove facebook link + * + * @return @e void + */ + public function customEvent_vkontakteRemove() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); + $vkontakte = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Okay... + //----------------------------------------- + + if ( $this->memberData['vk_uid'] ) + { + /* Remove the link */ + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'vk_uid' => 0, 'vk_token' => '' ) ) ); + } + + /* Log the user out */ + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); + } + + /** + * Custom Event: Create facebook link + * + * @return @e void + */ + public function customEvent_facebookLink() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + /* Load application */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + try + { + $facebook->linkMember( $this->memberData['member_id'] ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + default: + case 'NO_FACEBOOK_USER_LOGGED_IN': + case 'ALREADY_LINKED': + $this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005.99, null, null, 403 ); + break; + } + } + + //----------------------------------------- + // Return + //----------------------------------------- + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=facebook&do=show" ); + } + + /** + * Custom Event: Remove facebook link + * + * @return @e void + */ + public function customEvent_facebookRemove() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Okay... + //----------------------------------------- + + if ( $this->memberData['fb_uid'] ) + { + /* Unauthorize application */ + $facebook->revokeAuthorization(); + + /* Remove the link */ + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'fb_uid' => 0, 'fb_emailhash' => '', 'fb_token' => '', 'fb_lastsync' => 0 ) ) ); + } + + /* Log the user out */ + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); + } + + /** + * Custom Event: Sync up facebook + * NO LONGER USED. LEFT FOR FIX CONFIRMATION + * + * @return @e void + */ + public function customEvent_facebookSync() + { + if ( IPSLib::fbc_enabled() === TRUE ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + try + { + $facebook->syncMember( $this->memberData ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + case 'NOT_LINKED': + case 'NO_MEMBER': + default: + $this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005, null, null, 403 ); + break; + } + } + + //----------------------------------------- + // Return + //----------------------------------------- + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=facebook&do=show" ); + } + } + + /** + * Custom Event: Run the find user tool + * + * @return @e void + */ + public function customEvent_toggleIgnoredUser() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $member_id = intval( $this->request['id'] ); + $field = $this->request['field']; + $update = array(); + + //----------------------------------------- + // Grab user + //----------------------------------------- + + $ignoredUser = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'ignored_users', + 'where' => 'ignore_ignore_id=' . $member_id . ' AND ignore_owner_id=' . $this->memberData['member_id'] ) ); + + if ( $ignoredUser['ignore_id'] ) + { + switch( $field ) + { + default: + case 'topics': + $update = array( 'ignore_topics' => ( $ignoredUser['ignore_topics'] == 1 ) ? 0 : 1 ); + break; + case 'messages': + $update = array( 'ignore_messages' => ( $ignoredUser['ignore_messages'] == 1 ) ? 0 : 1 ); + break; + case 'signatures': + $update = array( 'ignore_signatures' => ( $ignoredUser['ignore_signatures'] == 1 ) ? 0 : 1 ); + break; + case 'chats': + $update = array( 'ignore_chats' => ( $ignoredUser['ignore_chats'] == 1 ) ? 0 : 1 ); + break; + } + + //----------------------------------------- + // Update + //----------------------------------------- + + $this->DB->update( 'ignored_users', $update, 'ignore_id=' . $ignoredUser['ignore_id'] ); + + /* Rebuild cache */ + IPSMember::rebuildIgnoredUsersCache( $this->memberData ); + } + + //----------------------------------------- + // Return + //----------------------------------------- + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=ignoredusers&do=show" ); + } + + /** + * Custom event: Remove ignored user + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function customEvent_removeIgnoredUser() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $removeID = intval( $this->request['id'] ); + + $this->DB->delete( 'ignored_users', 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $removeID ); + + /* Rebuild cache */ + IPSMember::rebuildIgnoredUsersCache( $this->memberData ); + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=ignoredusers&do=show" ); + } + /** * UserCP Form Show * @@ -655,14 +866,32 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte switch( $current_area ) { default: - case 'settings': - return $this->showFormSettings(); + case 'profileinfo': + return $this->formProfileInfo(); + break; + case 'signature': + return $this->formSignature(); + break; + case 'photo': + return $this->formPhoto(); + break; + case 'ignoredusers': + return $this->formIgnoredUsers(); + break; + case 'facebook': + return $this->formFacebook(); + break; + case 'twitter': + return $this->formTwitter(); + break; + case 'vkontakte': + return $this->formVkontakte(); + break; + case 'customize': + return $this->formCustomize(); break; case 'email': - return $this->showFormEmail(); - break; - case 'password': - return $this->showFormPassword(); + return $this->showFormEmailPassword(); break; case 'displayname': return $this->showFormDisplayname(); @@ -670,83 +899,562 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte case 'attachments': return $this->showFormAttachments(); break; - case 'notes': - return $this->showFormNotes(); - break; case 'notifications': return $this->showFormNotifications(); break; case 'notificationlog': return $this->showInlineNotifications(); break; - case 'likes': - return $this->showLikeList(); - break; } } /** - * Show the logged inline notifications + * Show the customization form * - * @author Brandon Farber - * @param string Error message + * @author Matt Mecham + * @param string Any inline message to show * @return string Processed HTML */ - public function showLikeList( $error='' ) + public function formCustomize( $inlineMsg='' ) { - /* Init */ - $start = intval( $this->request['st'] ); - $perPage = 50; - - //----------------------------------------- - // Turn off normal form - //----------------------------------------- + /* Allow uploads */ + $this->uploadFormMax = 10000 * 1024; - $this->hide_form_and_save_button = 1; - - //----------------------------------------- - // Get like helper class - //----------------------------------------- - - require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' ); - - //----------------------------------------- - // Get list of items user likes - //----------------------------------------- - - $_likes = array(); - - $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', - 'from' => 'core_like', - 'where' => 'like_member_id=' . $this->memberData['member_id'] ) ); - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_like', - 'where' => 'like_member_id=' . $this->memberData['member_id'], - 'limit' => array( $start, $perPage ), - 'order' => 'like_added DESC' ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - $_likes[ $r['like_id'] ] = $r; + if ( ! $this->memberData['gbw_allow_customization'] OR $this->memberData['bw_disable_customization'] ) + { + $this->registry->getClass('output')->showError( 'no_permission', 1005.5 ); } - /* Process */ - $_likes = classes_like_meta::get( $_likes ); + /* Grab current options */ + $options = unserialize( $this->memberData['pp_customization'] ); + $options = is_array( $options ) ? $options : array(); - $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count['er'], - 'itemsPerPage' => $perPage, - 'currentStartValue' => $start, - 'baseUrl' => "app=core&module=usercp&tab=core&area=likes" ) ); - + /* Build input */ + foreach( $options as $k => $v ) + { + $input[ $k ] = ( $this->request[ $k ] ) ? $this->request[ $k ] : $v; + } + + /* Figure out preview URL */ + if ( $options['type'] == 'url' AND $options['bg_url'] ) + { + $input['_preview'] = $options['bg_url']; + } + else if ( $options['type'] == 'upload' AND $options['bg_url'] ) + { + $input['_preview'] = $this->settings['upload_url'] . '/' . $options['bg_url']; + $input['bg_url'] = ''; + } + + /* Show form */ + return $this->registry->getClass('output')->getTemplate('ucp')->membersProfileCustomize( $options, $input, $inlineMsg ); + } + + /** + * Show the vkontakte form + * + * @author Matt Mecham + * @param string Any inline message to show + * @return string Processed HTML + */ + public function formVkontakte( $inlineMsg='' ) + { //----------------------------------------- - // Send to template + // INIT //----------------------------------------- - return $this->registry->getClass('output')->getTemplate('ucp')->likesList( $_likes, $error, $pages ); + if( !IPSLib::vkontakte_enabled() ) + { + $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.1 ); + } + + //----------------------------------------- + // Twitter user logged in? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); + $vkontakte = new $classToLoad( $this->registry, $this->memberData['vk_token'], $this->memberData['vk_uid'] ); + + //----------------------------------------- + // Thaw bitfield options + //----------------------------------------- + + $bwOptions = IPSBWOptions::thaw( $this->memberData['vk_bwoptions'], 'vkontakte' ); + + //----------------------------------------- + // Merge.. + //----------------------------------------- + + if ( is_array( $bwOptions ) ) + { + foreach( $bwOptions as $k => $v ) + { + $this->memberData[ $k ] = $v; + } + } + + $this->hide_form_and_save_button = 1; + + $userData = $vkontakte->fetchUserData(); + + if ( isset( $userData['status']['text'] ) ) + { + if ( IPS_DOC_CHAR_SET != 'UTF-8' ) + { + $userData['status']['text'] = IPSText::utf8ToEntities( $userData['status']['text'] ); + } + } + + return $this->registry->getClass('output')->getTemplate('vkontakte')->membersVkontakteConnect( $this->memberData['vk_uid'], $userData ); } + /** + * Show the twitter form + * + * @author Matt Mecham + * @param string Any inline message to show + * @return string Processed HTML + */ + public function formTwitter( $inlineMsg='' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if( !IPSLib::twitter_enabled() ) + { + $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.1 ); + } + + //----------------------------------------- + // Twitter user logged in? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $twitter = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); + + //----------------------------------------- + // Thaw bitfield options + //----------------------------------------- + + $bwOptions = IPSBWOptions::thaw( $this->memberData['tc_bwoptions'], 'twitter' ); + + //----------------------------------------- + // Merge.. + //----------------------------------------- + + if ( is_array( $bwOptions ) ) + { + foreach( $bwOptions as $k => $v ) + { + $this->memberData[ $k ] = $v; + } + } + + if( ! $twitter->isConnected() ) + { + $this->hide_form_and_save_button = 1; + } + + $userData = $twitter->fetchUserData(); + + if ( isset( $userData['status']['text'] ) ) + { + if ( IPS_DOC_CHAR_SET != 'UTF-8' ) + { + $userData['status']['text'] = IPSText::utf8ToEntities( $userData['status']['text'] ); + } + + /* Make safe */ + $userData['status']['text'] = str_replace( array( '<', '>' ), array( '<', '>' ), $userData['status']['text'] ); + } + + return $this->registry->getClass('output')->getTemplate('ucp')->membersTwitterConnect( $twitter->isConnected(), $userData ); + } + + + /** + * Show the member form + * + * @author Matt Mecham + * @param string Any inline message to show + * @return string Processed HTML + */ + public function formFacebook( $inlineMsg='' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if( !IPSLib::fbc_enabled() ) + { + $this->registry->getClass('output')->showError( 'fbc_disabled', 1005.2 ); + } + + //----------------------------------------- + // Shut off save button if not associated yet + //----------------------------------------- + + if( !$this->memberData['fb_uid'] ) + { + $this->hide_form_and_save_button = true; + $userData = array(); + $linkedMemberData = array(); + $perms = array(); + } + else + { + //----------------------------------------- + // FB user logged in? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + /* Now get the linked user */ + $linkedMemberData = IPSMember::load( intval($this->memberData['fb_uid']), 'all', 'fb_uid' ); + + $userData = $facebook->fetchUserData(); + + /* Email */ + $perms['email'] = $facebook->fetchHasAppPermission( 'email' ); + + /* Publish Stream */ + $perms['publish_stream'] = $facebook->fetchHasAppPermission( 'publish_stream' ); + + /* Read stream */ + $perms['read_stream'] = $facebook->fetchHasAppPermission( 'read_stream' ); + + /* Offline access */ + $perms['offline_access'] = $facebook->fetchHasAppPermission( 'offline_access' ); + + + //----------------------------------------- + // Thaw bitfield options + //----------------------------------------- + + $bwOptions = IPSBWOptions::thaw( $this->memberData['fb_bwoptions'], 'facebook' ); + + //----------------------------------------- + // Merge.. + //----------------------------------------- + + if ( is_array( $bwOptions ) ) + { + foreach( $bwOptions as $k => $v ) + { + $this->memberData[ $k ] = $v; + } + } + + //----------------------------------------- + // Able to update status? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' ); + $this->registry->setClass( 'memberStatus', new $classToLoad( $this->registry ) ); + + $this->registry->memberStatus->setAuthor( $this->memberData ); + $this->memberData['can_updated_status'] = $this->registry->memberStatus->canCreate(); + + $_updates = $facebook->fetchUserTimeline( $userData['id'], 0, true ); + + /* Got any? */ + if ( count( $_updates ) ) + { + $update = array_shift( $_updates ); + + if ( count( $update ) AND is_array( $update ) ) + { + $userData['status'] = $update; + } + } + + if ( is_array( $userData ) AND $userData['status']['message'] AND IPS_DOC_CHAR_SET != 'UTF-8' ) + { + $userData['status']['message'] = IPSText::utf8ToEntities( $userData['status']['message'] ); + } + + /* Make safe */ + $userData['status']['message'] = str_replace( array( '<', '>' ), array( '<', '>' ), $userData['status']['message'] ); + } + + return $this->registry->getClass('output')->getTemplate('ucp')->membersFacebookConnect( trim($this->memberData['fb_uid']), $userData, $linkedMemberData, $perms ); + } + + /** + * Show the ignored users + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function formIgnoredUsers() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $final_users = array(); + $temp_users = array(); + $uid = intval( $this->request['uid'] ); + $ignoredUsers = array(); + + //----------------------------------------- + // Do we have incoming? + //----------------------------------------- + + if ( $uid ) + { + $newmem = IPSMember::load( $uid ); + + $this->request['newbox_1'] = $newmem['members_display_name']; + } + + //----------------------------------------- + // Get ignored users + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'ignored_users', 'where' => 'ignore_owner_id=' . $this->memberData['member_id'] ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $ignoredUsers[ $row['ignore_ignore_id'] ] = $row; + } + + //----------------------------------------- + // Get members and check to see if they've + // since been moved into a group that cannot + // be ignored + //----------------------------------------- + + foreach( $ignoredUsers as $_id => $data ) + { + if ( intval($_id) ) + { + $temp_users[] = $_id; + } + } + + if ( count($temp_users) ) + { + $members = IPSMember::load( $temp_users, 'all' ); + + foreach( $members as $m ) + { + $m['g_title'] = IPSMember::makeNameFormatted( $this->caches['group_cache'][ $m['member_group_id'] ]['g_title'], $m['member_group_id'] ); + + $final_users[ $m['member_id'] ] = IPSMember::buildDisplayData( $m ); + $final_users[ $m['member_id'] ]['ignoreData'] = $ignoredUsers[ $m['member_id'] ]; + } + } + + $this->request['newbox_1'] = $this->request['newbox_1'] ? $this->request['newbox_1'] : ''; + + return $this->registry->getClass('output')->getTemplate('ucp')->membersIgnoredUsersForm( $final_users ); + } + + + /** + * Show the signature page + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function formSignature() + { + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + //----------------------------------------- + // Check to make sure that we can edit profiles.. + //----------------------------------------- + + $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); + + if ( ! $this->memberData['g_edit_profile'] OR ( $sig_restrictions[0] AND ! $this->memberData['g_sig_unit'] ) ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 1024, null, null, 403 ); + } + + /* Signature Limits */ + if ( $sig_restrictions[0] AND $this->memberData['g_sig_unit'] ) + { + if ( $this->memberData['gbw_sig_unit_type'] ) + { + /* days */ + if ( $this->memberData['joined'] > ( time() - ( 86400 * $this->memberData['g_sig_unit'] ) ) ) + { + $this->hide_form_and_save_button = 1; + $form['_noPerm'] = sprintf( $this->lang->words['sig_group_restrict_date'], $this->lang->getDate( $this->memberData['joined'] + ( 86400 * $this->memberData['g_sig_unit'] ), 'long' ) ); + } + } + else + { + /* Posts */ + if ( $this->memberData['posts'] < $this->memberData['g_sig_unit'] ) + { + $this->hide_form_and_save_button = 1; + $form['_noPerm'] = sprintf( $this->lang->words['sig_group_restrict_posts'], $this->memberData['g_sig_unit'] - $this->memberData['posts'] ); + } + } + + if( $form['_noPerm'] ) + { + return $this->registry->getClass('output')->getTemplate('ucp')->membersSignatureFormError( $form ); + } + } + + //----------------------------------------- + // Set max length + //----------------------------------------- + + $current_sig = ''; + $t_sig = ''; + + /* Set content in editor */ + $this->editor->setContent( $this->memberData['signature'] ); + + /* Current signature preview */ + IPSText::getTextClass('bbcode')->parse_bbcode = 1; + IPSText::getTextClass('bbcode')->parse_smilies = 0; + IPSText::getTextClass('bbcode')->parse_html = $this->caches['group_cache'][ $this->memberData['member_group_id'] ]['g_dohtml']; + IPSText::getTextClass('bbcode')->parse_nl2br = 1; + IPSText::getTextClass('bbcode')->parsing_section = 'signatures'; + IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id']; + IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others']; + + $signature = IPSText::getTextClass('bbcode')->preDisplayParse( $this->memberData['signature'] ); + + + return $this->registry->getClass('output')->getTemplate('ucp')->membersSignatureForm( $this->editor->show( 'Post', array( 'noSmilies' => true ) ), $sig_restrictions, $signature ); + } + + + /** + * Show the profile information + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function formProfileInfo() + { + /* Load Lang File */ + $this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' ); + + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + /* INIT */ + $required_output = ""; + $optional_output = ""; + + /* Permission Check */ + if( ! $this->memberData['g_edit_profile'] ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 1026, null, null, 403 ); + } + + /* Format the birthday drop boxes.. */ + $date = getdate(); + + $day = array(); + $mon = array(); + $year = array(); + $times = array(); + + /* Build the day options */ + $day[] = array( '0', '--' ); + for ( $i = 1 ; $i < 32 ; $i++ ) + { + $day[] = array( $i, $i ); + } + + /* Build the month options */ + $mon[] = array( '0', '--' ); + for( $i = 1 ; $i < 13 ; $i++ ) + { + $mon[] = array( $i, $this->lang->words['M_' . $i ] ); + } + + /* Build the years options */ + $i = $date['year'] - 1; + $j = $date['year'] - 100; + + $year[] = array( '0', '--' ); + for( $i ; $j < $i ; $i-- ) + { + $year[] = array( $i, $i ); + } + + /* Custom Fields */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + + $fields->member_data = $this->member->fetchMemberData(); + $fields->initData( 'edit' ); + $fields->parseToEdit(); + + $field_output = array(); + + if ( count( $fields->out_fields ) ) + { + foreach( $fields->out_fields as $id => $element ) + { + $data = $fields->cache_data[ $id ]; + $field_output[ $data['pf_group_key'] ][ $id ] = array( + 'field' => $this->registry->getClass('output')->getTemplate('ucp')->field_entry( $fields->field_names[ $id ], $fields->field_desc[ $id ], $fields->out_fields[ $id ], $id ), + 'required' => $data['pf_not_null'] + ); + } + + /*foreach( $fields->out_fields as $id => $data ) + { + if ( $fields->cache_data[ $id ]['pf_not_null'] == 1 ) + { + $ftype = 'required_output'; + } + else + { + $ftype = 'optional_output'; + } + + ${$ftype} .= $this->registry->getClass('output')->getTemplate('ucp')->field_entry( $fields->field_names[ $id ], $fields->field_desc[ $id ], $data, $id ); + }*/ + } + + /* About me */ + $aboutme = $this->DB->buildAndFetch( array( 'select' => 'pp_about_me', 'from' => 'profile_portal', 'where' => 'pp_member_id=' . $this->memberData['member_id'] ) ); + + /* Set content in editor */ + $this->editor->setContent( $aboutme['pp_about_me'] ); + + $amEditor = $this->editor->show( 'Post', array( 'noSmilies' => true, 'delayInit' => 1 ) ); + + /* Times */ + foreach ( $this->lang->words as $k => $v ) + { + if ( strpos( $k, "time_" ) === 0 ) + { + $k = str_replace( "time_", '', $k ); + + if( preg_match( '/^[\-\d\.]+$/', $k ) ) + { + $times[ $k ] = $v; + } + } + } + + ksort( $times ); + + /* Build and return the form */ + $template = $this->registry->getClass('output')->getTemplate('ucp')->membersProfileForm( $field_output, $fields->fetchGroupTitles(), $day, $mon, $year, $amEditor, $times ); + + return $template; + } + /** * Show the logged inline notifications * @@ -758,6 +1466,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte { /* Init */ $start = intval( $this->request['st'] ); + $clear = trim( $this->request['clear'] ); $perPage = 50; //----------------------------------------- @@ -766,7 +1475,8 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); $notifyLibrary = new $classToLoad( $this->registry ); - + $notifyLibrary->setMember( $this->memberData ); + //----------------------------------------- // Turn off normal form //----------------------------------------- @@ -778,6 +1488,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte //----------------------------------------- $_notifications = array(); + $mids = array(); $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', 'from' => 'inline_notifications', @@ -788,20 +1499,47 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte 'where' => 'notify_to_id=' . $this->memberData['member_id'], 'limit' => array( $start, $perPage ), 'order' => 'notify_sent DESC' ) ); - $this->DB->execute(); + $outer = $this->DB->execute(); - while( $r = $this->DB->fetch() ) + while( $r = $this->DB->fetch($outer) ) { $r['notify_icon'] = $notifyLibrary->getNotificationIcon( $r['notify_type_key'] ); $_notifications[] = $r; + + $mids[ $r['notify_from_id'] ] = $r['notify_from_id']; } - + + /* Get members */ + if ( count( $mids ) ) + { + $members = IPSMember::load( array_keys( $mids ), 'all' ); + + if ( count( $members ) ) + { + foreach( $_notifications as $key => $data ) + { + if ( in_array( $data['notify_from_id'], array_keys( $members ) ) ) + { + $_notifications[ $key ]['member'] = IPSMember::buildProfilePhoto( $members[ $data['notify_from_id'] ] ); + } + } + } + } + $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count['er'], 'itemsPerPage' => $perPage, 'currentStartValue' => $start, 'baseUrl' => "app=core&module=usercp&tab=core&area=notificationlog" ) ); + /* Clear them? - used in mobile skin */ + if ( $clear == 'true' ) + { + $this->DB->update( 'inline_notifications', array( 'notify_read' => 1 ), 'notify_to_id=' . $this->memberData['member_id'] ); + + $notifyLibrary->rebuildUnreadCount(); + } + //----------------------------------------- // Send to template //----------------------------------------- @@ -831,7 +1569,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'pm', $this->lang->words['notopt__pm'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile', $this->lang->words['notopt__mobile'] ) ); $_configOptions = $notifyLibrary->getNotificationData( TRUE ); - $_notifyConfig = $notifyLibrary->getMemberNotificationConfig(); + $_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData ); $_defaultConfig = $notifyLibrary->getDefaultNotificationConfig(); $_formOptions = array(); @@ -868,6 +1606,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $_formOptions[ $option['key'] ] = array(); $_formOptions[ $option['key'] ]['key'] = $option['key']; + $_formOptions[ $option['key'] ]['app'] = $option['app']; //----------------------------------------- // Rikki asked for this... @@ -905,19 +1644,9 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte // Email settings... //----------------------------------------- - foreach( array('email_full', 'auto_track') as $k ) - { - if ( $this->memberData[ $k ] ) - { - $_emailData[ $k ] = 'checked="checked"'; - } - else - { - $_emailData[ $k ] = ''; - } - } + $_emailData['auto_track'] = $this->memberData['auto_track'] ? 'checked="checked"' : ''; - foreach( array( 'none', 'immediate', 'delayed', 'daily', 'weekly' ) as $_opt ) + foreach( array( 'none', 'immediate', 'offline', 'daily', 'weekly' ) as $_opt ) { $_emailData['trackOption'][ $_opt ] = ( $this->memberData['auto_track'] == $_opt ) ? 'selected="selected"' : ''; } @@ -942,13 +1671,13 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $perpage = 15; $sort_key = ""; $attachments = array(); - + $this->hide_form_and_save_button = 1; - + //----------------------------------------- // Sort it //----------------------------------------- - + switch ( $this->request['sort'] ) { case 'date': @@ -993,10 +1722,11 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte // Limit by forums //----------------------------------------- - $stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', + $stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, ' . $this->DB->buildCoalesce( array( 'sum(attach_filesize)', 0 ) ) . ' as sum', 'from' => 'attachments', 'where' => 'attach_member_id=' . $this->memberData['member_id'] . " AND attach_rel_module IN( 'post', 'msg' )" ) ); + if ( $maxspace > 0 ) { //----------------------------------------- @@ -1016,12 +1746,12 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte } $info['attach_space_count'] = sprintf( $this->lang->words['attach_space_count'], intval($stats['count']), intval($info['full_percent']) ); - $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_used'] , IPSLib::sizeFormat(intval($stats['sum'])), IPSLib::sizeFormat($maxspace * 1024) ); + $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_used'] , IPSLib::sizeFormat($stats['sum']), IPSLib::sizeFormat($maxspace * 1024) ); } else { $info['has_limit'] = 0; - $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_unl'] , IPSLib::sizeFormat(intval($stats['sum'])) ); + $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_unl'] , IPSLib::sizeFormat($stats['sum']) ); } //----------------------------------------- @@ -1038,94 +1768,73 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte // Get attachments... //----------------------------------------- - $this->DB->build( array( 'select' => 'a.*', - 'from' => array( 'attachments' => 'a' ), - 'where' => "a.attach_member_id=" . $this->memberData['member_id'] . " AND a.attach_rel_module IN( 'post', 'msg' )", - 'order' => $sort_key, - 'limit' => array( $start, $perpage ), - 'add_join' => array( - array( 'select' => 'p.topic_id', - 'from' => array( 'posts' => 'p' ), - 'where' => 'p.pid=a.attach_rel_id', - 'type' => 'left' - ), - array( 'select' => 't.*', - 'from' => array( 'topics' => 't' ), - 'where' => 't.tid=p.topic_id', - 'type' => 'left' - ) ) ) ); - $outer = $this->DB->execute(); - - $this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic'), 'forums' ); - - $cache = $this->cache->getCache('attachtypes'); - - while ( $row = $this->DB->fetch( $outer ) ) + if( $stats['count'] ) { - if ( IPSMember::checkPermissions('read', $row['forum_id'] ) != TRUE ) + $this->DB->build( array( 'select' => 'a.*', + 'from' => array( 'attachments' => 'a' ), + 'where' => "a.attach_member_id=" . $this->memberData['member_id'] . " AND a.attach_rel_module IN( 'post', 'msg' )", + 'order' => $sort_key, + 'limit' => array( $start, $perpage ), + 'add_join' => array( + array( 'select' => 'p.topic_id', + 'from' => array( 'posts' => 'p' ), + 'where' => 'p.pid=a.attach_rel_id', + 'type' => 'left' + ), + array( 'select' => 't.*', + 'from' => array( 'topics' => 't' ), + 'where' => 't.tid=p.topic_id', + 'type' => 'left' + ) ) + ) ); + $outer = $this->DB->execute(); + + $this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' ); + + $cache = $this->cache->getCache('attachtypes'); + + while ( $row = $this->DB->fetch( $outer ) ) { - $row['title'] = $this->lang->words['attach_topicmoved']; + if ( IPSMember::checkPermissions('read', $row['forum_id'] ) != TRUE ) + { + $row['title'] = $this->lang->words['attach_topicmoved']; + } + + //----------------------------------------- + // Full attachment thingy + //----------------------------------------- + + if ( $row['attach_rel_module'] == 'post' ) + { + $row['_type'] = 'post'; + } + else if ( $row['attach_rel_module'] == 'msg' ) + { + $row['_type'] = 'msg'; + $row['title'] = $this->lang->words['attach_inpm']; + } + + /* IPB 2.x conversion */ + $row['image'] = str_replace( 'folder_mime_types', 'mime_types', $cache[ $row['attach_ext'] ]['atype_img'] ); + $row['short_name'] = IPSText::truncate( $row['attach_file'], 30 ); + $row['attach_date'] = $this->registry->getClass( 'class_localization')->getDate( $row['attach_date'], 'SHORT' ); + $row['real_size'] = IPSLib::sizeFormat( $row['attach_filesize'] ); + + $attachments[] = $row; } - - //----------------------------------------- - // Full attachment thingy - //----------------------------------------- - - if ( $row['attach_rel_module'] == 'post' ) - { - $row['_type'] = 'post'; - } - else if ( $row['attach_rel_module'] == 'msg' ) - { - $row['_type'] = 'msg'; - $row['title'] = $this->lang->words['attach_inpm']; - } - - /* IPB 2.x conversion */ - $row['image'] = str_replace( 'folder_mime_types', 'mime_types', $cache[ $row['attach_ext'] ]['atype_img'] ); - $row['short_name'] = IPSText::truncate( $row['attach_file'], 30 ); - $row['attach_date'] = $this->registry->getClass( 'class_localization')->getDate( $row['attach_date'], 'SHORT' ); - $row['real_size'] = IPSLib::sizeFormat( $row['attach_filesize'] ); - - $attachments[] = $row; } return $this->registry->getClass('output')->getTemplate('ucp')->coreAttachments( $info, $pages, $attachments ); } /** - * Show the Password form - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function showFormPassword() - { - //----------------------------------------- - // Do we have another URL for password resets? - //----------------------------------------- - - $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->han_login->checkMaintenanceRedirect(); - - if( $this->memberData['g_access_cp'] ) - { - $this->hide_form_and_save_button = true; - } - - return $this->registry->getClass('output')->getTemplate('ucp')->passwordChangeForm(); - } - - /** - * Show the Email form + * Show the Email & Password form * * @author Matt Mecham * @param string Returned error message (if any) * @return string Processed HTML */ - public function showFormEmail( $_message='' ) + public function showFormEmailPassword( $_message='' ) { //----------------------------------------- // Do not allow validating members to change @@ -1147,18 +1856,13 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $this->han_login->init(); $this->han_login->checkMaintenanceRedirect(); - $txt = $this->lang->words['ce_current'] . $this->memberData['email']; + //$txt = $this->lang->words['ce_current'] . $this->memberData['email']; if ( $this->settings['reg_auth_type']) { $txt .= $this->lang->words['ce_auth']; } - - if ( $this->settings['bot_antispam_type'] != 'none' ) - { - $captchaHTML = $this->registry->getClass('class_captcha')->getTemplate(); - } - + $_message = $_message ? $this->lang->words[$_message] : ''; if( $this->memberData['g_access_cp'] ) @@ -1166,7 +1870,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $this->hide_form_and_save_button = true; } - return $this->registry->getClass('output')->getTemplate('ucp')->emailChangeForm( $txt, $_message, $captchaHTML, $this->_isFBUser ); + return $this->registry->getClass('output')->getTemplate('ucp')->emailPasswordChangeForm( $txt, $_message, $this->_isFBUser ); } /** @@ -1271,52 +1975,6 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte return $this->registry->getClass('output')->getTemplate('ucp')->displayNameForm( $form, $error, '', $this->_isFBUser ); } - /** - * Show the Settings form - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function showFormSettings() - { - /* Sort the times */ - $times = array(); - - foreach( $this->lang->words as $k => $v ) - { - if( strpos( $k, "time_" ) === 0 ) - { - $k = str_replace( "time_", '', $k ); - - if( preg_match( '/^[\-\d\.]+$/', $k ) ) - { - $times[ $k ] = $v; - } - } - } - - ksort( $times ); - //uksort( $this->lang->words, create_function( '$a, $b', '$a = str_replace( "time_", "", $a ); $b = str_replace( "time_", "", $b ); return $a > $b;' ) ); - - /* Show the form */ - return $this->registry->getClass('output')->getTemplate('ucp')->generalSettingsForm( $times ); - } - - /** - * Show the Notes form - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function showFormNotes() - { - /* Show the form */ - $member = IPSMember::load( $this->memberData['member_id'], 'extendedProfile' ); - $content = $member['notes']; - - return $this->registry->getClass('output')->getTemplate('ucp')->coreNotesForm( $content ); - } - /** * UserCP Form Check * @@ -1333,11 +1991,29 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte switch( $current_area ) { default: - case 'settings': - return $this->saveFormSettings(); + case 'profileinfo': + return $this->saveProfileInfo(); + break; + case 'signature': + return $this->saveSignature(); + break; + case 'photo': + return $this->savePhoto(); + break; + case 'ignoredusers': + return $this->saveIgnoredUsers(); + break; + case 'facebook': + return $this->saveFacebook(); + break; + case 'twitter': + return $this->saveTwitter(); + break; + case 'customize': + return $this->saveCustomize(); break; case 'email': - return $this->saveFormEmail(); + return $this->saveFormEmailPassword(); break; case 'password': return $this->saveFormPassword(); @@ -1345,15 +2021,632 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte case 'displayname': return $this->saveFormDisplayname(); break; - case 'notes': - return $this->saveFormNotes(); - break; case 'notifications': return $this->saveFormNotifications(); break; } } + /** + * UserCP Save Form: Customize + * + * @return array Errors + */ + public function saveCustomize() + { + /* Init */ + $errors = array(); + $custom = array(); + $bg_nix = trim( $this->request['bg_nix'] ); + $bg_url = trim( $this->request['bg_url'] ); + $bg_tile = intval( $this->request['bg_tile'] ); + $bg_color = trim( str_replace( '#', '', $this->request['bg_color'] ) ); + + /* reset custom */ + $custom = unserialize( $this->memberData['pp_customization'] ); + + /* Bug #21578 */ + if( ! $bg_color && $custom['bg_color'] ) + { + $bg_color = $custom['bg_color']; + } + + /* Delete all? */ + if ( $bg_nix ) + { + /* reset array */ + $custom = array( 'bg_url' => '', 'type' => '', 'bg_color' => '', 'bg_tile' => '' ); + + /* remove bg images */ + IPSMember::getFunction()->removeUploadedBackgroundImages( $this->memberData['member_id'] ); + } + else + { + if ( $bg_url AND $this->memberData['gbw_allow_url_bgimage'] ) + { + /* Check */ + if ( ! stristr( $bg_url, 'http://' ) OR preg_match( '#\(\*#', $bg_url ) ) + { + return array( 0 => $this->lang->words['pp_bgimg_url_bad'] ); + } + + $image_extension = strtolower( pathinfo( $bg_url, PATHINFO_EXTENSION ) ); + + if( ! in_array( $image_extension, array( 'png', 'jpg', 'gif', 'jpeg' ) ) ) + { + return array( 0 => $this->lang->words['pp_bgimg_ext_bad'] ); + } + + $custom['bg_url'] = $bg_url; + $custom['type'] = 'url'; + } + else if ( $this->memberData['gbw_allow_upload_bgimage'] ) + { + /* Load more lang strings */ + $this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' ); + + /* Upload img */ + $img = IPSMember::getFunction()->uploadBackgroundImage(); + + if ( $img['status'] == 'fail' ) + { + return array( 0 => $this->lang->words[ 'pp_' . $img['error'] ] ); + } + else if ( $img['final_location'] ) + { + $custom['bg_url'] = $img['final_location']; + $custom['type'] = 'upload'; + } + } + } + + /* BG color */ + $custom['bg_color'] = $bg_nix ? '' : IPSText::alphanumericalClean( $bg_color ); + + /* Tile */ + $custom['bg_tile'] = $bg_nix ? '' : $bg_tile; + + /* Save it */ + if ( ! $this->memberData['bw_disable_customization'] AND $this->memberData['gbw_allow_customization'] ) + { + IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'pp_customization' => serialize( $custom ) ) ) ); + } + + return TRUE; + } + + /** + * UserCP Save Form: Twitter + * + * @return array Errors + */ + public function saveTwitter() + { + if( !IPSLib::twitter_enabled() ) + { + $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.2 ); + } + + //----------------------------------------- + // Data + //----------------------------------------- + + $toSave = IPSBWOptions::thaw( $this->memberData['tc_bwoptions'], 'twitter' ); + + //----------------------------------------- + // Loop and save... simple + //----------------------------------------- + + foreach( array( 'tc_s_pic', 'tc_s_status', 'tc_s_aboutme', 'tc_s_bgimg', 'tc_si_status' ) as $field ) + { + $toSave[ $field ] = intval( $this->request[ $field ] ); + } + + $this->memberData['tc_bwoptions'] = IPSBWOptions::freeze( $toSave, 'twitter' ); + $return = IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'tc_bwoptions' => $this->memberData['tc_bwoptions'] ) ) ); + + //----------------------------------------- + // Now sync + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $twitter = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); + + try + { + $twitter->syncMember( $this->memberData ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + case 'NOT_LINKED': + case 'NO_MEMBER': + break; + } + } + + return TRUE; + } + + /** + * UserCP Save Form: Facebook + * + * @return array Errors + */ + public function saveFacebook() + { + if( !IPSLib::fbc_enabled() ) + { + $this->registry->getClass('output')->showError( 'fbc_disabled', 1005 ); + } + + //----------------------------------------- + // Data + //----------------------------------------- + + $toSave = IPSBWOptions::thaw( $this->memberData['members_bitoptions'], 'members' ); + + //----------------------------------------- + // Loop and save... simple + //----------------------------------------- + + foreach( array( 'fbc_s_pic', 'fbc_s_status', 'fbc_s_aboutme', 'fbc_si_status' ) as $field ) + { + $toSave[ $field ] = intval( $this->request[ $field ] ); + } + + $this->memberData['fb_bwoptions'] = IPSBWOptions::freeze( $toSave, 'facebook' ); + IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'fb_bwoptions' => $this->memberData['fb_bwoptions'] ) ) ); + + //----------------------------------------- + // Now sync + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + try + { + $facebook->syncMember( $this->memberData ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + case 'NOT_LINKED': + case 'NO_MEMBER': + break; + } + } + + return TRUE; + } + + /** + * UserCP Save Form: Ignore Users + * + * @return array Errors + */ + public function saveIgnoredUsers() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $newName = $this->request['newbox_1']; + $dnvs = intval( $this->request['donot_view_sigs'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'view_sigs' => ( $dnvs ) ? 0 : 1 ) ) ); + + if ( trim( $newName ) && $_POST['newbox_1'] != $this->lang->words['ucp_members_name'] ) + { + //----------------------------------------- + // Load + //----------------------------------------- + + $member = IPSMember::load( $newName, 'core', 'displayname' ); + + if ( ! $member['member_id'] ) + { + return array( 0 => $this->lang->words['ignoreuser_nomem'] ); + } + + if ( $member['member_id'] == $this->memberData['member_id'] ) + { + return array( 0 => $this->lang->words['ignoreuser_cannot'] ); + } + + //----------------------------------------- + // Already ignoring? + //----------------------------------------- + + $ignoreMe = $this->DB->buildAndFetch( array( + 'select' => '*', + 'from' => 'ignored_users', + 'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id'] + ) ); + + if ( $ignoreMe['ignore_id'] ) + { + return array( 0 => $this->lang->words['ignoreuser_already'] ); + } + + //----------------------------------------- + // Can we ignore them? + //----------------------------------------- + + if ( $member['_canBeIgnored'] !== TRUE ) + { + return array( 0 => $this->lang->words['ignoreuser_cannot'] ); + } + + //----------------------------------------- + // Add it + //----------------------------------------- + + $this->DB->insert( 'ignored_users', array( + 'ignore_owner_id' => $this->memberData['member_id'], + 'ignore_ignore_id' => $member['member_id'], + 'ignore_messages' => !empty( $this->request['ignore_messages'] ) ? 1 : 0, + 'ignore_topics' => !empty( $this->request['ignore_topics'] ) ? 1 : 0, + 'ignore_signatures' => !empty( $this->request['ignore_signatures'] ) ? 1 : 0, + 'ignore_chats' => !empty( $this->request['ignore_chats'] ) ? 1 : 0, + ) + ); + + /* Rebuild cache */ + IPSMember::rebuildIgnoredUsersCache( $this->memberData ); + } + + return TRUE; + } + + + /** + * UserCP Save Form: Signature + * + * @return array Errors + */ + public function saveSignature() + { + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + //----------------------------------------- + // Check to make sure that we can edit profiles.. + //----------------------------------------- + + $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); + + if ( ! $this->memberData['g_edit_profile'] OR ( $sig_restrictions[0] AND ! $this->memberData['g_sig_unit'] ) ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 1028, null, null, 403 ); + } + + //----------------------------------------- + // Post process the editor + // Now we have safe HTML and bbcode + //----------------------------------------- + + $signature = $this->editor->process( $_POST['Post'] ); + + //----------------------------------------- + // Parse post + //----------------------------------------- + + IPSText::getTextClass( 'bbcode' )->parse_smilies = 0; + IPSText::getTextClass( 'bbcode' )->parse_html = $this->memberData['g_dohtml']; + IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; + IPSText::getTextClass( 'bbcode' )->parsing_section = 'signatures'; + + $signature = IPSText::getTextClass('bbcode')->preDbParse( $signature ); + $testSignature = IPSText::getTextClass('bbcode')->preDisplayParse( $signature ); + + if ( IPSText::getTextClass( 'bbcode' )->error ) + { + $this->lang->loadLanguageFile( array( 'public_post' ), 'forums' ); + + $this->registry->getClass('output')->showError( IPSText::getTextClass( 'bbcode' )->error, 10210 ); + } + + //----------------------------------------- + // Signature restrictions... + //----------------------------------------- + + $sig_errors = array(); + + //----------------------------------------- + // Max number of images... + //----------------------------------------- + + if( isset($sig_restrictions[1]) and $sig_restrictions[1] !== '' ) + { + if( mb_substr_count( mb_strtolower($signature), "[img]" ) > $sig_restrictions[1] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanyimages'], $sig_restrictions[1] ); + } + } + + //----------------------------------------- + // Max number of urls... + //----------------------------------------- + + if( isset($sig_restrictions[4]) and $sig_restrictions[4] !== '' ) + { + if( mb_substr_count( mb_strtolower($signature), "[url" ) > $sig_restrictions[4] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanyurls'], $sig_restrictions[4] ); + } + else + { + preg_match_all( '#(^|\s|>)((http|https|news|ftp)://\w+[^\s\[\]\<]+)#is', $signature, $matches ); + + if( count($matches[1]) > $sig_restrictions[4] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanyurls'], $sig_restrictions[4] ); + } + } + } + + //----------------------------------------- + // Max number of lines of text... + //----------------------------------------- + + if( isset($sig_restrictions[5]) and $sig_restrictions[5] !== '' ) + { + $this->settings['signature_line_length'] = $this->settings['signature_line_length'] > 0 ? $this->settings['signature_line_length'] : 200; + + $testSig = wordwrap( $signature, $this->settings['signature_line_length'], '
' ); + + if( substr_count( $testSig, "
" ) >= $sig_restrictions[5] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanylines'], $sig_restrictions[5] ); + } + } + + //----------------------------------------- + // Now the crappy part.. + //----------------------------------------- + + if( isset($sig_restrictions[2]) and $sig_restrictions[2] !== '' AND isset($sig_restrictions[3]) and $sig_restrictions[3] !== '' ) + { + preg_match_all( '/\[img\](.+?)\[\/img\]/i', $signature, $allImages ); + + if( count($allImages[1]) ) + { + foreach( $allImages[1] as $foundImage ) + { + $imageProperties = @getimagesize( $foundImage ); + + if( is_array($imageProperties) AND count($imageProperties) ) + { + if( $imageProperties[0] > $sig_restrictions[2] OR $imageProperties[1] > $sig_restrictions[3] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_imagetoobig'], $foundImage, $sig_restrictions[2], $sig_restrictions[3] ); + } + } + } + } + } + + if( count($sig_errors) ) + { + $this->registry->getClass('output')->showError( implode( '
', $sig_errors ), 10211 ); + } + + //----------------------------------------- + // Write it to the DB. + //----------------------------------------- + + IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'signature' => $signature ) ) ); + + /* Update cache */ + IPSContentCache::update( $this->memberData['member_id'], 'sig', $testSignature ); + + return TRUE; + } + + + /** + * UserCP Save Form: Profile Info + * + * @return array Errors + */ + public function saveProfileInfo() + { + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + //----------------------------------------- + // INIT + //----------------------------------------- + + $pp_setting_moderate_comments = intval( $this->request['pp_setting_moderate_comments'] ); + $pp_setting_moderate_friends = intval( $this->request['pp_setting_moderate_friends'] ); + $pp_setting_count_visitors = intval( $this->request['pp_setting_count_visitors'] ); + $pp_setting_count_comments = intval( $this->request['pp_setting_count_comments'] ); + $pp_setting_count_friends = intval( $this->request['pp_setting_count_friends'] ); + + //----------------------------------------- + // Check to make sure that we can edit profiles.. + //----------------------------------------- + + if ( ! $this->memberData['g_edit_profile'] ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 10214, null, null, 403 ); + } + + //----------------------------------------- + // make sure that either we entered + // all calendar fields, or we left them + // all blank + //----------------------------------------- + + $c_cnt = 0; + + foreach ( array('day','month','year') as $v ) + { + if ( $this->request[ $v ] ) + { + $c_cnt++; + } + } + + if( $c_cnt > 0 && $c_cnt < 2 ) + { + $this->registry->getClass('output')->showError( 'member_bad_birthday', 10215 ); + } + else if( $c_cnt > 0 ) + { + //----------------------------------------- + // Make sure it's a legal date + //----------------------------------------- + + $_year = $this->request['year'] ? $this->request['year'] : 1999; + + if ( ! checkdate( $this->request['month'], $this->request['day'], $_year ) ) + { + $this->registry->getClass('output')->showError( 'member_bad_birthday', 10216 ); + } + } + + //----------------------------------------- + // Start off our array + //----------------------------------------- + + $core = array( 'bday_day' => $this->request['day'], + 'bday_month' => $this->request['month'], + 'bday_year' => $this->request['year'], + ); + + $extendedProfile = array( 'pp_setting_moderate_comments' => $pp_setting_moderate_comments, + 'pp_setting_moderate_friends' => $pp_setting_moderate_friends, + 'pp_setting_count_visitors' => $pp_setting_count_visitors, + 'pp_setting_count_comments' => $pp_setting_count_comments, + 'pp_setting_count_friends' => $pp_setting_count_friends ); + + //----------------------------------------- + // check to see if we can enter a member title + // and if one is entered, update it. + //----------------------------------------- + + if( isset( $this->request['member_title'] ) and ( $this->settings['post_titlechange'] ) and ( $this->memberData['posts'] >= $this->settings['post_titlechange']) ) + { + $core['title'] = IPSText::getTextClass('bbcode')->stripBadWords( $this->request['member_title'] ); + } + + //----------------------------------------- + // Custom profile field stuff + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + + $fields->member_data = $this->member->fetchMemberData(); + $fields->initData( 'edit' ); + /* Use $_POST and not ipsRegistry::$request as the custom profile field kernel class has its own cleaning routines for saving and showing + which means we end up with double & -> & conversion (&lt;, etc) */ + $fields->parseToSave( $_POST ); + + if( $fields->error_messages ) + { + return $fields->error_messages; + } + + /* Check the website url field */ + $website_field = $fields->getFieldIDByKey( 'website' ); + + if( $website_field && $fields->out_fields[ 'field_' . $website_field ] ) + { + if( ! stristr( $fields->out_fields[ 'field_' . $website_field ], 'http://' ) ) + { + $fields->out_fields[ 'field_' . $website_field ] = 'http://' . $fields->out_fields[ 'field_' . $website_field ]; + } + } + + //----------------------------------------- + // Check... + //----------------------------------------- + + if ( count( $fields->error_fields['empty'] ) ) + { + $this->registry->getClass('output')->showError( array( 'customfields_empty', $fields->error_fields['empty'][0]['pf_title'] ), 10217 ); + } + + if ( count( $fields->error_fields['invalid'] ) ) + { + $this->registry->getClass('output')->showError( array( 'customfields_invalid', $fields->error_fields['invalid'][0]['pf_title'] ), 10218 ); + } + + if ( count( $fields->error_fields['toobig'] ) ) + { + $this->registry->getClass('output')->showError( array( 'customfields_toobig', $fields->error_fields['toobig'][0]['pf_title'] ), 10219 ); + } + + /* About me */ + $extendedProfile['pp_about_me'] = $this->editor->process( $_POST['Post'] ); + + /* Open ID & times*/ + $timeZone = IPSText::alphanumericalClean( $this->request['timeZone'], '+.' ); + $dst_correct = intval( $this->request['dst_correct'] ); + + /* Ensure 1 account per openID */ + if ( $this->request['identity_url'] ) + { + $account = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'where' => "identity_url='" . trim($this->request['identity_url']) . "' AND member_id<>" . $this->memberData['member_id'] ) ); + + if( $account['member_id'] ) + { + return array( 0 => $this->lang->words['identity_url_assoc'] ); + } + + $identityUrl = trim($this->request['identity_url']); + $identityUrl = rtrim( $identityUrl, "/" ); + + if( !strpos( $identityUrl, 'http://' ) === 0 AND !strpos( $identityUrl, 'https://' ) === 0 ) + { + $identityUrl = 'http://' . $identityUrl; + } + } + + /* Add into array */ + $core['time_offset'] = $timeZone; + $core['dst_in_use'] = $this->settings['time_dst_auto_correction'] ? ( ( $this->request['dstOption'] AND intval($this->request['dstCheck']) == 0 ) ? intval($this->request['dstOption']) : 0 ) : $this->memberData['dst_in_use']; + $core['members_auto_dst'] = $this->settings['time_dst_auto_correction'] ? intval($this->request['dstCheck']) : $this->memberData['members_auto_dst']; + $core['identity_url'] = isset($identityUrl) ? $identityUrl : $this->memberData['identity_url']; + + //----------------------------------------- + // Update the DB + //----------------------------------------- + + IPSMember::save( $this->memberData['member_id'], array( 'core' => $core, + 'customFields' => $fields->out_fields, + 'extendedProfile' => $extendedProfile ) ); + + //----------------------------------------- + // Update birthdays cache if user set to today + // or if birthday was today but isn't now + //----------------------------------------- + + if( $core['bday_month'] == date('m') AND $core['bday_day'] == date('d') ) + { + $this->cache->rebuildCache( 'birthdays', 'calendar' ); + } + else if( $this->memberData['bday_month'] == date('m') AND $this->memberData['bday_day'] == date('d') AND ( $core['bday_month'] != date('m') OR $core['bday_day'] != date('d') ) ) + { + $this->cache->rebuildCache( 'birthdays', 'calendar' ); + } + + return TRUE; + } + /** * UserCP Save Form: Notifications config * @@ -1375,7 +2668,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'pm', $this->lang->words['notopt__pm'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile' => $this->lang->words['notopt__mobile'] ) ); $_configOptions = $notifyLibrary->getNotificationData(); - $_notifyConfig = $notifyLibrary->getMemberNotificationConfig(); + $_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData ); $_defaultConfig = $notifyLibrary->getDefaultNotificationConfig(); $_noPrivateMessage = array( 'new_private_message', 'reply_private_message' ); $_saveConfig = array(); @@ -1466,7 +2759,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte if ( $this->request['auto_track'] ) { - if ( in_array( $this->request['trackchoice'], array( 'none', 'immediate', 'delayed', 'daily', 'weekly' ) ) ) + if ( in_array( $this->request['trackchoice'], array( 'none', 'immediate', 'offline', 'daily', 'weekly' ) ) ) { $_trackChoice = $this->request['trackchoice']; } @@ -1476,33 +2769,13 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte // Profile preferences //----------------------------------------- - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'hide_email' => intval( $this->request['hide_email'] ), + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'allow_admin_mails' => intval( $this->request['admin_send'] ), - 'members_disable_pm' => intval( $this->request['disableMessenger'] ), - 'email_full' => intval( $this->request['send_full_msg'] ), 'auto_track' => $_trackChoice ) ) ); return TRUE; } - - /** - * UserCP Save Form: Notes - * - * @return boolean Successful - */ - public function saveFormNotes() - { - //----------------------------------------- - // Write it to the DB. - //----------------------------------------- - - IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'notes' => htmlspecialchars($_POST['Post']) ) ) ); - - $this->ok_message = $this->lang->words['notes_saved_msg']; - return TRUE; - } - /** * UserCP Save Form: Password * @@ -1561,11 +2834,6 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte $this->han_login = new $classToLoad( $this->registry ); $this->han_login->init(); } - - /*if ( IPSText::mbstrlen( $new_pass ) > 32) - { - return array( 0 => $this->lang->words['new_pw_too_long'] ); - }*/ //----------------------------------------- // Create new password... @@ -1693,327 +2961,312 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte * * @return mixed Array of errors / boolean true */ - public function saveFormEmail() + public function saveFormEmailPassword() { - //----------------------------------------- - // Do not allow validating members to change - // email when admin validation is on - // @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/ - //----------------------------------------- - - if( $this->memberData['member_group_id'] == $this->settings['auth_group'] AND in_array( $this->settings['reg_auth_type'], array( 'admin', 'admin_user' ) ) ) - { - $this->registry->output->showError( $this->lang->words['admin_val_no_email_chg'], 10190 ); - } - //----------------------------------------- // INIT //----------------------------------------- - $_emailOne = mb_strtolower( trim($this->request['in_email_1']) ); - $_emailTwo = mb_strtolower( trim($this->request['in_email_2']) ); - $captchaInput = trim(ipsRegistry::$request['captchaInput']); - $captchaUniqueID = trim(ipsRegistry::$request['captchaUniqueID']); - - //----------------------------------------- - // Check input - //----------------------------------------- - - if( $this->memberData['g_access_cp'] ) + $_emailOne = strtolower( trim($this->request['in_email_1']) ); + $_emailTwo = strtolower( trim($this->request['in_email_2']) ); + $cur_pass = trim($this->request['current_pass']); + $new_pass = trim($this->request['new_pass_1']); + $chk_pass = trim($this->request['new_pass_2']); + $isRemote = ( ! $this->memberData['bw_local_password_set'] AND $this->memberData['members_created_remote'] ) ? true : false; + + if ( $_emailOne or $_emailTwo ) { - return array( 0 => $this->lang->words['admin_emailpassword'] ); - } - - if ( ! $_POST['in_email_1'] OR ! $_POST['in_email_2'] ) - { - return array( 0 => $this->lang->words['complete_entire_form'] ); - } - - //----------------------------------------- - // Check password... - //----------------------------------------- - - if ( ! $this->_isFBUser ) - { - if ( $this->_checkPassword( $this->request['password'] ) === FALSE ) + //----------------------------------------- + // Do not allow validating members to change + // email when admin validation is on + // @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/ + //----------------------------------------- + + if( $this->memberData['member_group_id'] == $this->settings['auth_group'] AND in_array( $this->settings['reg_auth_type'], array( 'admin', 'admin_user' ) ) ) { - return array( 0 => $this->lang->words['current_pw_bad'] ); + $this->registry->output->showError( $this->lang->words['admin_val_no_email_chg'], 10190 ); } - } - - //----------------------------------------- - // Test email addresses - //----------------------------------------- - - if ( $_emailOne != $_emailTwo ) - { - return array( 0 => $this->lang->words['emails_no_matchy'] ); - } - - if ( IPSText::checkEmailAddress( $_emailOne ) !== TRUE ) - { - return array( 0 => $this->lang->words['email_not_valid'] ); - } - - //----------------------------------------- - // Is this email addy taken? - //----------------------------------------- - - if ( IPSMember::checkByEmail( $_emailOne ) == TRUE ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - - //----------------------------------------- - // Load ban filters - //----------------------------------------- - $banfilters = array(); - $this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $banfilters[ $r['ban_type'] ][] = $r['ban_content']; - } - - //----------------------------------------- - // Check in banned list - //----------------------------------------- - - if ( isset($banfilters['email']) AND is_array( $banfilters['email'] ) and count( $banfilters['email'] ) ) - { - foreach ( $banfilters['email'] as $email ) + + //----------------------------------------- + // Check input + //----------------------------------------- + + if( $this->memberData['g_access_cp'] ) { - $email = str_replace( '\*', '.*' , preg_quote($email, "/") ); - - if ( preg_match( "/^{$email}$/i", $_emailOne ) ) + return array( 0 => $this->lang->words['admin_emailpassword'] ); + } + + if ( ! $_POST['in_email_1'] OR ! $_POST['in_email_2'] ) + { + return array( 0 => $this->lang->words['complete_entire_form'] ); + } + + //----------------------------------------- + // Check password... + //----------------------------------------- + + if ( ! $this->_isFBUser ) + { + if ( $this->_checkPassword( $this->request['password'] ) === FALSE ) { - return array( 0 => $this->lang->words['email_is_taken'] ); + return array( 0 => $this->lang->words['current_pw_bad'] ); } } - } - - //----------------------------------------- - // Anti bot flood... - //----------------------------------------- - - if ( $this->settings['bot_antispam_type'] != 'none' ) - { - if ( $this->registry->getClass('class_captcha')->validate() !== TRUE ) + + //----------------------------------------- + // Test email addresses + //----------------------------------------- + + if ( $_emailOne != $_emailTwo ) { - return array( 0 => $this->lang->words['captcha_email_invalid'] ); + return array( 0 => $this->lang->words['emails_no_matchy'] ); } - } - - //----------------------------------------- - // 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(); - - if ( $this->han_login->emailExistsCheck( $_emailOne ) !== FALSE ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - - $this->han_login->changeEmail( $this->memberData['email'], $_emailOne, $this->memberData ); - - if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - - //----------------------------------------- - // Require new validation? NON ADMINS ONLY - //----------------------------------------- - - if ( $this->settings['reg_auth_type'] AND !$this->memberData['g_access_cp'] ) - { - //----------------------------------------- - // Remove any existing entries - //----------------------------------------- - - $_previous = $this->DB->buildAndFetch( array( 'select' => 'prev_email, real_group', 'from' => 'validating', 'where' => "member_id={$this->memberData['member_id']} AND email_chg=1" ) ); - - if( $_previous['prev_email'] ) + + if ( IPSText::checkEmailAddress( $_emailOne ) !== TRUE ) { - $this->DB->delete( 'validating', "member_id={$this->memberData['member_id']} AND email_chg=1" ); + return array( 0 => $this->lang->words['email_not_valid'] ); + } + + //----------------------------------------- + // Is this email addy taken? + //----------------------------------------- + + if ( IPSMember::checkByEmail( $_emailOne ) == TRUE ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + + //----------------------------------------- + // Load ban filters + //----------------------------------------- + $banfilters = array(); + $this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $banfilters[ $r['ban_type'] ][] = $r['ban_content']; + } + + //----------------------------------------- + // Check in banned list + //----------------------------------------- + + if ( isset($banfilters['email']) AND is_array( $banfilters['email'] ) and count( $banfilters['email'] ) ) + { + foreach ( $banfilters['email'] as $email ) + { + $email = str_replace( '\*', '.*' , preg_quote($email, "/") ); + + if ( preg_match( "/^{$email}$/i", $_emailOne ) ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + } + } + + //----------------------------------------- + // 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(); + + if ( $this->han_login->emailExistsCheck( $_emailOne ) !== FALSE ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + + $this->han_login->changeEmail( $this->memberData['email'], $_emailOne, $this->memberData ); + + if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + + //----------------------------------------- + // Want a new validation? NON ADMINS ONLY + //----------------------------------------- + + if ( $this->settings['reg_auth_type'] AND !$this->memberData['g_access_cp'] ) + { + //----------------------------------------- + // Remove any existing entries + //----------------------------------------- - $this->memberData['email'] = $_previous['prev_email']; - $this->memberData['member_group_id'] = $_previous['real_group']; + $_previous = $this->DB->buildAndFetch( array( 'select' => 'prev_email, real_group', 'from' => 'validating', 'where' => "member_id={$this->memberData['member_id']} AND email_chg=1" ) ); + + if( $_previous['prev_email'] ) + { + $this->DB->delete( 'validating', "member_id={$this->memberData['member_id']} AND email_chg=1" ); + + $this->memberData['email'] = $_previous['prev_email']; + $this->memberData['member_group_id'] = $_previous['real_group']; + } + + $validate_key = md5( IPSMember::makePassword() . time() ); + + //----------------------------------------- + // Update the new email, but enter a validation key + // and put the member in "awaiting authorisation" + // and send an email.. + //----------------------------------------- + + $db_str = array( + 'vid' => $validate_key, + 'member_id' => $this->memberData['member_id'], + 'temp_group' => $this->settings['auth_group'], + 'entry_date' => time(), + 'coppa_user' => 0, + 'email_chg' => 1, + 'ip_address' => $this->member->ip_address, + 'prev_email' => $this->memberData['email'], + ); + + if ( $this->memberData['member_group_id'] != $this->settings['auth_group'] ) + { + $db_str['real_group'] = $this->memberData['member_group_id']; + } + + $this->DB->insert( 'validating', $db_str ); + + IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $_emailOne ), $this->memberData['email'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_group_id' => $this->settings['auth_group'], + 'email' => $_emailOne ) ) ); + + //----------------------------------------- + // Update their session with the new member group + //----------------------------------------- + + if ( $this->member->session_id ) + { + $this->member->sessionClass()->convertMemberToGuest(); + } + + //----------------------------------------- + // Kill the cookies to stop auto log in + //----------------------------------------- + + IPSCookie::set( 'pass_hash' , '-1', 0 ); + IPSCookie::set( 'member_id' , '-1', 0 ); + IPSCookie::set( 'session_id' , '-1', 0 ); + + //----------------------------------------- + // Dispatch the mail, and return to the activate form. + //----------------------------------------- + + IPSText::getTextClass( 'email' )->getTemplate("newemail"); + + IPSText::getTextClass( 'email' )->buildMessage( array( + 'NAME' => $this->memberData['members_display_name'], + 'THE_LINK' => $this->settings['base_url']."app=core&module=global§ion=register&do=auto_validate&type=newemail&uid=".$this->memberData['member_id']."&aid=".$validate_key, + 'ID' => $this->memberData['member_id'], + 'MAN_LINK' => $this->settings['base_url']."app=core&module=global§ion=register&do=07", + 'CODE' => $validate_key, + ) ); + + IPSText::getTextClass( 'email' )->subject = $this->lang->words['lp_subject'].' '.$this->settings['board_name']; + IPSText::getTextClass( 'email' )->to = $_emailOne; + + IPSText::getTextClass( 'email' )->sendMail(); + + $this->registry->getClass('output')->redirectScreen( $this->lang->words['ce_redirect'], $this->settings['base_url'] . 'app=core&module=global&section=register&do=07' ); } + else + { + //----------------------------------------- + // No authorisation needed, change email addy and return + //----------------------------------------- + + IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $_emailOne ), $this->memberData['email'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'email' => $_emailOne ) ) ); + + //----------------------------------------- + // Add to OK message + //----------------------------------------- + + $this->ok_message = $this->lang->words['ok_email_changed']; + } + } + else if ( $cur_pass OR $new_pass ) + { + if( $this->memberData['g_access_cp'] ) + { + return array( 0 => $this->lang->words['admin_emailpassword'] ); + } + + if ( $isRemote === false AND ( ! $_POST['current_pass'] OR ( empty($new_pass) ) or ( empty($chk_pass) ) ) ) + { + return array( 0 => $this->lang->words['complete_entire_form'] ); + } + + //----------------------------------------- + // Do the passwords actually match? + //----------------------------------------- + + if ( $new_pass != $chk_pass ) + { + return array( 0 => $this->lang->words['passwords_not_matchy'] ); + } + + //----------------------------------------- + // Check password... + //----------------------------------------- - $validate_key = md5( IPSLib::makePassword() . time() ); - - //----------------------------------------- - // Update the new email, but enter a validation key - // and put the member in "awaiting authorisation" - // and send an email.. - //----------------------------------------- - - $db_str = array( - 'vid' => $validate_key, - 'member_id' => $this->memberData['member_id'], - 'temp_group' => $this->settings['auth_group'], - 'entry_date' => time(), - 'coppa_user' => 0, - 'email_chg' => 1, - 'ip_address' => $this->member->ip_address, - 'prev_email' => $this->memberData['email'], - ); - - if ( $this->memberData['member_group_id'] != $this->settings['auth_group'] ) + if ( $isRemote === false ) { - $db_str['real_group'] = $this->memberData['member_group_id']; + if ( $this->_checkPassword( $cur_pass ) !== TRUE ) + { + return array( 0 => $this->lang->words['current_pw_bad'] ); + } } - - $this->DB->insert( 'validating', $db_str ); - - IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], mb_strtolower( $_emailOne ), $this->memberData['email'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_group_id' => $this->settings['auth_group'], - 'email' => $_emailOne ) ) ); - - //----------------------------------------- - // Update their session with the new member group - //----------------------------------------- - - if ( $this->member->session_id ) + else { - $this->member->sessionClass()->convertMemberToGuest(); - } - - //----------------------------------------- - // Kill the cookies to stop auto log in - //----------------------------------------- - - IPSCookie::set( 'pass_hash' , '-1', 0 ); - IPSCookie::set( 'member_id' , '-1', 0 ); - IPSCookie::set( 'session_id' , '-1', 0 ); - - //----------------------------------------- - // Dispatch the mail, and return to the activate form. - //----------------------------------------- - - IPSText::getTextClass( 'email' )->getTemplate("newemail"); - - IPSText::getTextClass( 'email' )->buildMessage( array( - 'NAME' => $this->memberData['members_display_name'], - 'THE_LINK' => $this->settings['base_url']."app=core&module=global§ion=register&do=auto_validate&type=newemail&uid=".$this->memberData['member_id']."&aid=".$validate_key, - 'ID' => $this->memberData['member_id'], - 'MAN_LINK' => $this->settings['base_url']."app=core&module=global§ion=register&do=07", - 'CODE' => $validate_key, - ) ); - - IPSText::getTextClass( 'email' )->subject = $this->lang->words['lp_subject'].' '.$this->settings['board_name']; - IPSText::getTextClass( 'email' )->to = $_emailOne; - - IPSText::getTextClass( 'email' )->sendMail(); - - $this->registry->getClass('output')->redirectScreen( $this->lang->words['ce_redirect'], $this->settings['base_url'] . 'app=core&module=global&section=register&do=07' ); + /* This is INIT in _checkPassword */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + } + + //----------------------------------------- + // Create new password... + //----------------------------------------- + + $md5_pass = md5($new_pass); + + //----------------------------------------- + // han_login was loaded during check_password + //----------------------------------------- + + $this->han_login->changePass( $this->memberData['email'], $md5_pass, $new_pass, $this->memberData ); + + if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + { + return array( 0 => $this->lang->words['hanlogin_pw_failed'] ); + } + + //----------------------------------------- + // Update the DB + //----------------------------------------- + + IPSMember::updatePassword( $this->memberData['email'], $md5_pass ); + + IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $new_pass ); + + //----------------------------------------- + // Update members log in key... + //----------------------------------------- + + $key = IPSMember::generateAutoLoginKey(); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_login_key' => $key, 'bw_local_password_set' => 1 ) ) ); + + $this->ok_message = $this->lang->words['pw_change_successful']; } - else - { - //----------------------------------------- - // No authorisation needed, change email addy and return - //----------------------------------------- - - IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], mb_strtolower( $_emailOne ), $this->memberData['email'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'email' => $_emailOne ) ) ); - - //----------------------------------------- - // Add to OK message - //----------------------------------------- - - $this->ok_message = $this->lang->words['ok_email_changed']; - - return TRUE; - } - } - - /** - * UserCP Save Form: Settings - * - * @param array Array of member / core_sys_login information (if we're editing) - * @return mixed Array of errors / boolean true - */ - public function saveFormSettings( $member=array() ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $timeZone = IPSText::alphanumericalClean( $this->request['timeZone'], '+.' ); - $dst_correct = intval( $this->request['dst_correct'] ); - - //----------------------------------------- - // RTE - //----------------------------------------- - - if ( ! $this->settings['posting_allow_rte'] ) - { - $this->request['editorChoice'] = 0; - } - - //----------------------------------------- - // PM Settings: 2 means admin says no. - //----------------------------------------- - - if ( $this->memberData['members_disable_pm' ] == 2 ) - { - $this->member->setProperty( 'members_disable_pm', 2 ); - } - else - { - $this->member->setProperty( 'members_disable_pm', intval( $this->request[ 'disableMessenger' ] ) ); - } - - //----------------------------------------- - // Only one account per identity url - //----------------------------------------- - - if( $this->request['identity_url'] ) - { - $account = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'where' => "identity_url='" . trim($this->request['identity_url']) . "' AND member_id<>" . $this->memberData['member_id'] ) ); - - if( $account['member_id'] ) - { - return array( 0 => $this->lang->words['identity_url_assoc'] ); - } - - //----------------------------------------- - // Need to clean up identity URL a little - //----------------------------------------- - - $identityUrl = trim($this->request['identity_url']); - $identityUrl = rtrim( $identityUrl, "/" ); - - if( !strpos( $identityUrl, 'http://' ) === 0 AND !strpos( $identityUrl, 'https://' ) === 0 ) - { - $identityUrl = 'http://' . $identityUrl; - } - } - - /* Figure out BW options */ - $toSave = IPSBWOptions::thaw( $this->memberData['members_bitoptions'], 'members' ); - - foreach( array( 'bw_vnc_type', 'bw_forum_result_type' ) as $field ) - { - $toSave[ $field ] = intval( $this->request[ $field ] ); - } - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( - 'time_offset' => $timeZone, - 'dst_in_use' => $this->settings['time_dst_auto_correction'] ? ( ( $this->request['dstOption'] AND intval($this->request['dstCheck']) == 0 ) ? intval($this->request['dstOption']) : 0 ) : $this->memberData['dst_in_use'], - 'members_auto_dst' => $this->settings['time_dst_auto_correction'] ? intval($this->request['dstCheck']) : $this->memberData['members_auto_dst'], - 'members_editor_choice' => $this->request['editorChoice'] ? 'rte' : 'std', - 'member_uploader' => $this->request['member_uploader'] ? 'flash' : 'default', - 'identity_url' => isset($identityUrl) ? $identityUrl : $this->memberData['identity_url'], - 'members_bitoptions' => IPSBWOptions::freeze( $toSave, 'members' ) ) ) ); - + return TRUE; } @@ -2023,7 +3276,7 @@ class usercpForms_core extends public_core_usercp_manualResolver implements inte * @param string Plain Text Password * @return boolean Password matched or not */ - private function _checkPassword( $password_check ) + protected function _checkPassword( $password_check ) { //----------------------------------------- // Ok, check password first diff --git a/upload/admin/applications/core/index.html b/upload/admin/applications/core/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/index.html +++ b/upload/admin/applications/core/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/js/IPB3TemplateDiffResults.js b/upload/admin/applications/core/js/IPB3TemplateDiffResults.js index 7cdff5f7..b6d1d487 100644 --- a/upload/admin/applications/core/js/IPB3TemplateDiffResults.js +++ b/upload/admin/applications/core/js/IPB3TemplateDiffResults.js @@ -238,13 +238,13 @@ function IPB3TemplateDiffResults() { default: case 'orig': - _text = 'Старый'; + _text = ipb.lang['comparediff_oldd']; break; case 'new': - _text = 'Новый'; + _text = ipb.lang['comparediff_newd']; break; case 'custom': - _text = 'Пользовательский'; + _text = ipb.lang['comparediff_cust']; break; } @@ -253,11 +253,11 @@ function IPB3TemplateDiffResults() { if ( json['data_type'] == 'css' ) { - content = '

' + _text + ': ' + json['data_title'] + '.css

' + json['data_content'] + '
'; + content = '

' + _text + ': ' + json['data_title'] + '.css

' + json['data_content'] + '
'; } else { - content = '

' + _text + ': ' + json['data_group'] + ' > ' + json['data_title'] + '

' + json['data_content'] + '
'; + content = '

' + _text + ': ' + json['data_group'] + ' > ' + json['data_title'] + '

' + json['data_content'] + '
'; } max = document.viewport.getHeight(); @@ -313,10 +313,10 @@ function IPB3TemplateDiffResults() { default: case 'diff': - _text = 'Различия'; + _text = ipb.lang['comparediff_diff']; break; case 'merge': - _text = 'Препросмотр объединения'; + _text = ipb.lang['comparediff_merg']; break; } @@ -326,7 +326,7 @@ function IPB3TemplateDiffResults() /* Extra work for merge */ if ( type == 'merge' ) { - _qb = "
 
"; + _qb = "
 
"; } else { @@ -335,11 +335,11 @@ function IPB3TemplateDiffResults() if ( json['change_data_type'] == 'css' ) { - content = '

'+ _text + ': ' + json['change_data_title'] + '.css

' + json['change_data_content'] + '
' + _qb; + content = '

'+ _text + ': ' + json['change_data_title'] + '.css

' + json['change_data_content'] + '
' + _qb + "
"; } else { - content = '

'+ _text + ': ' + json['change_data_group'] + ' > ' + json['change_data_title'] + '

' + json['change_data_content'] + '
' + _qb; + content = '

'+ _text + ': ' + json['change_data_group'] + ' > ' + json['change_data_title'] + '

' + json['change_data_content'] + '
' + _qb + "
"; } max = document.viewport.getHeight(); @@ -410,16 +410,16 @@ function IPB3TemplateDiffResults() <3 javascript */ var _tmp = Math.floor( Math.random() * 1001 ); - _qb = "
 
"; - _tb = '' + _qb + '
'; + _qb = "
 
"; + _tb = '' + _qb + '
'; if ( json['change_data_type'] == 'css' ) { - content = '

' + json['change_data_title'] + '.css' + '

' + _tb + '
'; + content = '

' + json['change_data_title'] + '.css' + '

' + _tb + '
'; } else { - content = '

' + json['change_data_group'] + ' > ' + json['change_data_title'] + '

' + _tb + '
'; + content = '

' + json['change_data_group'] + ' > ' + json['change_data_title'] + '

' + _tb + '
'; } IPB3TemplateDiffResults.popUps['edit-' + changeId ] = new ipb.Popup('diffEditPopUp_' + _tmp, { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: '600px', initial: '
 
' } ); @@ -535,7 +535,7 @@ function IPB3TemplateDiffResults() } else { - alert( "Ошибка: " + t.responseText ); + alert( ipb.lang['oops'] + t.responseText ); } }, onFailure: function() @@ -567,7 +567,7 @@ function IPB3TemplateDiffResults() /* Test to see if we've left in merge stuff */ if ( content.match( '<<<<<<<<<<' ) || content.match( '>>>>>>>>>' ) ) { - alert( 'Нельзя сохранить пока не будут устранены все конфликты' ); + alert( ipb.lang['mustfixfirst'] ); } else { @@ -608,7 +608,7 @@ function IPB3TemplateDiffResults() } else { - alert( "Ошибка: " + t.responseText ); + alert( ipb.lang['oops'] + t.responseText ); } }, onException: function( f,e ){ alert( "Исключение: " + e ); }, diff --git a/upload/admin/applications/core/js/index.html b/upload/admin/applications/core/js/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/js/index.html +++ b/upload/admin/applications/core/js/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/js/ipb3CSS.js b/upload/admin/applications/core/js/ipb3CSS.js index f9ed0c9b..d4078f7f 100644 --- a/upload/admin/applications/core/js/ipb3CSS.js +++ b/upload/admin/applications/core/js/ipb3CSS.js @@ -40,7 +40,7 @@ function IPBCSS() * @var hash */ this.cssNames = { - 'cssRow' : 'tablerow2', + 'cssRow' : 'row2', 'cssHover' : 'cssHover' }; @@ -85,7 +85,7 @@ function IPBCSS() } else { - alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); + alert( "Похоже у нас проблемы: " + t.responseText ); } }, onException: function( f,e ){ alert( "Исключение: " + e ); }, @@ -143,7 +143,7 @@ function IPBCSS() } else { - alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText ); + alert( "Похоже у нас проблемы: " + t.responseText ); } }, onException: function( f,e ){ alert( "Исключение: " + e ); }, @@ -196,13 +196,13 @@ function IPBCSS() if ( json['errors'] ) { /* Something inline would be very nice here.. rather than this ugly alert */ - alert("Я СКАЗАЛ: " + json['errors'] ); + alert("Ошибка: " + json['errors'] ); } } } else { - alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText ); + alert( "Похоже у нас проблемы: " + t.responseText ); } }, onException: function( f,e ){ alert( "Исключение: " + e ); }, @@ -239,7 +239,7 @@ function IPBCSS() } else { - alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText ); + alert( "Похоже у нас проблемы: " + t.responseText ); } }, onException: function( f,e ){ alert( "Исключение: " + e ); }, diff --git a/upload/admin/applications/core/js/ipb3Hooks.js b/upload/admin/applications/core/js/ipb3Hooks.js index 3737e1bc..726346e2 100644 --- a/upload/admin/applications/core/js/ipb3Hooks.js +++ b/upload/admin/applications/core/js/ipb3Hooks.js @@ -1,27 +1,74 @@ +function addAnotherRequirement() +{ + requireIndex = parseInt(requireIndex) + 1; + + // Show the data location dropdown now + + url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getApplications&secure_key=" + ipb.vars['md5_hash'] + "&i=" + requireIndex + "&name=requireApp"; + url = url.replace( /&/g, '&' ); + + new Ajax.Request( url, + { + method: 'GET', + onSuccess: function ( t ) + { + var newApp = ipb.templates['new_app_require'].evaluate({ index: requireIndex, dropdown: t.responseText }); + + if ( $('RequirementsContainer').down('tbody') ) + { + $('RequirementsContainer').down('tbody').insert( newApp ); + } + else + { + $('RequirementsContainer').insert( newApp ); + } + }, + onException: function( f,e ){ alert( "Exception: " + e ); }, + onFailure: function( t ){ alert( "Failure: " + t.responseText ); } + } ); +} + +function removeRequirement( idToRemove ) +{ + idToRemove = parseInt(idToRemove); + + if( $('requirementTitleRow_' + idToRemove ) != null ) + { + $('requirementTitleRow_' + idToRemove ).remove(); + } + + if( $('requirementRow_' + idToRemove ) != null ) + { + $('requirementRow_' + idToRemove ).remove(); + } +} + + function addAnotherFile() { elementIndex = parseInt(elementIndex) + 1; - var header = new Element( 'div', { 'class': 'tablesubheader' } ); - header.update( ipb.lang['hookfilenumber'] + elementIndex ); + var newFile = ipb.templates['new_hook_file'].evaluate({ index: elementIndex }); - var list = new Element( 'ul', { 'id': 'fileTable_' + elementIndex } ); - list.addClassName( 'acp-form' ); - list.addClassName( 'alternate_rows' ); - - $('fileTableContainer').insert( header ); - $('fileTableContainer').insert( list ); - - var li1 = new Element( 'li' ).update( "" ); - var li2 = new Element( 'li' ).update( "" ); - var li3 = new Element( 'li' ).update( "" ); + if ( $('fileTableContainer').down('tbody') ) + { + $('fileTableContainer').down('tbody').insert( newFile ); + } + else + { + $('fileTableContainer').insert( newFile ); + } +} - $('fileTable_' + elementIndex).insert( li1 ); - $('fileTable_' + elementIndex).insert( li2 ); - $('fileTable_' + elementIndex).insert( li3 ); - - doStriping(); +function removeFile( elementIndex ) +{ + elementIndex = parseInt(elementIndex); + + if( $('fileRow_' + elementIndex ) != null ) + { + $('fileRow_' + elementIndex ).remove(); + } } function selectHookType( elementIndex ) @@ -63,7 +110,6 @@ function selectHookType( elementIndex ) $('tr_dataLocation[' + elementIndex + ']').remove(); } - if( $('tr_libApplication[' + elementIndex + ']') != null ) { $('tr_libApplication[' + elementIndex + ']').remove(); @@ -81,9 +127,16 @@ function selectHookType( elementIndex ) method: 'GET', onSuccess: function (t ) { - li1 = new Element( 'li', { 'id': 'tr_skinGroup[' + elementIndex + ']' } ).update( "" + t.responseText ); - $('fileTable_' + elementIndex).insert( li1 ); - doStriping(); + var newRow = ipb.templates['hook_skinGroup'].evaluate({ index: elementIndex, dropdown: t.responseText }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } }, onException: function( f,e ){ alert( "Exception: " + e ); }, onFailure: function( t ){ alert( "Failure: " + t.responseText ); } @@ -101,9 +154,16 @@ function selectHookType( elementIndex ) method: 'GET', onSuccess: function (t ) { - li1 = new Element( 'li', { 'id': 'tr_dataLocation[' + elementIndex + ']' } ).update( "" + t.responseText ); - $('fileTable_' + elementIndex).insert( li1 ); - doStriping(); + var newRow = ipb.templates['hook_dataLocation'].evaluate({ index: elementIndex, dropdown: t.responseText }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } }, onException: function( f,e ){ alert( "Exception: " + e ); }, onFailure: function( t ){ alert( "Failure: " + t.responseText ); } @@ -111,9 +171,6 @@ function selectHookType( elementIndex ) } else if( type == 'libraryHooks' ) { - var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "" ); - $('fileTable_' + elementIndex).insert( li1 ); - // Show the data location dropdown now url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getApplications&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex; @@ -124,9 +181,17 @@ function selectHookType( elementIndex ) method: 'GET', onSuccess: function (t ) { - li1 = new Element( 'li', { 'id': 'tr_libApplication[' + elementIndex + ']' } ).update( "" + t.responseText ); - $('fileTable_' + elementIndex).insert( li1 ); - doStriping(); + var replace = { index: elementIndex, dropdown: t.responseText }; + var newRow = ipb.templates['hook_classToOverload'].evaluate(replace) + ipb.templates['hook_libApplication'].evaluate(replace); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } }, onException: function( f,e ){ alert( "Exception: " + e ); }, onFailure: function( t ){ alert( "Failure: " + t.responseText ); } @@ -136,8 +201,16 @@ function selectHookType( elementIndex ) { // Show the classToOverload field - var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "" ); - $('fileTable_' + elementIndex).insert( li1 ); + var newRow = ipb.templates['hook_classToOverload'].evaluate({ index: elementIndex }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } } } @@ -165,27 +238,38 @@ function getTemplatesForAdd( elementIndex ) $('tr_position[' + elementIndex + ']').remove(); } - url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getTemplatesForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type; - url = url.replace( /&/g, '&' ); - - new Ajax.Request( url, - { - method: 'GET', - onSuccess: function (t ) - { - li1 = new Element( 'li', { 'id': 'tr_skinFunction[' + elementIndex + ']' } ).update( "" + t.responseText ); - $('fileTable_' + elementIndex).insert( li1 ); - doStriping(); - }, - onException: function( f,e ){ alert( "Exception: " + e ); }, - onFailure: function( t ){ alert( "Failure: " + t.responseText ); } - } ); + /* Got a type? */ + if( type != '0' ) + { + url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getTemplatesForAdd&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type; + url = url.replace( /&/g, '&' ); + + new Ajax.Request( url, + { + method: 'GET', + onSuccess: function (t ) + { + var newRow = ipb.templates['hook_skinFunction'].evaluate({ index: elementIndex, dropdown: t.responseText }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } + }, + onException: function( f,e ){ alert( "Exception: " + e ); }, + onFailure: function( t ){ alert( "Failure: " + t.responseText ); } + } ); + } } function getTypeOfHook( elementIndex ) { - var type = $F('skinFunction[' + elementIndex + ']'); - + var template = $F('skinFunction[' + elementIndex + ']'); + if( $('tr_type[' + elementIndex + ']') != null ) { $('tr_type[' + elementIndex + ']').remove(); @@ -200,11 +284,21 @@ function getTypeOfHook( elementIndex ) { $('tr_position[' + elementIndex + ']').remove(); } - - li1 = new Element( 'li', { 'id': 'tr_type[' + elementIndex + ']' } ).update( "" ); - $('fileTable_' + elementIndex).insert( li1 ); - doStriping(); + /* Insert the new hook type row */ + if ( template != '0' ) + { + var newRow = ipb.templates['hook_pointTypes'].evaluate({ index: elementIndex }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } + } } function getHookIds( elementIndex ) @@ -222,34 +316,46 @@ function getHookIds( elementIndex ) $('tr_position[' + elementIndex + ']').remove(); } - url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getHookIds&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template; - url = url.replace( /&/g, '&' ); - - new Ajax.Request( url, - { - method: 'GET', - onSuccess: function (t ) - { - li1 = new Element( 'li', { 'id': 'tr_id[' + elementIndex + ']' } ).update( "" + t.responseText ); - $('fileTable_' + elementIndex).insert( li1 ); - doStriping(); - }, - onException: function( f,e ){ alert( "Exception: " + e ); }, - onFailure: function( t ){ alert( "Failure: " + t.responseText ); } - } ); + /* Got a type? */ + if( type != '0' ) + { + url = ipb.vars['base_url'] + "app=core&module=ajax&section=hooks&do=getHookIds&secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template; + url = url.replace( /&/g, '&' ); + + new Ajax.Request( url, + { + method: 'GET', + onSuccess: function (t ) + { + var newRow = ipb.templates['hook_pointIds'].evaluate({ index: elementIndex, dropdown: t.responseText }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } + }, + onException: function( f,e ){ alert( "Exception: " + e ); }, + onFailure: function( t ){ alert( "Failure: " + t.responseText ); } + } ); + } } function getHookEntryPoints( elementIndex ) { - var type = $F('type[' + elementIndex + ']'); - + var type = $F('type[' + elementIndex + ']'); + + Debug.write( type ); + if( $('tr_position[' + elementIndex + ']') != null ) { $('tr_position[' + elementIndex + ']').remove(); } - + var options = ''; - options += ""; if( type == 'foreach' ) { @@ -267,9 +373,18 @@ function getHookEntryPoints( elementIndex ) options += ""; options += ""; } - - var li1 = new Element( 'li', { 'id': 'tr_position[' + elementIndex + ']' } ).update( "" ); - $('fileTable_' + elementIndex).insert( li1 ); - - doStriping(); + /* Insert the new hook type row */ + //if ( type != '0' ) + //{ + var newRow = ipb.templates['hook_pointLocation'].evaluate({ index: elementIndex, hookPoints: options }); + + if ( $('fileTable_' + elementIndex).down('tbody') ) + { + $('fileTable_' + elementIndex).down('tbody').insert( newRow ); + } + else + { + $('fileTable_' + elementIndex).insert( newRow ); + } + //} } \ No newline at end of file diff --git a/upload/admin/applications/core/js/ipb3Replacements.js b/upload/admin/applications/core/js/ipb3Replacements.js index b8b6273f..0e7c0338 100644 --- a/upload/admin/applications/core/js/ipb3Replacements.js +++ b/upload/admin/applications/core/js/ipb3Replacements.js @@ -40,7 +40,7 @@ function IPBReplacements() * @var hash */ this.cssNames = { - 'replacementsRow' : 'tablerow2', + 'replacementsRow' : 'row2', 'replacementsHover' : 'replacementsHover' }; diff --git a/upload/admin/applications/core/js/ipb3TemplateSandR.js b/upload/admin/applications/core/js/ipb3TemplateSandR.js index 9cf8d809..cef4010b 100644 --- a/upload/admin/applications/core/js/ipb3TemplateSandR.js +++ b/upload/admin/applications/core/js/ipb3TemplateSandR.js @@ -139,7 +139,7 @@ function IPBTemplateSandR() url = ipb.vars['base_url'] + "app=core&module=ajax&section=templatesandr&do=replace&&sessionID=" + this.sessionID + '&secure_key=' + ipb.vars['md5_hash']; $('replaceButton').disabled = true; - $('replaceButton').value = "Сохранение..."; + $('replaceButton').value = ipb.lang['tpl_savegeneric']; new Ajax.Request( url.replace( /&/g, '&' ), { @@ -189,7 +189,7 @@ function IPBTemplateSandR() url = ipb.vars['base_url'] + "app=core&module=ajax&section=templates&do=saveTemplateBit&setID=" + this.setData['set_id'] + '&template_id=' + template_id + '&secure_key=' + ipb.vars['md5_hash']; /* Set up params */ - var params = { 'template_content' : $F('tplate_editBox_' + template_id ), + var params = { 'template_content' : $F('tplate_editBox_' + template_id ).encodeParam(), /* Need to run encodeParam or urlencoding is lost on save - same as acp.templates.js */ 'template_data' : $F('tplate_dataBox_' + template_id ), 'template_set' : this.setData['set_id'], 'template_group' : IPB3TemplatesSandR.currentTemplateGroup, @@ -259,10 +259,7 @@ function IPBTemplateSandR() var _output = ''; var _tplate = new Template( $('tplate_groupRow').innerHTML ); var json = IPB3TemplatesSandR.templateGroups; - - var ROW_ON_OFF = true; - var CLASS_NAME = ''; - + var _groups = Object.keys( json['groups'] ).sort(); /* Clear out any current listing */ @@ -271,18 +268,7 @@ function IPBTemplateSandR() /* Format... */ _groups.each( function( i ) { - if( ROW_ON_OFF) - { - ROW_ON_OFF = false; - CLASS_NAME = 'acp-row-off'; - } - else - { - ROW_ON_OFF = true; - CLASS_NAME = 'acp-row-on'; - } - - _output += _tplate.evaluate( { 'groupName' : i, '_matches' : Object.keys( json['groups'][i] ).length, 'classname' : CLASS_NAME } ); + _output += _tplate.evaluate( { 'groupName' : i, '_matches' : Object.keys( json['groups'][i] ).length } ); } ); /* Write it out */ @@ -300,8 +286,6 @@ function IPBTemplateSandR() $( 'groupRowCbox_' + i ).show(); } } ); - - doStriping(); }; /** @@ -315,17 +299,20 @@ function IPBTemplateSandR() IPB3TemplatesSandR.currentTemplateGroup = groupName; - /* Clear out any current listing */ - $( 'groupRowTemplates_' + groupName ).update(''); - /* Add in the new... */ for( i = 0 ; i < json['templates'].length; i++ ) { _output += _tplate.evaluate( json['templates'][i] ); }; + /* Clear out any current listing */ + $$( '#groupRowTemplates_' + groupName + " table.ipsTable" ).each( function(elem) { + elem.update( _output ); + }); + //$( 'groupRowTemplates_' + groupName ).update(''); + /* Write it out */ - $( 'groupRowTemplates_' + groupName ).update( _output ); + //$( 'groupRowTemplates_' + groupName ).update( _output ); /* Post process */ for( i = 0 ; i < json['templates'].length; i++ ) diff --git a/upload/admin/applications/core/js/ipb3Templates.js b/upload/admin/applications/core/js/ipb3Templates.js index 423938ad..ee6fd469 100644 --- a/upload/admin/applications/core/js/ipb3Templates.js +++ b/upload/admin/applications/core/js/ipb3Templates.js @@ -48,9 +48,9 @@ function IPBTemplates() */ this.cssNames = { 'groupRowLit' : 'tplateLit', 'groupHover' : 'groupHover', - 'groupRowLitMain' : 'tablerow1', - 'groupRow' : 'tablerow2', - 'templateRow' : 'tablerow2', + 'groupRowLitMain' : 'row1', + 'groupRow' : 'row2', + 'templateRow' : 'row2', 'templateHover' : 'templateHover' }; diff --git a/upload/admin/applications/core/js/ipb3uAgents.js b/upload/admin/applications/core/js/ipb3uAgents.js index b35358ab..819d2764 100644 --- a/upload/admin/applications/core/js/ipb3uAgents.js +++ b/upload/admin/applications/core/js/ipb3uAgents.js @@ -119,6 +119,8 @@ function IPBUAgents() IPB3UAgents.uAgentsData = json; IPB3UAgents.buildUAgentsList(); + ipb.global.showInlineNotification( ipb.lang['useragent_saved'], { showClose: true } ); + if ( json['errors'] ) { /* Something inline would be very nice here.. rather than this ugly alert */ @@ -132,11 +134,11 @@ function IPBUAgents() } else { - alert( "Ошибка: " + t.responseText ); + alert( ipb.lang['oops'] + t.responseText ); } }, - onException: function( f,e ){ alert( "Исключение: " + e ); }, - onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } + onException: function( f,e ){ alert( ipb.lang['oops'] + e ); }, + onFailure: function( t ){ alert( ipb.lang['oops'] + t.responseText ); } } ); }; @@ -146,7 +148,7 @@ function IPBUAgents() this.removeuAgent = function( uagent_id ) { /* Make sure we're mean it... */ - if ( ! confirm( "Удалить user agent?\\nОн будет удален полностью из системы" ) ) + if ( ! confirm( ipb.lang['removeuseragent'] ) ) { return false; } @@ -183,11 +185,11 @@ function IPBUAgents() } else { - alert( "Ошибка: " + t.responseText ); + alert( ipb.lang['oops'] + t.responseText ); } }, - onException: function( f,e ){ alert( "Исключение: " + e ); }, - onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } + onException: function( f,e ){ alert( ipb.lang['oops'] + e ); }, + onFailure: function( t ){ alert( ipb.lang['oops'] + t.responseText ); } } ); }; @@ -235,7 +237,7 @@ function IPBUAgents() /* Adjust title */ if ( ! uagent_id ) { - $('tplate_title_' + uagent_id ).update("Добавление User Agent"); + $('tplate_title_' + uagent_id ).update( ipb.lang['adduagenttitle'] ); } /* Select box type */ @@ -290,7 +292,7 @@ function IPBUAgents() _groups.each( function( i ) { json['uagents'][i]['_cssClass'] = IPB3UAgents.cssNames['uagentsRow']; - + json['uagents'][i]['uagent_name'] = json['uagents'][i]['uagent_name'].replace("%20", " "); _output += _tplate.evaluate( json['uagents'][i] ); } ); diff --git a/upload/admin/applications/core/modules_admin/ajax/compare.php b/upload/admin/applications/core/modules_admin/ajax/compare.php index 6b1855f9..18426e36 100644 --- a/upload/admin/applications/core/modules_admin/ajax/compare.php +++ b/upload/admin/applications/core/modules_admin/ajax/compare.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Template comparison
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-07-12 10:53:25 -0400 (Tue, 12 Jul 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 9208 $ */ @@ -29,35 +29,32 @@ class admin_core_ajax_compare extends ipsAjaxCommand /** * Skin functions object handle * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * HTML Skin object * - * @access protected * @var object */ protected $html; - /** + /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ - public function doExecute( ipsRegistry $registry ) - { + public function doExecute( ipsRegistry $registry ) + { //----------------------------------------- // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ $this->skinFunctions = new skinDifferences( $registry ); @@ -73,68 +70,71 @@ class admin_core_ajax_compare extends ipsAjaxCommand $this->html = $this->registry->output->loadTemplate('cp_skin_templates'); - //----------------------------------------- - // What shall we do? - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'css': - $this->_getCssDifferences(); - break; - + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'css': + $this->_getCssDifferences(); + break; + default: - case 'differences': - $this->_getDifferences(); - break; - } - } - - /** - * Get differences of a CSS file - * - * @access private - * @return void - */ - private function _getCssDifferences() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $setID = intval($this->request['setID']); - $fileID = intval($this->request['file_id']); - - //----------------------------------------- - // Get requested - //----------------------------------------- - - $current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) ); - - if( $current['css_id'] ) - { - //----------------------------------------- - // Get the original - //----------------------------------------- - - $original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id=0 AND css_group='{$current['css_group']}'" ) ); - } - else - { - $original['css_content'] = $current['css_content']; - } + case 'differences': + $this->_getDifferences(); + break; + } + } + + /** + * Get differences of a CSS file + * + * @return @e void + */ + protected function _getCssDifferences() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $setID = intval($this->request['setID']); + $fileID = intval($this->request['file_id']); + + //----------------------------------------- + // Get requested + //----------------------------------------- + + $current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_id=' . $fileID ) ); + + if( $current['css_id'] ) + { + //----------------------------------------- + // Get the original + //----------------------------------------- + + $set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['css_set_id'] ) ); + + $set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root'; + + $original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id=0 AND css_master_key='{$set['set_master_key']}' AND css_group='{$current['css_group']}'" ) ); + } + else + { + $original['css_content'] = $current['css_content']; + } //----------------------------------------- // Get Diff library //----------------------------------------- - require_once( IPS_KERNEL_PATH . 'classDifference.php' ); - $classDifference = new classDifference(); + require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/ + $classDifference = new classDifference(); $classDifference->method = 'PHP'; $difference = $classDifference->getDifferences( $original['css_content'], $current['css_content'] ); - + if( $classDifference->diff_found ) { $difference = str_replace( "\n", "
", $difference ); @@ -153,53 +153,56 @@ class admin_core_ajax_compare extends ipsAjaxCommand } $this->returnHtml( $this->html->differenceResult( $difference ) ); - } - - /** - * Get differences of a template - * - * @access private - * @return void - */ - private function _getDifferences() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $setID = intval($this->request['setID']); - $templateID = intval($this->request['template_id']); - - //----------------------------------------- - // Get requested - //----------------------------------------- - - $current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) ); - - if( $current['template_set_id'] ) - { - //----------------------------------------- - // Get the original - //----------------------------------------- - - $original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_group='{$current['template_group']}' AND template_name='{$current['template_name']}'" ) ); - } - else - { - $original['template_content'] = $current['template_content']; - } + } + + /** + * Get differences of a template + * + * @return @e void + */ + protected function _getDifferences() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $setID = intval($this->request['setID']); + $templateID = intval($this->request['template_id']); + + //----------------------------------------- + // Get requested + //----------------------------------------- + + $current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'template_id=' . $templateID ) ); + + if( $current['template_set_id'] ) + { + //----------------------------------------- + // Get the original + //----------------------------------------- + + $set = $this->DB->buildAndFetch( array( 'select' => 'set_master_key', 'from' => 'skin_collections', 'where' => 'set_id=' . $current['template_set_id'] ) ); + + $set['set_master_key'] = $set['set_master_key'] ? $set['set_master_key'] : 'root'; + + $original = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id=0 AND template_master_key='{$set['set_master_key']}' AND template_group='{$current['template_group']}' AND template_name='{$current['template_name']}'" ) ); + } + else + { + $original['template_content'] = $current['template_content']; + } //----------------------------------------- // Get Diff library //----------------------------------------- - require_once( IPS_KERNEL_PATH . 'classDifference.php' ); - $classDifference = new classDifference(); + require_once( IPS_KERNEL_PATH . 'classDifference.php' );/*noLibHook*/ + $classDifference = new classDifference(); $classDifference->method = 'PHP'; $difference = $classDifference->getDifferences( $original['template_content'], $current['template_content'] ); - + if( $classDifference->diff_found ) { $difference = str_replace( "\n", "
", $difference ); @@ -218,6 +221,6 @@ class admin_core_ajax_compare extends ipsAjaxCommand } $this->returnHtml( $this->html->differenceResult( $difference ) ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/css.php b/upload/admin/applications/core/modules_admin/ajax/css.php index a90bed41..7b213fb1 100644 --- a/upload/admin/applications/core/modules_admin/ajax/css.php +++ b/upload/admin/applications/core/modules_admin/ajax/css.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * AJAX Functions For applications/core/js/ipb3CSS.js file
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ @@ -30,46 +30,44 @@ class admin_core_ajax_css extends ipsAjaxCommand /** * Skin functions object handle * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; - /** + /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) - { - $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); - + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + //----------------------------------------- // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); /* Check... */ if ( ! $registry->getClass('class_permissions')->checkPermission( 'css_manage', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); + exit(); } - //----------------------------------------- - // What shall we do? - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'getCSSGroups': - $this->_getCSSGroups(); - break; + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'getCSSGroups': + $this->_getCSSGroups(); + break; case 'getCSSForEdit': $this->_getCSSForEdit(); break; @@ -81,38 +79,37 @@ class admin_core_ajax_css extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'css_delete', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->lang->words['sk_ajax_noperm'] ); - exit(); + exit(); } $this->_revertCSS(); break; - } - } - + } + } + /** * Reverts CSS * - * @access private * @return string Json */ - private function _revertCSS() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - $cssID = intval( $this->request['css_id'] ); + protected function _revertCSS() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); + $cssID = intval( $this->request['css_id'] ); $fromDelete = intval( $this->request['fromDelete'] ); - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $cssID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $cssID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + exit(); + } //----------------------------------------- // Get template data @@ -121,40 +118,39 @@ class admin_core_ajax_css extends ipsAjaxCommand $css = $this->skinFunctions->revertCSS( $cssID, $setID, $fromDelete ); $this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); - } + } /** * Saves the CSS * - * @access private * @return string Json */ - private function _saveCSS() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - $cssID = intval( $this->request['css_id'] ); - $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; - $css_content = $_POST['css_content']; - $css_group = IPSText::alphanumericalClean( $_POST['_css_group'] ); + protected function _saveCSS() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); + $cssID = intval( $this->request['css_id'] ); + $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; + $css_content = $_POST['css_content']; + $css_group = IPSText::alphanumericalClean( $_POST['_css_group'] ); $css_position = intval( $this->request['css_position'] ); $css_attributes = $_POST['css_attributes']; $css_app = IPSText::alphanumericalClean( $_POST['css_app'] ); $css_app_hide = intval( $this->request['css_app_hide'] ); $css_modules = trim( $this->request['css_modules'] ); - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ( $type == 'edit' AND ! $cssID ) ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + exit(); + } //----------------------------------------- // Add checks @@ -165,8 +161,8 @@ class admin_core_ajax_css extends ipsAjaxCommand if ( ! $css_group ) { $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + exit(); + } } //----------------------------------------- @@ -186,7 +182,7 @@ class admin_core_ajax_css extends ipsAjaxCommand catch( Exception $err ) { $this->returnJsonError( $err->getMessage() ); - exit(); + exit(); } } @@ -197,32 +193,31 @@ class admin_core_ajax_css extends ipsAjaxCommand $css = $this->skinFunctions->fetchCSSForEdit( $css_id, $setID ); $this->returnJsonArray( array( 'cssData' => $css, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); - } + } /** * Fetch a JSON list of template data ready for editing * - * @access private * @return string Json */ - private function _getCSSForEdit() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); + protected function _getCSSForEdit() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); $cssID = intval( $this->request['css_id'] ); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $cssID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $cssID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + exit(); + } //----------------------------------------- // Get template data @@ -231,31 +226,30 @@ class admin_core_ajax_css extends ipsAjaxCommand $css = $this->skinFunctions->fetchCSSForEdit( $cssID, $setID ); $this->returnJsonArray( array( 'cssData' => $css ) ); - } + } - /** + /** * Fetch a JSON list of CSS group names * - * @access private * @return string Json */ - private function _getCSSGroups() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + protected function _getCSSGroups() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + exit(); + } //----------------------------------------- // Get CSS @@ -276,5 +270,5 @@ class admin_core_ajax_css extends ipsAjaxCommand ksort( $css, SORT_NUMERIC ); $this->returnJsonArray( array( 'css' => $css ) ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/findnames.php b/upload/admin/applications/core/modules_admin/ajax/findnames.php index 80616282..160a7e23 100644 --- a/upload/admin/applications/core/modules_admin/ajax/findnames.php +++ b/upload/admin/applications/core/modules_admin/ajax/findnames.php @@ -3,24 +3,24 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Login handler abstraction : AJAX Find Names functions
- * Last Updated: $Date: 2010-02-22 08:06:40 -0500 (Mon, 22 Feb 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: josh $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 5857 $ + * @version $Revision: 8644 $ * @see public_core_ajax_findnames * */ -if ( ! defined( 'IN_IPB' ) ) +if ( ! defined( 'IN_ACP' ) ) { print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; exit(); @@ -31,9 +31,8 @@ class admin_core_ajax_findnames extends ipsAjaxCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -48,10 +47,9 @@ class admin_core_ajax_findnames extends ipsAjaxCommand /** * Returns possible matches for the string input * - * @access private - * @return void Outputs to screen + * @return @e void Outputs to screen */ - private function _getMemberNames() + protected function _getMemberNames() { //----------------------------------------- // INIT @@ -96,11 +94,16 @@ class admin_core_ajax_findnames extends ipsAjaxCommand while( $r = $this->DB->fetch() ) { - $photo = IPSMember::buildProfilePhoto( $r ); - $group = IPSLib::makeNameFormatted( '' , $r['member_group_id'] ); + if( !$r['members_display_name'] ) + { + continue; + } + + $photo = IPSMember::buildProfilePhoto( $r ); + $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], 'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')', - 'img' => $photo['pp_thumb_photo'], + 'img' => $photo['pp_mini_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height'] ); diff --git a/upload/admin/applications/core/modules_admin/ajax/hooks.php b/upload/admin/applications/core/modules_admin/ajax/hooks.php index a01b0a65..23c2900d 100644 --- a/upload/admin/applications/core/modules_admin/ajax/hooks.php +++ b/upload/admin/applications/core/modules_admin/ajax/hooks.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Hooks (AJAX)
- * Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
+ * Last Updated: $Date: 2011-10-07 22:31:51 -0400 (Fri, 07 Oct 2011) $
  * 
* - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 1st march 2002 - * @version $Revision: 6980 $ + * @version $Revision: 9588 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -58,13 +58,13 @@ class admin_core_ajax_hooks extends ipsAjaxCommand * * @var object Hooks library */ - private $hooksFunctions; + protected $hooksFunctions; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -140,19 +140,29 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get applications * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getApplications() { - $i = intval( $this->request['i'] ); - $apps = array(); + /* Init vars */ + $i = intval($this->request['i']); + $name = empty($this->request['name']) ? 'libApplication' : trim($this->request['name']); + $apps = array(); foreach( ipsRegistry::$applications as $dir => $appdata ) { $apps[] = array( $dir, $appdata['app_title'] ); } - $output = $this->registry->output->formDropdown( "libApplication[{$i}]", $apps ); + sort($apps); + + /* A bit hackish.. */ + if ( $name != 'libApplication' ) + { + array_unshift( $apps, array( 0, $this->lang->words['a_selectone'] ) ); + } + + $output = $this->registry->output->formDropdown( "{$name}[{$i}]", $apps ); $this->returnHtml( $output ); } @@ -160,14 +170,13 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get data hook locations * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getDataLocationsForAdd() { - $i = intval( $this->request['i'] ); - - $_locations = IPSLib::getDataHookLocations(); - $output = $this->registry->output->formDropdown( "dataLocation[{$i}]", $_locations ); + $i = intval( $this->request['i'] ); + $_locations = IPSLib::getDataHookLocations(); + $output = $this->registry->output->formDropdown( "dataLocation[{$i}]", $_locations ); $this->returnHtml( $output ); } @@ -175,24 +184,24 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get all hook ids for a template/type * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getHookIds() { - $i = intval( $this->request['i'] ); - $template = IPSText::alphanumericalClean( $this->request['template'] ); - $type = IPSText::alphanumericalClean( $this->request['type'] ); - $return = $this->hooksFunctions->getHookIds( $template, $type ); - - $output = $this->registry->output->formDropdown( "id[{$i}]", $return, null, "id[{$i}]", "onchange='getHookEntryPoints({$i});'" ); - + $i = intval( $this->request['i'] ); + $template = IPSText::alphanumericalClean( $this->request['template'] ); + $type = IPSText::alphanumericalClean( $this->request['type'] ); + $return = $this->hooksFunctions->getHookIds( $template, $type ); + + $output = ( count($return) > 1 ) ? $this->registry->output->formDropdown( "id[{$i}]", $return, '', "id[{$i}]", "onchange='getHookEntryPoints({$i});'" ) : $this->lang->words['hook_no_hook_ids_found']; + $this->returnHtml( $output ); } /** * Get all skin files * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getGroupsForAdd() { @@ -207,7 +216,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get all skin templates * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getTemplatesForAdd() { @@ -223,7 +232,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get language strings in a given file * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getAjaxStrings() { @@ -244,7 +253,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get all language files * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getAjaxFiles() { @@ -264,7 +273,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get skin templates in a given file * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getAjaxTemplates() { @@ -285,7 +294,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Get all skin files * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _getAjaxSkins() { @@ -305,7 +314,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Save the form * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function save() { @@ -370,8 +379,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand } } - $this->data['settingGroups'] = $toSave['settingGroups']; - $this->data['settings'] = $toSave['settings']; + if( count($toSave['settingGroups']) ) + { + $this->data['settingGroups'] = $toSave['settingGroups']; + } + else + { + unset($this->data['settingGroups']); + } + + if( count($toSave['settings']) ) + { + $this->data['settings'] = $toSave['settings']; + } + else + { + unset($this->data['settings']); + } if( count($toDisplay['settingGroups']) ) { @@ -388,7 +412,14 @@ class admin_core_ajax_hooks extends ipsAjaxCommand $output .= "{$this->lang->words['hook_settings']} " . implode( ', ', $toDisplay['settings'] ); } - $this->data['display']['settings'] = $output; + if( $output ) + { + $this->data['display']['settings'] = $output; + } + else + { + unset($this->data['display']['settings']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -425,12 +456,24 @@ class admin_core_ajax_hooks extends ipsAjaxCommand } } + if( !count($this->data['language']) ) + { + unset($this->data['language']); + } + if( count($toDisplay) ) { $output .= implode( '
', $toDisplay ); } - $this->data['display']['language'] = $output; + if( $output ) + { + $this->data['display']['language'] = $output; + } + else + { + unset($this->data['display']['language']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -463,8 +506,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand $output .= "{$this->lang->words['hook_modules']} " . implode( ', ', $toDisplay ); } - $this->data['modules'] = $toSave; - $this->data['display']['modules'] = $output; + if( count($toSave) ) + { + $this->data['modules'] = $toSave; + } + else + { + unset($this->data['modules']); + } + + if( $output ) + { + $this->data['display']['modules'] = $output; + } + else + { + unset($this->data['display']['modules']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -497,8 +555,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand $output .= "{$this->lang->words['hook_help']} " . implode( ', ', $toDisplay ); } - $this->data['help'] = $toSave; - $this->data['display']['help'] = $output; + if( count($toSave) ) + { + $this->data['help'] = $toSave; + } + else + { + unset($this->data['help']); + } + + if( $output ) + { + $this->data['display']['help'] = $output; + } + else + { + unset($this->data['display']['help']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -521,7 +594,17 @@ class admin_core_ajax_hooks extends ipsAjaxCommand if( preg_match( "/^skin_(\d+)$/", $k, $matches ) ) { $files[ $matches[1] ] = $v; - $templates[ $matches[1] ] = $this->request[ 'templates_' . $matches[1] ]; + + $_templates = array(); + + foreach( $this->request[ 'templates_' . $matches[1] ] as $v ) + { + if( $v ) + { + $templates[ $matches[1] ][] = $v; + } + } + $ids[ $matches[1] ] = $matches[1]; } } @@ -535,12 +618,24 @@ class admin_core_ajax_hooks extends ipsAjaxCommand } } + if( !count($this->data['templates']) ) + { + unset($this->data['templates']); + } + if( count($toDisplay) ) { $output .= implode( '
', $toDisplay ); } - $this->data['display']['templates'] = $output; + if( $output ) + { + $this->data['display']['templates'] = $output; + } + else + { + unset($this->data['display']['templates']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -577,8 +672,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand } /* Save */ - $this->data['css'] = $toSave; - $this->data['display']['css'] = $output; + if( count($toSave) ) + { + $this->data['css'] = $toSave; + } + else + { + unset($this->data['css']); + } + + if( $output ) + { + $this->data['display']['css'] = $output; + } + else + { + unset($this->data['display']['css']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $this->data ) ), 'hook_id=' . $this->hookId ); @@ -612,8 +722,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand $output .= "{$this->lang->words['hook_tasks']} " . implode( ', ', $toDisplay ); } - $this->data['tasks'] = $toSave; - $this->data['display']['tasks'] = $output; + if( count($toSave) ) + { + $this->data['tasks'] = $toSave; + } + else + { + unset($this->data['tasks']); + } + + if( $output ) + { + $this->data['display']['tasks'] = $output; + } + else + { + unset($this->data['display']['tasks']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -683,7 +808,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand if( $tabletype ) { - $text .= " TYPE=" . $tabletype; + $text .= " ENGINE=" . $tabletype; } $toDisplay[] = nl2br($text); @@ -817,7 +942,19 @@ class admin_core_ajax_hooks extends ipsAjaxCommand $output .= implode( '
', $toDisplay ); } - $this->data['display']['database'] = $output; + if( $output ) + { + $this->data['display']['database'] = $output; + } + else + { + unset($this->data['display']['database']); + } + + if( !count($this->data['database']) ) + { + unset($this->data['database']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -843,8 +980,23 @@ class admin_core_ajax_hooks extends ipsAjaxCommand $output .= "install_" . $toDisplay; } - $this->data['custom'] = $toSave; - $this->data['display']['custom'] = $output; + if( $toSave ) + { + $this->data['custom'] = $toSave; + } + else + { + unset($this->data['custom']); + } + + if( $output ) + { + $this->data['display']['custom'] = $output; + } + else + { + unset($this->data['display']['custom']); + } $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize($this->data) ), 'hook_id=' . $this->hookId ); @@ -867,7 +1019,7 @@ class admin_core_ajax_hooks extends ipsAjaxCommand /** * Show the form * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function show() { diff --git a/upload/admin/applications/core/modules_admin/ajax/index.html b/upload/admin/applications/core/modules_admin/ajax/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/ajax/index.html +++ b/upload/admin/applications/core/modules_admin/ajax/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/livesearch.php b/upload/admin/applications/core/modules_admin/ajax/livesearch.php index b0e4bd8e..fd9cb297 100644 --- a/upload/admin/applications/core/modules_admin/ajax/livesearch.php +++ b/upload/admin/applications/core/modules_admin/ajax/livesearch.php @@ -3,18 +3,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Live Search
- * Last Updated: $Date: 2010-08-17 11:38:47 -0400 (Tue, 17 Aug 2010) $
+ * Last Updated: $Date: 2011-08-23 10:24:47 -0400 (Tue, 23 Aug 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: mark $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6763 $ + * @link http://hatynka.in + * @version $Rev: 9404 $ * */ @@ -26,28 +26,11 @@ if ( ! defined( 'IN_IPB' ) ) class admin_core_ajax_livesearch extends ipsAjaxCommand { - /** - * HTML to output - * - * @access private - * @var string - */ - private $output; - - /** - * Skin object - * - * @access private - * @var object Skin templates - */ - private $html; - /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -55,170 +38,95 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand // Load skin //----------------------------------------- $this->registry->class_localization->loadLanguageFile( array( 'admin_ajax' ) ); - $this->html = $this->registry->output->loadTemplate('cp_skin_livesearch'); /* What to do */ switch( $this->request['do'] ) { + default: case 'search': $this->doSearchRequest(); break; - - case 'template': - default: - $this->getTemplate(); - break; - } - - /* Output */ - $this->returnHtml( $this->output ); + } } - - /** - * Fetches the live search template - * - * @access public - * @return void - */ - public function getTemplate() - { - $this->output .= $this->html->liveSearchTemplate(); - } - + /** * Handles the live search * - * @access public - * @return void + * @return @e void */ public function doSearchRequest() { - /* INI */ - $search_term = $this->request['search_term']; - - $results = array(); - $return = array( 'members' => null, 'groups' => false, 'settings' => null, 'forums' => null, 'location' => null ); - - /* Do search here */ - $results = $this->_getSettings( $search_term, $results ); - $results = $this->_getFromXML( $search_term, $results ); - $results = $this->_getMembers( $search_term, $results ); - $results = $this->_checkGroups( $search_term, $results ); - $results = $this->_checkForums( $search_term, $results ); - //----------------------------------------- - // Members + // Init //----------------------------------------- - $secCount = 0; + $search_term = $this->request['search_term']; + $results = array(); + $results = array( 'members' => array(), 'groups' => array(), 'groupLangs' => false, 'settings' => array(), 'forums' => array(), 'location' => array() ); - if( isset( $results['members'] ) AND is_array( $results['members'] ) AND count($results['members'])) + if ( IPSLib::appIsInstalled('nexus') ) { - foreach( $results['members'] as $members ) - { - $secCount++; - $return['members'] .= $this->html->searchRowMember( $members, $secCount ); - } + $results['nexus'] = array(); } //----------------------------------------- - // Group settings? + // Search //----------------------------------------- - $secCount = 0; + $results = $this->_getSettings( $search_term, $results ); + $results = $this->_getFromXML( $search_term, $results ); + $results = $this->_getMembers( $search_term, $results ); + $results = $this->_checkGroups( $search_term, $results ); + $results = $this->_checkForums( $search_term, $results ); - if( $results['groups'] ) + if ( IPSLib::appIsInstalled('nexus') ) { - foreach( $results['groups'] as $group ) - { - $secCount++; - $return['groups'] .= $this->html->searchRowGroupsTitles( $group, $secCount ); - } + $results = $this->_checkNexus( $search_term, $results ); } - - if( $results['groupLangs'] ) - { - $return['groups'] .= $this->html->searchRowGroups(); - } - + //----------------------------------------- - // Settings + // Output //----------------------------------------- - - $secCount = 0; - - if( isset( $results['settings'] ) AND is_array( $results['settings'] ) AND count($results['settings']) ) - { - foreach( $results['settings'] as $setting ) - { - $secCount++; - $return['settings'] .= $this->html->searchRowSetting( $setting, $secCount ); - } - } - - //----------------------------------------- - // Forums - //----------------------------------------- - - $secCount = 0; - - if( isset( $results['forums'] ) AND is_array( $results['forums'] ) AND count($results['forums'])) - { - foreach( $results['forums'] as $forum ) - { - $secCount++; - $return['forums'] .= $this->html->searchRowForums( $forum, $secCount ); - } - } - - //----------------------------------------- - // Locations - //----------------------------------------- - - $secCount = 0; - - if( isset( $results['location'] ) AND is_array( $results['location'] ) AND count($results['location'])) - { - foreach( $results['location'] as $location ) - { - $secCount++; - $return['location'] .= $this->html->searchRowLocation( $location, $secCount ); - } - } - - /* Output */ - $this->output .= $this->html->liveSearchDisplay( $return, $search_term ); + + $this->returnJsonArray( $results ); } /** * Searches for matching members * - * @access private * @param string Search term * @param array Existing search results * @return array New search results */ - private function _getMembers( $term, $results ) + protected function _getMembers( $term, $results ) { $term = mb_strtolower($term); - $this->DB->build( array( - 'select' => 'member_id, members_display_name, name, members_l_username, members_l_display_name, email', - 'from' => 'members', - 'where' => "members_l_username LIKE '%{$term}%' OR members_l_display_name LIKE '%{$term}%' OR " . $this->DB->buildLower('email') . " LIKE '%{$term}%'", - ) ); + $this->DB->build( array('select' => 'm.*, pp.*, g.g_title', + 'from' => array('members' => 'm'), + 'where' => "members_l_username LIKE '%{$term}%' OR members_l_display_name LIKE '%{$term}%' OR " . $this->DB->buildLower('email') . " LIKE '%{$term}%'", + 'limit' => array(0, 250 ), + 'add_join' => array( array( 'from' => array( 'groups' => 'g' ), + 'where' => 'g.g_id=m.member_group_id', + 'type' => 'left' ), + array( 'from' => array( 'profile_portal' => 'pp' ), + 'where' => 'pp.pp_member_id=m.member_id', + 'type' => 'left' ) ) + ) ); $this->DB->execute(); - while( $r = $this->DB->fetch() ) + while( $member = $this->DB->fetch() ) { $_matched = ''; + $member = $r = IPSMember::buildProfilePhoto( $member ); + $r = array(); - if( $r['members_l_display_name'] AND mb_strpos( $r['members_l_display_name'], $term ) !== false ) + if( $member['members_l_display_name'] AND mb_strpos( $term, $member['members_l_display_name'] ) !== false ) { $r['_matched'] = 'members_display_name'; } - else if( $r['members_l_username'] AND mb_strpos( $r['members_l_username'], $term ) !== false ) + else if( $member['members_l_username'] AND mb_strpos( $term, $member['members_l_username'] ) !== false ) { $r['_matched'] = 'name'; } @@ -226,7 +134,14 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand { $r['_matched'] = 'email'; } - + + $r['name'] = $member['members_display_name']; + $r['extra'] = $member['g_title']; + $r['img'] = $member['pp_mini_photo']; + $r['url'] = $this->settings['_base_url']."&app=members&module=members&section=members&do=viewmember&member_id=".$member['member_id']; + + /* Trim out what we don't need */ + $results['members'][] = $r; } @@ -236,15 +151,13 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand /** * Check if search term is found in groups language file or in the group_cache.g_title * - * @access private * @param string Search term * @param array Existing search results * @return array New search results */ - private function _checkGroups( $term, $results ) + protected function _checkGroups( $term, $results ) { - $term = mb_strtolower($term); - $results['groups'] = false; + $term = mb_strtolower($term); $this->registry->class_localization->loadLanguageFile( array( 'admin_groups' ), 'members' ); $this->registry->class_localization->loadLanguageFile( array( 'admin_forums' ), 'forums' ); @@ -254,9 +167,11 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand foreach( $this->lang->words as $k => $v ) { - if( strpos( $k, 'gf_' ) !== false AND strpos( $v, $term ) !== false ) + if( strpos( $k, 'gf_' ) !== false AND mb_strpos( $v, $term ) !== false ) { - $results['groupLangs'] = true; + IPSDebug::fireBug( 'info', array( 'Group key found: ' . $k . ': ' . $v ) ); + + $results['groupLangs'] = true; break; } } @@ -272,7 +187,10 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand if ( preg_match( "#" . $_term . "#iu", $data['g_title'] ) ) { - $results['groups'][] = $data; + $results['groups'][] = array( + 'name' => IPSMember::makeNameFormatted( $data['g_title'], $data['g_id'] ), + 'url' => $this->settings['_base_url'] . "&app=members&module=groups&section=groups&do=edit&id=" . $data['g_id'], + ); } } } @@ -283,12 +201,11 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand /** * Check if search term is found in groups language file * - * @access private * @param string Search term * @param array Existing search results * @return array New search results */ - private function _checkForums( $term, $results ) + protected function _checkForums( $term, $results ) { $term = mb_strtolower($term); $results['forums'] = false; @@ -306,6 +223,8 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand if ( preg_match( "#" . $_term . "#iu", $data['name'] ) ) { + $data['extra'] = ( ( $data['posts'] == null ) ? 0 : $data['posts'] ) . " сообщений"; + $data['url'] = $this->settings['_base_url']."&app=forums&module=forums&section=forums&do=edit&f=".$data['id']; $results['forums'][] = $data; } } @@ -316,43 +235,39 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand /** * Searches the settings table * - * @access private * @param string Search term * @param array Existing search results * @return array New search results */ - private function _getSettings( $term, $results ) + protected function _getSettings( $term, $results ) { $term = mb_strtolower($term); if( !IN_DEV ) { - $this->DB->build( array( - 'select' => 'c.conf_group, c.conf_title, c.conf_description, c.conf_keywords', - 'from' => array( 'core_sys_conf_settings' => 'c' ), - 'where' => 't.conf_title_noshow=0 AND (' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('c.conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$term}%')", - 'add_join' => array( - array( - 'from' => array( 'core_sys_settings_titles' => 't' ), - 'where' => 't.conf_title_id=c.conf_group', - 'type' => 'left' - ) - ) - ) ); + $this->DB->build( array( 'select' => 'c.conf_group, c.conf_title, c.conf_description, c.conf_keywords', + 'from' => array( 'core_sys_conf_settings' => 'c' ), + 'where' => 't.conf_title_noshow=0 AND (' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('c.conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$term}%')", + 'add_join' => array( array( 'from' => array( 'core_sys_settings_titles' => 't' ), + 'where' => 't.conf_title_id=c.conf_group', + 'type' => 'left' ) ) + ) ); } else { - $this->DB->build( array( - 'select' => 'conf_group, conf_title, conf_description, conf_keywords', - 'from' => 'core_sys_conf_settings', - 'where' => $this->DB->buildLower('conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('conf_keywords') . " LIKE '%{$term}%'", - ) ); + $this->DB->build( array( 'select' => 'conf_group, conf_title, conf_description, conf_keywords', + 'from' => 'core_sys_conf_settings', + 'where' => $this->DB->buildLower('conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('conf_keywords') . " LIKE '%{$term}%'", + ) ); } $this->DB->execute(); while( $r = $this->DB->fetch() ) { + $r['name'] = $r['conf_title']; + $r['url'] = $this->settings['_base_url']."&app=core&module=settings&section=settings&do=setting_view&conf_group=" . $r['conf_group'] . "&search=" . $this->request['search_term']; + $results['settings'][] = $r; } @@ -360,44 +275,226 @@ class admin_core_ajax_livesearch extends ipsAjaxCommand } /** - * Searches the XML Files + * Searches Nexus * - * @access private * @param string Search term * @param array Existing search results * @return array New search results */ - private function _getFromXML( $term, $results ) + protected function _checkNexus( $term, $results ) { - foreach( $this->cache->getCache('app_menu_cache') as $app => $cache ) + $textTerm = $this->DB->addSlashes( mb_strtolower( $term ) ); + $intTerm = intval( $term ); + $encodedTerm = urlencode( $encodedTerm ); + + $tempResults = array(); + + require_once( IPSLib::getAppDir('nexus') . '/sources/customer.php' );/*noLibHook*/ + + //----------------------------------------- + // Is it a number? + //----------------------------------------- + + if ( (string) $term == (string) $intTerm ) { - if( IPSLib::appIsInstalled( $app ) ) + /* Invoice? */ + $invoice = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_invoices', 'where' => "i_id={$intTerm}" ) ); + if ( $invoice['i_id'] ) { - foreach( $cache as $entry ) + $tempResults['invoice'] = array( 'name' => $invoice['i_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=invoices&do=view_invoice&id={$invoice['i_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/invoice.png' ); + } + + /* Purchase? */ + $purchase = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_purchases', 'where' => "ps_id={$intTerm}" ) ); + if ( $purchase['ps_id'] ) { - if( count($entry['items']) ) + $tempResults['purchase'] = array( 'name' => $purchase['ps_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$purchase['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/purchase.png' ); + } + + /* Support */ + $support = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_support_requests', 'where' => "r_id={$intTerm}" ) ); + if ( $support['r_id'] ) + { + $tempResults['support'] = array( 'name' => $support['r_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=tickets&section=view&id={$support['r_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/support.png' ); + } + + /* Customer */ + $customer = $this->DB->buildAndFetch( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "member_id={$intTerm}" ) ); + if ( $customer['member_id'] ) + { + if ( !preg_replace( '/\s/', '', $customer['members_display_name'] ) ) { - foreach( $entry['items'] as $item ) - { - if( $item['section'] ) - { - $item['url'] = "section={$item['section']}&" . $item['url']; - } + $customer['members_display_name'] = '?????'; + } + + $tempResults['member'] = array( 'name' => $customer['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$customer['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + } - if( isset($item['keywords']) AND mb_stripos( $item['keywords'], $term ) !== false ) + } + + //----------------------------------------- + // Nope - text + //----------------------------------------- + + else + { + /* License Key */ + $lkey = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_licensekeys', 'where' => $this->DB->buildLower('lkey_key') ."='{$textTerm}'" ) ); + if ( $lkey['lkey_key'] ) + { + $tempResults['lkey'] = array( 'name' => $lkey['lkey_key'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$lkey['lkey_purchase']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/lkey.png' ); + } + + /* Customers */ + $customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) ); + if ( $customer['count'] ) + { + if ( $customer['count'] > 50 ) + { + $tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'member_id, email', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) + { + $tempResults['member'][] = array( 'name' => $row['email'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + } + } + } + + $customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) ); + if ( $customer['count'] ) + { + if ( $customer['count'] > 50 ) + { + $tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) + { + $tempResults['member'][] = array( 'name' => $row['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + } + } + } + + /* Hosting Accounts */ + if ( strpos( $textTerm, '.' ) === FALSE ) + { + $hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) ); + if ( $hosting['count'] ) + { + if ( $hosting['count'] > 50 ) + { + $tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=username", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'ps_id, account_username', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) { - $item['url'] = "&app={$app}&module={$item['module']}&{$item['url']}"; - $results['location'][] = $item; + $tempResults['hosting'][] = array( 'name' => $row['account_username'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); } - else if( mb_stripos( $item['title'], $term ) !== false ) + } + } + } + if ( empty( $tempResults['hosting'] ) ) + { + $hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) ); + if ( $hosting['count'] ) + { + if ( $hosting['count'] > 50 ) + { + $tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=domain", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'ps_id, account_domain', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) { - $item['fullurl'] = "&app={$app}&module={$item['module']}&{$item['url']}"; - $results['location'][] = $item; + $tempResults['hosting'][] = array( 'name' => $row['account_domain'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); } } } } } + + //----------------------------------------- + // Return results + //----------------------------------------- + + + foreach ( array( 'invoice', 'purchase', 'lkey', 'support', 'member', 'hosting' ) as $k ) + { + if ( isset( $tempResults[ $k ] ) ) + { + if ( isset( $tempResults[ $k ][0] ) ) + { + foreach ( $tempResults[ $k ] as $l ) + { + $results['nexus'][] = $l; + } + } + else + { + $results['nexus'][] = $tempResults[ $k ]; + } + } + } + + return $results; + } + + /** + * Searches the XML Files + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _getFromXML( $term, $results ) + { + foreach( $this->cache->getCache('app_menu_cache') as $app => $cache ) + { + if( IPSLib::appIsInstalled( $app ) ) + { + foreach( $cache as $entry ) + { + if( count($entry['items']) ) + { + foreach( $entry['items'] as $item ) + { + if( $item['section'] ) + { + $item['url'] = "section={$item['section']}&" . $item['url']; + } + + if( isset($item['keywords']) AND mb_stripos( $item['keywords'], $term ) !== false ) + { + $item['name'] = $item['title']; + $item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}"; + $results['location'][] = $item; + } + else if( mb_stripos( $item['title'], $term ) !== false ) + { + $item['name'] = $item['title']; + $item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}"; + $results['location'][] = $item; + } + } + } + } + } } return $results; diff --git a/upload/admin/applications/core/modules_admin/ajax/replacements.php b/upload/admin/applications/core/modules_admin/ajax/replacements.php index e4f14045..d4d9ebf6 100644 --- a/upload/admin/applications/core/modules_admin/ajax/replacements.php +++ b/upload/admin/applications/core/modules_admin/ajax/replacements.php @@ -3,21 +3,21 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * AJAX Functions For applications/core/js/ipb3CSS.js file
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * Author: Matt Mecham * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ @@ -32,43 +32,41 @@ class admin_core_ajax_replacements extends ipsAjaxCommand /** * Skin functions object handle * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; - /** + /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ - public function doExecute( ipsRegistry $registry ) - { - $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); - + public function doExecute( ipsRegistry $registry ) + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + //----------------------------------------- // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); - //----------------------------------------- - // What shall we do? - //----------------------------------------- - - switch( $this->request['do'] ) - { + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { case 'saveReplacement': /* Check... */ if ( !$registry->getClass('class_permissions')->checkPermission( 'replacements_manage', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); + exit(); } $this->_saveReplacement(); break; @@ -77,7 +75,7 @@ class admin_core_ajax_replacements extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'replacements_delete', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); + exit(); } $this->_revertReplacement(); break; @@ -87,54 +85,52 @@ class admin_core_ajax_replacements extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'easy_logo', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); + exit(); } $this->getEasyLogo(); break; - } - } - - /** - * Get logo image replacement for a skin - * - * @access public - * @return void - */ - public function getEasyLogo() - { - $setID = intval( $this->request['value'] ); - + } + } + + /** + * Get logo image replacement for a skin + * + * @return @e void + */ + public function getEasyLogo() + { + $setID = intval( $this->request['value'] ); + $replacements = $this->skinFunctions->fetchReplacements( $setID ); $currentUrl = $replacements['logo_img']['replacement_content']; $currentId = $replacements['logo_img']['replacement_id']; $this->returnJsonArray( array( 'url' => $currentUrl, 'id' => $currentId ) ); - } - + } + /** * Reverts replacement * - * @access private * @return string Json */ - private function _revertReplacement() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); + protected function _revertReplacement() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); $replacementID = intval( $this->request['replacement_id'] ); - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $replacementID ) - { - $this->returnJsonError('Missing Data'); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $replacementID ) + { + $this->returnJsonError('Missing Data'); + exit(); + } //----------------------------------------- // Get template data @@ -143,35 +139,34 @@ class admin_core_ajax_replacements extends ipsAjaxCommand $replacements = $this->skinFunctions->revertReplacement( $replacementID, $setID ); $this->returnJsonArray( array( 'replacements' => $replacements, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); - } + } /** * Saves the CSS * - * @access private * @return string Json */ - private function _saveReplacement() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - $replacementID = intval( $this->request['replacement_id'] ); - $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; - $replacement_content = $this->convertUnicode( $_POST['replacement_content'] ); - $replacement_key = $this->convertUnicode( $_POST['_replacement_key'] ); + protected function _saveReplacement() + { + //----------------------------------------- + // INIT + //----------------------------------------- - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ( $type == 'edit' AND ! $replacementID ) ) - { - $this->returnJsonError('Missing Data'); - exit(); - } + $setID = intval( $this->request['setID'] ); + $replacementID = intval( $this->request['replacement_id'] ); + $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; + $replacement_content = $this->convertUnicode( $_POST['replacement_content'] ); + $replacement_key = $this->convertUnicode( $_POST['_replacement_key'] ); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ( $type == 'edit' AND ! $replacementID ) ) + { + $this->returnJsonError('Missing Data'); + exit(); + } //----------------------------------------- // Add checks @@ -182,8 +177,8 @@ class admin_core_ajax_replacements extends ipsAjaxCommand if ( ! $replacement_key ) { $this->returnJsonError('Missing Data'); - exit(); - } + exit(); + } } //----------------------------------------- @@ -203,7 +198,7 @@ class admin_core_ajax_replacements extends ipsAjaxCommand catch( Exception $err ) { $this->returnJsonError( $err->getMessage() ); - exit(); + exit(); } } @@ -214,5 +209,5 @@ class admin_core_ajax_replacements extends ipsAjaxCommand $replacements = $this->skinFunctions->fetchReplacements( $setID ); $this->returnJsonArray( array( 'replacements' => $replacements, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/skinsets.php b/upload/admin/applications/core/modules_admin/ajax/skinsets.php new file mode 100644 index 00000000..98e5c7d4 --- /dev/null +++ b/upload/admin/applications/core/modules_admin/ajax/skinsets.php @@ -0,0 +1,84 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * AJAX Functions For applications/core/js/ipb3CSS.js file + * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $ + * + * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Board + * @subpackage Core + * @link http://hatynka.in + * @since Friday 19th May 2006 17:33 + * @version $Revision: 8644 $ + */ + + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class admin_core_ajax_skinsets extends ipsAjaxCommand +{ + /** + * Skin functions object handle + * + * @var object + */ + protected $skinFunctions; + + /** + * Main executable + * + * @param object registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + + $this->html = $this->registry->output->loadTemplate('cp_skin_templates'); + + $this->form_code = $this->html->form_code = 'module=templates&section=skinsets'; + $this->form_code_js = $this->html->form_code_js = 'module=templates§ion=skinsets'; + + //----------------------------------------- + // Load functions and cache classes + //----------------------------------------- + + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $this->skinFunctions = new skinCaching( $registry ); + + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + default: + case 'showAddDialogue': + $this->_showAddDialogue(); + break; + } + } + + /** + * Displays the add dialogue + * + * @return string Json + */ + protected function _showAddDialogue() + { + $this->returnHtml( $this->html->newSkinSetPopUp( IPSLib::hasActiveLicense( false ) ) ); + } + + +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/tabs.php b/upload/admin/applications/core/modules_admin/ajax/tabs.php new file mode 100644 index 00000000..a76b21d5 --- /dev/null +++ b/upload/admin/applications/core/modules_admin/ajax/tabs.php @@ -0,0 +1,103 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class admin_core_ajax_tabs + * @brief AJAX storage of tab order preference + * + */ +class admin_core_ajax_tabs extends ipsAjaxCommand +{ + /** + * Array of valid tab keys + * + * @var $tabKeys + */ + protected $tabKeys = array( 'core', 'forums', 'members', 'lookfeel', 'support', 'reports', 'other' ); + + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_tools' ), 'core' ); + + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + default: + case 'save': + $this->_saveTabs(); + break; + } + } + + /** + * Save tab preference order + * + * @return @e void + */ + protected function _saveTabs() + { + //----------------------------------------- + // Store order + //----------------------------------------- + + $order = array(); + $append = array(); + + foreach( $this->tabKeys as $pos => $key ) + { + if( $this->request['pos_' . $key ] ) + { + $order[ $this->request['pos_' . $key ] ] = $key; + } + else + { + $append[] = $key; + } + } + + if( count($append) ) + { + $order = array_merge( $order, $append ); + } + + ksort($order); + + //----------------------------------------- + // Save preference + //----------------------------------------- + + ipsRegistry::getClass('adminFunctions')->staffSaveCookie( 'tabOrder', $order ); + + //----------------------------------------- + // Return new order + //----------------------------------------- + + $this->returnJsonArray( array( 'order' => $order ) ); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/templatediff.php b/upload/admin/applications/core/modules_admin/ajax/templatediff.php index 5bcf1ea1..a5828574 100644 --- a/upload/admin/applications/core/modules_admin/ajax/templatediff.php +++ b/upload/admin/applications/core/modules_admin/ajax/templatediff.php @@ -3,21 +3,21 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * AJAX Functions For applications/core/js/ipb3Templates.js file
- * Last Updated: $Date: 2010-09-13 17:28:12 -0400 (Mon, 13 Sep 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * Author: Matt Mecham * - * @author $Author: terabyte $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6863 $ + * @version $Revision: 8644 $ */ @@ -32,17 +32,15 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Skin functions object handle * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -52,9 +50,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ $this->skinFunctions = new skinDifferences( $registry ); @@ -99,10 +97,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Grab a version to show * - * @access private - * @return string JSON + * @return @e void */ - private function _viewVersion() + protected function _viewVersion() { $change_id = trim( $this->request['change_id'] ); $type = trim( $this->request['type'] ); @@ -159,10 +156,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Save diff * - * @access private - * @return string JSON + * @return @e void */ - private function _saveEdit() + protected function _saveEdit() { $change_id = trim( $this->request['change_id'] ); $content = $_POST['content']; @@ -194,10 +190,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Save diff * - * @access private - * @return string JSON + * @return @e void */ - private function _resolveAllSingle() + protected function _resolveAllSingle() { $change_id = trim( $this->request['change_id'] ); $type = trim( $this->request['type'] ); @@ -224,9 +219,8 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Build a desc string * - * @access private * @param array Item data - * @param string String + * @return string String */ public function _buildDescString( $item ) { @@ -281,10 +275,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Grab a diff to edit * - * @access private - * @return string JSON + * @return @e void */ - private function _editDiff() + protected function _editDiff() { $change_id = trim( $this->request['change_id'] ); @@ -315,10 +308,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Grab a diff to show * - * @access private - * @return string JSON + * @return @e void */ - private function _viewDiff() + protected function _viewDiff() { $change_id = trim( $this->request['change_id'] ); $type = trim( $this->request['type'] ); @@ -358,10 +350,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Process * - * @access private - * @return string Json + * @return @e void */ - private function _process() + protected function _process() { /* INIT */ $pergo = intval( $this->request['perGo'] ) ? intval( $this->request['perGo'] ) : 10; @@ -556,10 +547,9 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand /** * Process merge * - * @access private - * @return string Json + * @return @e void */ - private function _merge() + protected function _merge() { /* INIT */ $pergo = intval( $this->request['perGo'] ) ? intval( $this->request['perGo'] ) : 10; @@ -575,11 +565,10 @@ class admin_core_ajax_templatediff extends ipsAjaxCommand if ( $session === FALSE ) { $this->returnJsonError( $this->lang->words['ajax_invalidsession'] ); - exit(); } /* Load merge class */ - require_once( IPS_KERNEL_PATH . 'classMerge.php' ); + require_once( IPS_KERNEL_PATH . 'classMerge.php' );/*noLibHook*/ /* Are we doing templates or CSS? */ if ( $session['merge_m_templates_togo'] ) diff --git a/upload/admin/applications/core/modules_admin/ajax/templates.php b/upload/admin/applications/core/modules_admin/ajax/templates.php index 743d6481..3bc3ec07 100644 --- a/upload/admin/applications/core/modules_admin/ajax/templates.php +++ b/upload/admin/applications/core/modules_admin/ajax/templates.php @@ -3,21 +3,21 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * AJAX Functions For applications/core/js/ipb3Templates.js file
- * Last Updated: $Date: 2010-05-18 20:12:44 -0400 (Tue, 18 May 2010) $
+ * Last Updated: $Date: 2011-07-12 17:54:40 -0400 (Tue, 12 Jul 2011) $
  * 
* * Author: Matt Mecham * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6314 $ + * @version $Revision: 9218 $ */ @@ -32,28 +32,26 @@ class admin_core_ajax_templates extends ipsAjaxCommand /** * Skin functions object handle * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; - /** + /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) - { - $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); - + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + //----------------------------------------- // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); @@ -61,21 +59,20 @@ class admin_core_ajax_templates extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); } - //----------------------------------------- - // What shall we do? - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'getTemplateBitList': - $this->_getTemplateBitList(); - break; + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'getTemplateBitList': + $this->_getTemplateBitList(); + break; case 'getTemplateGroupList': - $this->_getTemplateGroupList(); - break; + $this->_getTemplateGroupList(); + break; case 'getTemplateForEdit': $this->_getTemplateForEdit(); break; @@ -87,37 +84,35 @@ class admin_core_ajax_templates extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_delete', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); + exit(); } $this->_revertTemplateBit(); break; - } - } - + } + } + /** * Reverts a template bit * - * @access private - * @return string Json + * @return @e void */ - private function _revertTemplateBit() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - $templateID = intval( $this->request['template_id'] ); + protected function _revertTemplateBit() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); + $templateID = intval( $this->request['template_id'] ); - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $templateID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $templateID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + } //----------------------------------------- // Get template data @@ -126,39 +121,39 @@ class admin_core_ajax_templates extends ipsAjaxCommand $template = $this->skinFunctions->revertTemplateBit( $templateID, $setID ); $this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); - } + } /** * Saves the template bit * - * @access private - * @return string Json + * @return @e void */ - private function _saveTemplateBit() - { - //----------------------------------------- - // INIT - //----------------------------------------- + protected function _saveTemplateBit() + { + //----------------------------------------- + // INIT + //----------------------------------------- $test = $_POST['_template_name']; - $setID = intval( $this->request['template_set'] ); - $templateID = intval( $this->request['template_id'] ); - $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; - $template_content = $_POST['template_content']; - $template_group = IPSText::alphanumericalClean( $_POST['template_group'] ); + $setID = intval( $this->request['template_set'] ); + $templateID = intval( $this->request['template_id'] ); + $type = ( $this->request['type'] == 'add' ) ? 'add' : 'edit'; + $template_content = $_POST['template_content']; + $template_group = IPSText::alphanumericalClean( $_POST['template_group'] ); $ent_template_group = str_replace( "skin_", "", IPSText::alphanumericalClean( $_POST['_template_group'] ) ); - $template_name = IPSText::alphanumericalClean( $_POST['_template_name'] ); - $template_data = $_POST['template_data']; + $template_name = IPSText::alphanumericalClean( $_POST['_template_name'] ); + $template_data = $_POST['template_data']; - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + IPSDebug::fireBug( 'info', array( 'Template content: ' . $template_content ) ); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ( $type == 'edit' AND ! $templateID ) ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + } //----------------------------------------- // Add checks @@ -169,8 +164,7 @@ class admin_core_ajax_templates extends ipsAjaxCommand if ( ! $template_name ) { $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + } } //----------------------------------------- @@ -186,7 +180,6 @@ class admin_core_ajax_templates extends ipsAjaxCommand catch( Exception $err ) { $this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );//. ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) ); - exit(); } } else @@ -195,12 +188,11 @@ class admin_core_ajax_templates extends ipsAjaxCommand try { - $template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name ); + $template_id = $this->skinFunctions->saveTemplateBitFromAdd( $setID, $template_content, $template_data, $template_group, $template_name ); } catch( Exception $err ) { $this->returnJsonError( $this->lang->words[ 'templates_' . $err->getMessage() ] ? $this->lang->words[ 'templates_' . $err->getMessage() ] : $err->getMessage() );// . ' ' . implode( "\n", $this->skinFunctions->fetchMessages() ) ); - exit(); } } @@ -215,32 +207,30 @@ class admin_core_ajax_templates extends ipsAjaxCommand //----------------------------------------- $this->returnJsonArray( array( 'templateData' => $template, 'errors' => $this->skinFunctions->fetchErrorMessages() ) ); - } + } /** * Fetch a JSON list of template data ready for editing * - * @access private - * @return string Json + * @return @e void */ - private function _getTemplateForEdit() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); + protected function _getTemplateForEdit() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); $templateID = intval( $this->request['template_id'] ); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $templateID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $templateID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + } //----------------------------------------- // Get template data @@ -249,31 +239,29 @@ class admin_core_ajax_templates extends ipsAjaxCommand $template = $this->skinFunctions->fetchTemplateBitForEdit( $templateID, $setID ); $this->returnJsonArray( array( 'templateData' => $template ) ); - } + } /** * Fetch a JSON list of template groups * - * @access private - * @return string Json + * @return @e void */ - private function _getTemplateGroupList() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + protected function _getTemplateGroupList() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + } //----------------------------------------- // Get templates @@ -294,32 +282,30 @@ class admin_core_ajax_templates extends ipsAjaxCommand } $this->returnJsonArray( array( 'groups' => $templateGroups ) ); - } + } - /** + /** * Fetch a JSON list of template bits for the template group * - * @access private - * @return string Json + * @return @e void */ - private function _getTemplateBitList() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); + protected function _getTemplateBitList() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); $templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] ); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $templateGroup ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $templateGroup ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + } //----------------------------------------- // Get templates @@ -328,6 +314,6 @@ class admin_core_ajax_templates extends ipsAjaxCommand $templates = $this->skinFunctions->fetchTemplates( $setID, 'groupTemplatesNoContent', $templateGroup ); $this->returnJsonArray( array( 'templates' => array_values( $templates ), - 'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) ); - } + 'groupData' => array( '_modCount' => $this->skinFunctions->fetchModifiedTemplateCount( $setID, $templateGroup ) ) ) ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/templatesandr.php b/upload/admin/applications/core/modules_admin/ajax/templatesandr.php index 769b8993..935c1720 100644 --- a/upload/admin/applications/core/modules_admin/ajax/templatesandr.php +++ b/upload/admin/applications/core/modules_admin/ajax/templatesandr.php @@ -3,21 +3,21 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * AJAX Functions For applications/core/js/ipb3Templates.js file
- * Last Updated: $Date: 2010-05-18 20:12:44 -0400 (Tue, 18 May 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * Author: Matt Mecham * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6314 $ + * @version $Revision: 8644 $ */ @@ -32,29 +32,27 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand /** * Skin functions object handle * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; - /** + /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) - { - $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); - + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + //----------------------------------------- // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ $this->skinFunctions = new skinDifferences( $registry ); @@ -62,40 +60,38 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'templates_manage', ipsRegistry::$current_application, 'templates' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); } - //----------------------------------------- - // What shall we do? - //----------------------------------------- - - switch( $this->request['do'] ) - { + //----------------------------------------- + // What shall we do? + //----------------------------------------- + + switch( $this->request['do'] ) + { default: - case 'getTemplateBitList': - $this->_getTemplateBitList(); - break; + case 'getTemplateBitList': + $this->_getTemplateBitList(); + break; case 'replace': $this->_replace(); break; - } - } - + } + } + /** * Fetch a JSON list of template bits for the template group * - * @access private - * @return string Json + * @return @e void */ - private function _replace() - { - //----------------------------------------- - // INIT - //----------------------------------------- - + protected function _replace() + { + //----------------------------------------- + // INIT + //----------------------------------------- + $finalIDs = array(); $templates = array(); - $sessionID = IPSText::md5Clean( $this->request['sessionID'] ); + $sessionID = IPSText::md5Clean( $this->request['sessionID'] ); $sessionData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'template_sandr', @@ -107,7 +103,7 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand { foreach( $templateData as $_group => $_data ) { - if ( isset( $_POST['groups'][ $_group ] ) AND $_POST['groups'][ $_group ] ) + if ( !empty( $_POST['groups'][ $_group ] ) ) { foreach( $_data as $_name => $_id ) { @@ -118,7 +114,7 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand { foreach( $_data as $_name => $_id ) { - if ( isset( $_POST['templates'][ $_id ] ) AND $_POST['templates'][ $_id ] ) + if ( !empty( $_POST['templates'][ $_id ] ) ) { $finalIDs[] = $_id; } @@ -131,7 +127,6 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand if ( ! count( $finalIDs ) ) { $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); } /* Load templates */ @@ -168,35 +163,32 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand /* Done */ $this->returnJsonArray( array( 'status' => 'ok' ) ); - exit(); } /** * Fetch a JSON list of template bits for the template group * - * @access private - * @return string Json + * @return @e void */ - private function _getTemplateBitList() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); + protected function _getTemplateBitList() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $setID = intval( $this->request['setID'] ); $templateGroup = IPSText::alphanumericalClean( $this->request['templateGroup'] ); - $sessionID = IPSText::md5Clean( $this->request['sessionID'] ); + $sessionID = IPSText::md5Clean( $this->request['sessionID'] ); $templates = array(); - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $setID OR ! $templateGroup or ! $sessionID ) - { - $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $setID OR ! $templateGroup or ! $sessionID ) + { + $this->returnJsonError( $this->lang->words['ajax_missing_data'] ); + } //----------------------------------------- // Get templates @@ -221,5 +213,5 @@ class admin_core_ajax_templatesandr extends ipsAjaxCommand } $this->returnJsonArray( array( 'templates' => $templates ) ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/uagents.php b/upload/admin/applications/core/modules_admin/ajax/uagents.php index e11532a5..371772bb 100644 --- a/upload/admin/applications/core/modules_admin/ajax/uagents.php +++ b/upload/admin/applications/core/modules_admin/ajax/uagents.php @@ -3,21 +3,21 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * AJAX Functions For applications/core/js/ipb3CSS.js file
- * Last Updated: $Date: 2010-10-14 13:15:13 -0400 (Thu, 14 Oct 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * Author: Matt Mecham * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6980 $ + * @version $Revision: 8644 $ */ @@ -32,22 +32,20 @@ class admin_core_ajax_uagents extends ipsAjaxCommand /** * User agent functions * - * @access private * @var object Skin templates */ - private $userAgentFunctions; + protected $userAgentFunctions; - /** + /** * Main executable * - * @access public * @param object registry object - * @return void + * @return @e void */ - public function doExecute( ipsRegistry $registry ) - { - $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); - + public function doExecute( ipsRegistry $registry ) + { + $registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + //----------------------------------------- // Load functions and cache classes //----------------------------------------- @@ -55,17 +53,16 @@ class admin_core_ajax_uagents extends ipsAjaxCommand $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'] ) - { + //----------------------------------------- + // 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'] ); - exit(); } $this->_saveuAgent(); break; @@ -73,36 +70,33 @@ class admin_core_ajax_uagents extends ipsAjaxCommand if ( !$registry->getClass('class_permissions')->checkPermission( 'ua_remove', ipsRegistry::$current_application, 'tools' ) ) { $this->returnJsonError( $registry->getClass('class_localization')->words['sk_ajax_noperm'] ); - exit(); } $this->_removeuAgent(); break; - } - } - + } + } + /** * Reverts replacement * - * @access private - * @return string Json + * @return @e void */ - private function _removeuAgent() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $uagent_id = intval( $this->request['uagent_id'] ); + protected function _removeuAgent() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $uagent_id = intval( $this->request['uagent_id'] ); - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( ! $uagent_id ) - { - $this->returnJsonError('Missing Data'); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( ! $uagent_id ) + { + $this->returnJsonError('Missing Data'); + } //----------------------------------------- // Get template data @@ -111,38 +105,36 @@ class admin_core_ajax_uagents extends ipsAjaxCommand $userAgents = $this->userAgentFunctions->removeUserAgent( $uagent_id ); $this->returnJsonArray( array( 'uagents' => $userAgents, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) ); - } + } /** * Saves the user agent * - * @access private - * @return string Json + * @return @e void */ - private function _saveuAgent() - { - //----------------------------------------- - // INIT - //----------------------------------------- - + protected function _saveuAgent() + { + //----------------------------------------- + // INIT + //----------------------------------------- + $uagent_id = intval( $this->request['uagent_id'] ); $uagent_key = IPSText::alphanumericalClean( $this->request['uagent_key'] ); $uagent_name = $this->convertAndMakeSafe( $_POST['uagent_name'] ); $uagent_regex = $this->convertUnicode( $_POST['uagent_regex'] ); $uagent_regex_capture = intval( $this->request['uagent_regex_capture'] ); $uagent_type = IPSText::alphanumericalClean( $this->request['uagent_type'] ); - $uagent_position = intval( $this->request['uagent_position'] ); + $uagent_position = intval( $this->request['uagent_position'] ); $type = $this->request['type']; - //----------------------------------------- - // Checks... - //----------------------------------------- - - if ( $type == 'edit' AND ! $uagent_id ) - { - $this->returnJsonError('Missing Data'); - exit(); - } + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( $type == 'edit' AND ! $uagent_id ) + { + $this->returnJsonError('Missing Data'); + } //----------------------------------------- // Other checks @@ -151,8 +143,7 @@ class admin_core_ajax_uagents extends ipsAjaxCommand if ( ! $uagent_key OR ! $uagent_name OR ! $uagent_regex OR ! $uagent_type ) { $this->returnJsonError('Missing Data'); - exit(); - } + } //----------------------------------------- // Save it @@ -167,7 +158,6 @@ class admin_core_ajax_uagents extends ipsAjaxCommand catch( Exception $err ) { $this->returnJsonError( $err->getMessage() . ' ' . str_replace( "\n", "\\n", implode( ",", $this->userAgentFunctions->fetchMessages() ) ) ); - exit(); } } else @@ -179,16 +169,13 @@ class admin_core_ajax_uagents extends ipsAjaxCommand catch( Exception $err ) { $this->returnJsonError( $err->getMessage() ); - exit(); } } //----------------------------------------- // Get Data //----------------------------------------- - - $userAgents = $this->userAgentFunctions->fetchAgents(); - - $this->returnJsonArray( array( 'uagents' => $userAgents, 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) ); - } + + $this->returnJsonArray( array( 'uagents' => $this->userAgentFunctions->fetchAgents(), 'returnid' => $userAgentID, 'errors' => $this->userAgentFunctions->fetchErrorMessages() ) ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/applications.php b/upload/admin/applications/core/modules_admin/applications/applications.php index 5fd7f2a9..c8a5106f 100644 --- a/upload/admin/applications/core/modules_admin/applications/applications.php +++ b/upload/admin/applications/core/modules_admin/applications/applications.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Group management
- * Last Updated: $Date: 2010-11-16 11:26:43 -0500 (Tue, 16 Nov 2010) $
+ * Last Updated: $Date: 2011-09-09 19:44:48 -0400 (Fri, 09 Sep 2011) $
  * 
* - * @author $Author: mmecham $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Monday 15th January 2007 (15:01) - * @version $Revision: 7195 $ + * @version $Revision: 9476 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,208 +30,283 @@ class admin_core_applications_applications extends ipsCommand * * @var object Skin templates */ - private $html; + public $html; /** * Shortcut for url * * @var string URL shortcut */ - private $form_code; + public $form_code; /** * Shortcut for url (javascript) * * @var string JS URL shortcut */ - private $form_code_js; + public $form_code_js; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - public function doExecute( ipsRegistry $registry ) + public function doExecute( ipsRegistry $registry ) { //----------------------------------------- // Load skin //----------------------------------------- + - $this->html = $this->registry->output->loadTemplate('cp_skin_applications'); + $this->html = $this->registry->output->loadTemplate( 'cp_skin_applications' ); $this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ) ); //----------------------------------------- // Set up stuff //----------------------------------------- - $this->form_code = $this->html->form_code = 'module=applications&section=applications'; - $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=applications'; + + $this->form_code = $this->html->form_code = 'module=applications&section=applications&'; + $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=applications&'; //----------------------------------------- // What to do... //----------------------------------------- - switch($this->request['do']) + + switch( $this->request['do'] ) { - default: - case 'applications_overview': - $this->request[ 'do'] = 'applications_overview' ; + default : + case 'applications_overview' : + $this->request['do'] = 'applications_overview'; $this->applicationsOverview(); - break; - case 'application_manage_position': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); + break; + case 'application_manage_position' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' ); $this->applicationManagePosition(); - break; - case 'application_edit': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); + break; + case 'application_edit' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' ); $this->applicationForm( 'edit' ); - break; - case 'application_add': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); + break; + case 'application_add' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_install' ); $this->applicationForm( 'add' ); - break; - case 'application_edit_do': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); + break; + case 'application_edit_do' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' ); $this->applicationSave( 'edit' ); - break; - case 'application_add_do': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); + break; + case 'application_add_do' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_install' ); $this->applicationSave( 'add' ); - break; - case 'application_remove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_delete' ); + break; + case 'application_remove' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_delete' ); $this->applicationRemove(); - break; - case 'application_remove_splash': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_delete' ); + break; + case 'application_remove_splash' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_delete' ); $this->applicationRemoveSplash(); - break; - case 'application_export': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); - $this->applicationExport(); - break; - case 'toggle_app': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_manage' ); - $this->toggleAppEnabled(); - break; - case 'inDevRebuildAll': + break; + case 'toggle_app' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' ); + $this->applicationToggle(); + break; + case 'inDevExportApps' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'app_manage' ); + $this->inDevApplicationsExport(); + break; + case 'inDevRebuildAll' : $this->inDevRebuildAll(); - break; - case 'inDevExportAll': + break; + case 'inDevExportAll' : $this->inDevExportAll(); - break; - case 'module_recache_all': + break; + case 'module_recache_all' : $this->moduleRecacheAll(); - break; - case 'modules_overview': + break; + case 'modules_overview' : $this->modules_overview(); - break; - case 'module_edit': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_edit' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleForm( 'edit' ); - break; - case 'module_add': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_add' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleForm( 'add' ); - break; - case 'module_edit_do': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_edit_do' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleSave( 'edit' ); - break; - case 'module_add_do': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_add_do' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleSave( 'add' ); - break; - case 'module_manage_position': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_manage_position' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleManagePosition(); - break; - case 'module_remove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_delete' ); + break; + case 'module_remove' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_delete' ); $this->moduleRemove(); - break; - case 'module_export': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_export' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleExport(); - break; - case 'module_import': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'module_manage' ); + break; + case 'module_import' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'module_manage' ); $this->moduleImport(); - break; + break; - case 'build_sphinx': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'build_sphinx' ); - $this->buildSphinx(); - break; + case 'sphinxBuildConf' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'build_sphinx' ); + $this->sphinxBuildConf(); + break; - case 'seoRebuild': + case 'sphinxBuildCron' : + $this->registry->getClass( 'class_permissions' )->checkPermissionAutoMsg( 'build_sphinx' ); + $this->sphinxBuildCron(); + break; + + case 'seoRebuild' : $this->seoRebuild(); - break; + break; } //----------------------------------------- // 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(); + + $this->registry->getClass( 'output' )->html_main .= $this->registry->getClass( 'output' )->global_template->global_frame_wrapper(); + $this->registry->getClass( 'output' )->sendOutput(); } /** * Toggle application enabled/disabled * - * @return void + * @return @e void */ - public function toggleAppEnabled() + public function applicationToggle() { //-------------------------------------------- // INIT //-------------------------------------------- - + $app_id = intval( $this->request['app_id'] ); //----------------------------------------- // Got an application? //----------------------------------------- + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id=' . $app_id ) ); - - if( !$application['app_id'] ) + if ( ! $application['app_id'] ) { $this->registry->output->showError( $this->lang->words['cannot_find_tog_app'], 111161 ); } - if( in_array( $application['app_directory'], array( 'core', 'forums', 'members' ) ) AND $application['app_enabled'] ) + if ( in_array( $application['app_directory'], array( 'core', 'forums', 'members' ) ) and $application['app_enabled'] ) { $this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.1 ); } $this->DB->update( 'core_applications', array( 'app_enabled' => $application['app_enabled'] ? 0 : 1 ), 'app_id=' . $app_id ); - $this->moduleRecacheAll(1); + $this->moduleRecacheAll( 1 ); //----------------------------------------- // FURL templates //----------------------------------------- - + try { IPSLib::cacheFurlTemplates(); + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ) + { } - catch( Exception $e ){} + /* Check for possible hook warnings */ + if ( $application['app_enabled'] ) + { + // Switch the enabled value here or check will fail with the current cache! + ipsRegistry::$applications[$application['app_directory']]['app_enabled'] = 0; + + $this->_checkHooksWarnings( $application['app_directory'] ); + } + else + { + // Re-enable the tasks if we're re-activating the app + $this->DB->update( 'task_manager', array( 'task_enabled' => 1 ), "task_application='{$application['app_directory']}'" ); + } + + /* All done, redirect */ $this->registry->output->global_message = $this->lang->words['app_toggled_ok']; + $this->applicationsOverview(); + } + + /** + * Checks if there are new warnings added in + * the hooks after disabling an application + * + * @param string $appDirectory Application directory to be checked + * @return @e void [Adds text in the global message] + */ + public function _checkHooksWarnings( $appDirectory ) + { + /* Error check */ + if ( ! $appDirectory ) + { + return; + } - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); + /* Init vars */ + $warnings = 0; + + /*Get any possible application*/ + $this->DB->build( array( 'select' => 'hook_id, hook_requirements', + 'from' => 'core_hooks', + //This is a bit hackish but there's no way around... + 'where' => 'hook_enabled=1 AND hook_requirements LIKE \'%:"' . $this->DB->addSlashes( $appDirectory ) . '";a:%\'' + ) ); + $outer = $this->DB->execute(); + + /* Got results? */ + if ( $this->DB->getTotalRows( $outer ) ) + { + /* Get hooks file for update check */ + $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' ); + $hooksClass = new $classToLoad(); + $hooksClass->makeRegistryShortcuts( $this->registry ); + + /* Loop */ + while ( $hook = $this->DB->fetch( $outer ) ) + { + if ( count( $hooksClass->checkHookRequirements( $hook ) ) ) + { + $warnings ++; + } + } + } + + /* Got warnings? */ + if ( $warnings > 0 ) + { + $this->registry->getClass( 'output' )->html_main .= $this->registry->output->global_template->warning_box( sprintf( $this->lang->words['app_disable_hook_warnings'], ipsRegistry::$applications[$appDirectory]['app_title'], $warnings, $this->settings['base_url'] . '&module=applications&section=hooks&do=hooks_overview' ) ) . '
'; + } } /** * Build the FURL templates file into cache * - * @return void + * @return @e void */ public function seoRebuild() { @@ -246,54 +321,190 @@ class admin_core_applications_applications extends ipsCommand switch( $msg ) { - case 'CANNOT_WRITE': + case 'CANNOT_WRITE' : $msg = $this->lang->words['seo_cannot_write']; - break; - case 'NO_DATA_TO_WRITE': + break; + case 'NO_DATA_TO_WRITE' : $msg = $this->lang->words['seo_no_data']; - break; + break; } } $this->registry->output->global_message = $msg; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=tools&section=cache' ); } - /** - * Build the sphinx conf file and give for download + * Rebuild the Sphinx conf and returns + * a list of delta indexes too * - * @return void + * @return @e array Array of content and delta indexes */ - public function buildSphinx() + public function rebuildSphinxConfig() { - $sphinxContent = IPSLib::rebuildSphinxConfig(); + /* Init vars */ + $sphinxTemplate = ''; + $sphinxCompiled = ''; + $sphinxIndexes = array(); - $this->registry->output->showDownload( $sphinxContent, 'sphinx.conf', '', 0 ); - } + /* No main template? Something odd.. */ + if ( is_file( IPS_ROOT_PATH . '/extensions/sphinxTemplate.php' ) ) + { + require_once ( IPS_ROOT_PATH . '/extensions/sphinxTemplate.php' );/*noLibHook*/ + + /* Template file found but empty? */ + if ( $sphinxTemplate ) + { + //----------------------------------------- + // Replace out the SQL details + //----------------------------------------- + + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['sql_host'], $sphinxTemplate ); + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['sql_user'], $sphinxTemplate ); + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['sql_pass'], $sphinxTemplate ); + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['sql_database'], $sphinxTemplate ); + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['sql_port'] ? ipsRegistry::$settings['sql_port'] : 3306, $sphinxTemplate ); + + //----------------------------------------- + // Loop over the applications and build + //----------------------------------------- + + + foreach( ipsRegistry::$applications as $app_dir => $application ) + { + $appSphinxTemplate = ''; + + if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ) + { + require_once ( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' );/*maybeLibHook*/ + + if ( $appSphinxTemplate ) + { + $matches = array(); + preg_match_all( '#source\s+(\w+_delta)\s:{1}#i', $appSphinxTemplate, $matches ); + + if ( is_array( $matches[1] ) && count( $matches[1] ) ) + { + foreach( $matches[1] as $idx ) + { + $sphinxIndexes[] = ipsRegistry::$settings['sphinx_prefix'] . $idx; + } + } + + $sphinxCompiled .= $appSphinxTemplate; + } + } + } + + //----------------------------------------- + // Replace DB prefix + //----------------------------------------- + + + $sphinxCompiled = str_replace( "", ipsRegistry::$settings['sql_tbl_prefix'], $sphinxCompiled ); + + //----------------------------------------- + // And replace out the content with the compilation + //----------------------------------------- + + + $sphinxTemplate = str_replace( "", $sphinxCompiled, $sphinxTemplate ); + + //----------------------------------------- + // Replace out the /var/sphinx/ path + //----------------------------------------- + + + $sphinxTemplate = str_replace( "", rtrim( ipsRegistry::$settings['sphinx_base_path'], '/' ), $sphinxTemplate ); + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['search_sphinx_port'], $sphinxTemplate ); + $sphinxTemplate = str_replace( "", ipsRegistry::$settings['sphinx_prefix'], $sphinxTemplate ); + + //----------------------------------------- + // Wildcard support on? + //----------------------------------------- + + + if ( ipsRegistry::$settings['sphinx_wildcard'] ) + { + $sphinxTemplate = str_replace( '#infix_fields', 'infix_fields', $sphinxTemplate ); + $sphinxTemplate = str_replace( '#min_infix_len', 'min_infix_len', $sphinxTemplate ); + $sphinxTemplate = str_replace( '#enable_star', 'enable_star', $sphinxTemplate ); + } + } + else + { + $sphinxTemplate = 'MAIN SPHINX TEMPLATE IS EMPTY'; + } + } + else + { + $sphinxTemplate = 'MAIN SPHINX TEMPLATE NOT FOUND'; + } + + /* Return our data */ + return array( 'content' => $sphinxTemplate, 'deltas' => $sphinxIndexes ); + } + + /** + * Build the sphinx.conf file and return it for download + * + * @return @e void + */ + public function sphinxBuildConf() + { + /* Get sphinx data */ + $sphinxContent = $this->rebuildSphinxConfig(); + + /* Download */ + $this->cache->setCache( 'sphinx_config', time(), array( 'array' => 0 ) ); + $this->registry->output->showDownload( $sphinxContent['content'], 'sphinx.conf', '', 0 ); + } + + /** + * Build and return the cronjobs strings to rebuild the indexes + * + * @return @e void + */ + public function sphinxBuildCron() + { + /* Got a path? Get the data! */ + $sphinxData = empty( $this->request['sphinx_conf_path'] ) ? array() : $this->rebuildSphinxConfig(); + + /* Output */ + $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . '&do=sphinxBuildCron', $this->lang->words['sphinx_cronjob_title'] ); + $this->registry->output->html .= $this->html->sphinxConfForm( $sphinxData ); + } + /** * IN DEV Tool to rebuild all data via XML * - * @return void + * @return @e void */ - private function inDevRebuildAll() + protected function inDevRebuildAll() { + /* Not IN_DEV? */ + if ( ! IN_DEV ) + { + $this->applicationsOverview(); + return; + } + $output = array(); /* Do each app */ foreach( ipsRegistry::$applications as $app_dir => $data ) { $this->request['_app'] = $app_dir; - $return = $this->moduleImport('', 1, FALSE); + $return = $this->moduleImport( '', 1, FALSE ); $output[] = 'App - ' . $app_dir . " done: " . $return; /* In dev time stamp? */ if ( IN_DEV ) { $cache = $this->caches['indev']; - $cache['import']['modules'][ $app_dir ] = time(); + $cache['import']['modules'][$app_dir] = time(); $this->cache->setCache( 'indev', $cache, array( 'donow' => 1, 'array' => 1 ) ); } } @@ -303,7 +514,7 @@ class admin_core_applications_applications extends ipsCommand $this->applicationsMenuDataRecache(); $this->moduleRecache(); - $this->registry->output->global_message = implode( "
", $output ); + $this->registry->output->setMessage( implode( "
", $output ), 1 ); $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); } @@ -311,30 +522,39 @@ class admin_core_applications_applications extends ipsCommand /** * IN DEV Tool to rebuild all data via XML * - * @return void + * @return @e void */ - private function inDevExportAll() + protected function inDevExportAll() { + /* Not IN_DEV? */ + if ( ! IN_DEV ) + { + $this->applicationsOverview(); + return; + } + $output = array(); /* Do each app */ foreach( ipsRegistry::$applications as $app_dir => $data ) { - if ( ! is_writeable( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_modules.xml' ) ) + $file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_modules.xml'; + + if ( is_file( $file ) && ! is_writeable( $file ) ) { - $output[] = "Cannot write to " . IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_modules.xml'; + $output[] = "Cannot write to " . $file; continue; } $this->request['app_dir'] = $app_dir; $moduleXML = $this->moduleExport( 1 ); - file_put_contents( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_modules.xml', $moduleXML['xml'] ); + file_put_contents( $file, $moduleXML['xml'] ); $output[] = $app_dir . " modules exported"; } - $this->registry->output->global_message = implode( "
", $output ); + $this->registry->output->setMessage( implode( "
", $output ), 1 ); $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); } @@ -342,24 +562,24 @@ class admin_core_applications_applications extends ipsCommand /** * Remove a module * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function moduleRemove() + public function moduleRemove() { //-------------------------------------------- // INIT //-------------------------------------------- - $app_id = intval( $this->request['app_id'] ); - $sys_module_id = intval( $this->request['sys_module_id'] ); + + $app_id = intval( $this->request['app_id'] ); + $sys_module_id = intval( $this->request['sys_module_id'] ); //----------------------------------------- // Got an application? //----------------------------------------- - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id=' . $app_id ) ); + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); if ( ! $application['app_id'] ) { @@ -372,10 +592,9 @@ class admin_core_applications_applications extends ipsCommand // Got a module? //----------------------------------------- - $module = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_sys_module', - 'where' => 'sys_module_id='.$sys_module_id ) ); + $module = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => 'sys_module_id=' . $sys_module_id ) ); + if ( ! $module['sys_module_id'] ) { $this->registry->output->global_message = $this->lang->words['a_noid']; @@ -387,6 +606,7 @@ class admin_core_applications_applications extends ipsCommand // Protected? //----------------------------------------- + if ( ! IN_DEV and $module['sys_module_protected'] ) { $this->registry->output->global_message = $this->lang->words['a_protectedmod']; @@ -398,21 +618,24 @@ class admin_core_applications_applications extends ipsCommand // Remove... //----------------------------------------- - $this->DB->delete( 'core_sys_module', 'sys_module_id='.$sys_module_id ); + + $this->DB->delete( 'core_sys_module', 'sys_module_id=' . $sys_module_id ); //----------------------------------------- // Recache //----------------------------------------- + $this->moduleRecache(); //----------------------------------------- // Done... //----------------------------------------- + $this->registry->output->global_message = $this->lang->words['a_removed']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id='.$app_id.'&sys_module_admin=' . $module['sys_module_admin'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id=' . $app_id . '&sys_module_admin=' . $module['sys_module_admin'] ); } /** @@ -420,51 +643,56 @@ class admin_core_applications_applications extends ipsCommand * * @param string [Optional] XML content * @param integer IN_DEV override - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - public function moduleImport( $content='', $in_dev=0, $return=TRUE ) + public function moduleImport( $content = '', $in_dev = 0, $return = TRUE ) { //----------------------------------------- // INIT //----------------------------------------- - $updated = 0; - $inserted = 0; - $modules = array(); - $apps = array(); - $app_id = 0; - $app_dir = ''; + + $updated = 0; + $inserted = 0; + $modules = array(); + $apps = array(); + $app_id = 0; + $app_dir = ''; //----------------------------------------- // Got content? //----------------------------------------- + if ( ! $content ) { //----------------------------------------- // INDEV? //----------------------------------------- + if ( $in_dev ) { - $_FILES['FILE_UPLOAD']['name'] = ''; - $this->request['file_location'] = IPSLib::getAppDir( $this->request['_app'] ) . '/xml/' . $this->request['_app'] . '_modules.xml'; + $_FILES['FILE_UPLOAD']['name'] = ''; + $this->request['file_location'] = IPSLib::getAppDir( $this->request['_app'] ) . '/xml/' . $this->request['_app'] . '_modules.xml'; } else { - $this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location'] ; + $this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location']; } //----------------------------------------- // Uploaded file? //----------------------------------------- - - if ( $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ($_FILES['FILE_UPLOAD']['name'] == "none") ) + + + if ( ! isset( $_FILES['FILE_UPLOAD']['name'] ) or $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ! $_FILES['FILE_UPLOAD']['size'] or ( $_FILES['FILE_UPLOAD']['name'] == "none" ) ) { //----------------------------------------- // check and load from server //----------------------------------------- - + + if ( ! $this->request['file_location'] ) { if ( $return ) @@ -478,8 +706,8 @@ class admin_core_applications_applications extends ipsCommand return 'Nothing to import'; } } - - if ( ! file_exists( $this->request['file_location'] ) ) + + if ( ! is_file( $this->request['file_location'] ) ) { if ( $return ) { @@ -492,8 +720,8 @@ class admin_core_applications_applications extends ipsCommand return 'Nothing to import'; } } - - if ( preg_match( "#\.gz$#", $this->request['file_location'] ) ) + + if ( preg_match( '#\.gz$#', $this->request['file_location'] ) ) { if ( $FH = @gzopen( $this->request['file_location'], 'rb' ) ) { @@ -501,7 +729,7 @@ class admin_core_applications_applications extends ipsCommand { $content .= @gzread( $FH, 1024 ); } - + @gzclose( $FH ); } } @@ -509,7 +737,7 @@ class admin_core_applications_applications extends ipsCommand { if ( $FH = @fopen( $this->request['file_location'], 'rb' ) ) { - $content = @fread( $FH, filesize($this->request['file_location']) ); + $content = @fread( $FH, filesize( $this->request['file_location'] ) ); @fclose( $FH ); } } @@ -519,60 +747,59 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Get uploaded schtuff //----------------------------------------- - + + $tmp_name = $_FILES['FILE_UPLOAD']['name']; - $tmp_name = preg_replace( "#\.gz$#", "", $tmp_name ); - - $content = ipsRegistry::getClass('adminFunctions')->importXml( $tmp_name ); + $tmp_name = preg_replace( '#\.gz$#', "", $tmp_name ); + + $content = ipsRegistry::getClass( 'adminFunctions' )->importXml( $tmp_name ); } } - + //----------------------------------------- // Get current applications //----------------------------------------- + - $this->DB->build( array( 'select' => 'app_id, app_directory', - 'from' => 'core_applications', - 'order' => 'app_id' ) ); - + $this->DB->build( array( 'select' => 'app_id, app_directory', 'from' => 'core_applications', 'order' => 'app_id' ) ); $this->DB->execute(); - + while ( $r = $this->DB->fetch() ) { - $apps[ $r['app_directory'] ] = $r['app_id']; + $apps[$r['app_directory']] = $r['app_id']; } - + //----------------------------------------- // Get current modules //----------------------------------------- - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_module', - 'order' => 'sys_module_id' ) ); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'order' => 'sys_module_id' ) ); $this->DB->execute(); while ( $r = $this->DB->fetch() ) { - $modules[ $r['sys_module_application'] ][ intval( $r['sys_module_admin'] ) . '-' . $r['sys_module_key'] ] = $r['sys_module_id']; + $modules[$r['sys_module_application']][intval( $r['sys_module_admin'] ) . '-' . $r['sys_module_key']] = $r['sys_module_id']; } //----------------------------------------- // Continue //----------------------------------------- - require_once( IPS_KERNEL_PATH . 'classXML.php' ); - $xml = new classXML( IPS_DOC_CHAR_SET ); + require_once ( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + $xml->loadXML( $content ); //----------------------------------------- // pArse //----------------------------------------- - $fields = array( 'sys_module_title' , 'sys_module_application', 'sys_module_key' , 'sys_module_description', 'sys_module_version', - 'sys_module_protected', 'sys_module_visible' , 'sys_module_position', 'sys_module_admin' ); + $fields = array( 'sys_module_title', 'sys_module_application', 'sys_module_key', 'sys_module_description', 'sys_module_version', 'sys_module_protected', 'sys_module_visible', 'sys_module_position', 'sys_module_admin' ); + foreach( $xml->fetchElements( 'module' ) as $xmlelement ) { $data = $xml->fetchElementsFromRecord( $xmlelement ); @@ -581,31 +808,34 @@ class admin_core_applications_applications extends ipsCommand { if ( ! in_array( $k, $fields ) ) { - unset( $data[ $k ] ); + unset( $data[$k] ); } } - + $app_dir = $data['sys_module_application']; - $_key = intval( $data['sys_module_admin'] ) . '-' . $data['sys_module_key']; + $_key = intval( $data['sys_module_admin'] ) . '-' . $data['sys_module_key']; //----------------------------------------- // Insert, or update... //----------------------------------------- - if ( $apps[ $app_dir ] ) + + if ( $apps[$app_dir] ) { //----------------------------------------- // Insert or update? //----------------------------------------- - - if ( $modules[ $app_dir ][ $_key ] ) + + + if ( $modules[$app_dir][$_key] ) { //----------------------------------------- // Update //----------------------------------------- - - $updated++; - $this->DB->update( 'core_sys_module', $data, "sys_module_id=" . $modules[ $data['sys_module_application'] ][ $_key ] ); + + + $updated ++; + $this->DB->update( 'core_sys_module', $data, "sys_module_id=" . $modules[$data['sys_module_application']][$_key] ); } else @@ -613,28 +843,31 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Insert //----------------------------------------- - - $inserted++; + + + $inserted ++; $this->DB->insert( 'core_sys_module', $data ); } } } - + //----------------------------------------- // Done... //----------------------------------------- + if ( $return ) { $this->registry->output->global_message = sprintf( $this->lang->words['a_insertupdated'], $inserted, $updated ); - + //----------------------------------------- // Recache //----------------------------------------- - + + $this->moduleRecache(); - - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id=' . $apps[ $app_dir ] ); + + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id=' . $apps[$app_dir] ); } else { @@ -648,31 +881,29 @@ class admin_core_applications_applications extends ipsCommand * @param integer Return the XML [1] or print to browser [0] * @return mixed XML content or outputs to screen */ - public function moduleExport( $return_xml=0 ) + public function moduleExport( $return_xml = 0 ) { //----------------------------------------- // INIT //----------------------------------------- - $app_id = intval( $this->request['app_id'] ); + + $app_id = intval( $this->request['app_id'] ); $app_dir = trim( IPSText::alphanumericalClean( $this->request['app_dir'] ) ); - $xml = ''; + $xml = ''; //----------------------------------------- // Get application //----------------------------------------- + if ( $app_id ) { - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id='.$app_id ) ); + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); } else if ( $app_dir ) { - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => "app_directory='" . $app_dir . "'") ); + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => "app_directory='" . $app_dir . "'" ) ); } if ( ! $application['app_id'] ) @@ -686,7 +917,8 @@ class admin_core_applications_applications extends ipsCommand // Get xml mah-do-dah //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + + require_once ( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->newXMLDocument(); @@ -694,18 +926,17 @@ class admin_core_applications_applications extends ipsCommand // Start... //----------------------------------------- + $xml->addElement( 'moduleexport' ); //----------------------------------------- // Get applications //----------------------------------------- + $xml->addElement( 'modulegroup', 'moduleexport' ); - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_module', - 'where' => "sys_module_application='".$application['app_directory']."'", - 'order' => 'sys_module_admin, sys_module_position' ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => "sys_module_application='" . $application['app_directory'] . "'", 'order' => 'sys_module_admin, sys_module_position' ) ); $this->DB->execute(); while ( $r = $this->DB->fetch() ) @@ -714,12 +945,12 @@ class admin_core_applications_applications extends ipsCommand $xml->addElementAsRecord( 'modulegroup', 'module', $r ); } - - if( $return_xml ) + + if ( $return_xml ) { return array( 'title' => $application['app_directory'] . '_modules.xml', 'xml' => $xml->fetchDocument() ); } - else + else { $this->registry->output->showDownload( $xml->fetchDocument(), $application['app_directory'] . '_modules.xml', '', 0 ); } @@ -729,32 +960,32 @@ class admin_core_applications_applications extends ipsCommand * Save a module * * @param string Type [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function moduleSave( $type='add' ) + public function moduleSave( $type = 'add' ) { //-------------------------------------------- // INIT //-------------------------------------------- - $app_id = intval( $this->request['app_id'] ); - $sys_module_admin = intval( $this->request['sys_module_admin'] ); - $sys_module_id = intval( $this->request['sys_module_id'] ); - $sys_module_title = trim( $this->request['sys_module_title'] ); - $sys_module_key = IPSText::alphanumericalClean( trim( $this->request['sys_module_key'] ) ); + + $app_id = intval( $this->request['app_id'] ); + $sys_module_admin = intval( $this->request['sys_module_admin'] ); + $sys_module_id = intval( $this->request['sys_module_id'] ); + $sys_module_title = trim( $this->request['sys_module_title'] ); + $sys_module_key = IPSText::alphanumericalClean( trim( $this->request['sys_module_key'] ) ); $sys_module_description = trim( $this->request['sys_module_description'] ); - $sys_module_version = trim( $this->request['sys_module_version'] ); - $sys_module_protected = intval( $this->request['sys_module_protected'] ); - $sys_module_visible = intval( $this->request['sys_module_visible'] ); - $application = array(); + $sys_module_version = trim( $this->request['sys_module_version'] ); + $sys_module_protected = intval( $this->request['sys_module_protected'] ); + $sys_module_visible = intval( $this->request['sys_module_visible'] ); + $application = array(); //----------------------------------------- // Got an application? //----------------------------------------- - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id='.$app_id ) ); + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); if ( ! $application['app_id'] ) { @@ -767,12 +998,11 @@ class admin_core_applications_applications extends ipsCommand // Check //-------------------------------------------- + if ( $type == 'edit' ) { - $module = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_sys_module', - 'where' => 'sys_module_id='.$sys_module_id ) ); - + $module = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => 'sys_module_id=' . $sys_module_id ) ); + if ( ! $module['sys_module_id'] ) { $this->registry->output->global_message = $this->lang->words['a_noid']; @@ -786,24 +1016,24 @@ class admin_core_applications_applications extends ipsCommand // Make sure that we don't have a key already //----------------------------------------- - $test = $this->DB->buildAndFetch( array( 'select' => 'sys_module_id', - 'from' => 'core_sys_module', - 'where' => "sys_module_key='".$sys_module_key."' AND sys_module_application='".$application['app_directory']."' AND sys_module_admin=".$sys_module_admin ) ); - + + $test = $this->DB->buildAndFetch( array( 'select' => 'sys_module_id', 'from' => 'core_sys_module', 'where' => "sys_module_key='" . $sys_module_key . "' AND sys_module_application='" . $application['app_directory'] . "' AND sys_module_admin=" . $sys_module_admin ) ); + if ( $test['sys_module_id'] ) { $this->registry->output->global_message = sprintf( $this->lang->words['a_already'], $sys_module_key ); $this->modules_overview(); return; } - + } //----------------------------------------- // Form checks... //----------------------------------------- - if ( ! $sys_module_title OR ! $sys_module_key ) + + if ( ! $sys_module_title or ! $sys_module_key ) { $this->registry->output->global_message = $this->lang->words['a_titlekey']; $this->moduleForm( $type ); @@ -814,18 +1044,14 @@ class admin_core_applications_applications extends ipsCommand // Check... //-------------------------------------------- - $array = array( 'sys_module_title' => $sys_module_title, - 'sys_module_application' => $application['app_directory'], - 'sys_module_key' => $sys_module_key, - 'sys_module_description' => $sys_module_description, - 'sys_module_version' => $sys_module_version, - 'sys_module_visible' => $sys_module_visible, - 'sys_module_admin' => $sys_module_admin ); + + $array = array( 'sys_module_title' => $sys_module_title, 'sys_module_application' => $application['app_directory'], 'sys_module_key' => $sys_module_key, 'sys_module_description' => $sys_module_description, 'sys_module_version' => $sys_module_version, 'sys_module_visible' => $sys_module_visible, 'sys_module_admin' => $sys_module_admin ); //----------------------------------------- // IN DEV? //----------------------------------------- + if ( IN_DEV ) { $array['sys_module_protected'] = $sys_module_protected; @@ -835,18 +1061,19 @@ class admin_core_applications_applications extends ipsCommand // Save... //----------------------------------------- + if ( $type == 'add' ) { - $max = $this->DB->buildAndFetch( array( 'select' => 'MAX(sys_module_position) as position', 'from' => 'core_sys_module' ) ); + $max = $this->DB->buildAndFetch( array( 'select' => 'MAX(sys_module_position) as position', 'from' => 'core_sys_module' ) ); - $array['sys_module_position'] = $max['position'] + 1; + $array['sys_module_position'] = $max['position'] + 1; $this->DB->insert( 'core_sys_module', $array ); $this->registry->output->global_message = $this->lang->words['a_added']; } else { - $this->DB->update( 'core_sys_module', $array, 'sys_module_id='.$sys_module_id ); + $this->DB->update( 'core_sys_module', $array, 'sys_module_id=' . $sys_module_id ); $this->registry->output->global_message = $this->lang->words['a_edited']; } @@ -854,43 +1081,45 @@ class admin_core_applications_applications extends ipsCommand // Recache //----------------------------------------- + $this->moduleRecache(); //----------------------------------------- // List... //----------------------------------------- - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id='.$app_id.'&sys_module_admin='.$sys_module_admin ); + + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id=' . $app_id . '&sys_module_admin=' . $sys_module_admin ); } /** * Add/Edit module form * * @param string Type [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function moduleForm( $type='add' ) + public function moduleForm( $type = 'add' ) { //----------------------------------------- // INIT //----------------------------------------- + $sys_module_admin = intval( $this->request['sys_module_admin'] ); - $sys_module_id = intval( $this->request['sys_module_id'] ); - $app_id = intval( $this->request['app_id'] ); - $module = array( 'sys_module_admin' => $sys_module_admin ); - $modules = array( 'root' => array() ); - $application = array(); - $form = array(); - $module_type = array( 0 => array( 0, $this->lang->words['a_public'] ), 1 => array( 1, $this->lang->words['a_admin'] ) ); + $sys_module_id = intval( $this->request['sys_module_id'] ); + $app_id = intval( $this->request['app_id'] ); + $module = array( 'sys_module_admin' => $sys_module_admin ); + $modules = array( 'root' => array() ); + $application = array(); + $form = array(); + $module_type = array( 0 => array( 0, $this->lang->words['a_public'] ), 1 => array( 1, $this->lang->words['a_admin'] ) ); //----------------------------------------- // Get application //----------------------------------------- - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id='.$app_id ) ); + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); if ( ! $application['app_id'] ) { @@ -898,23 +1127,22 @@ class admin_core_applications_applications extends ipsCommand $this->applicationsOverview(); return; } - + //----------------------------------------- // Add or edit? //----------------------------------------- + if ( $type == 'add' ) { $formcode = 'module_add_do'; - $title = $this->lang->words['addnewmodule_apps']; - $button = $this->lang->words['addnewmodule_apps']; + $title = $this->lang->words['addnewmodule_apps']; + $button = $this->lang->words['addnewmodule_apps']; } else { - $module = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_sys_module', - 'where' => 'sys_module_id='.$sys_module_id ) ); - + $module = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => 'sys_module_id=' . $sys_module_id ) ); + if ( ! $module['sys_module_id'] ) { $this->registry->output->global_message = $this->lang->words['a_noid']; @@ -923,27 +1151,29 @@ class admin_core_applications_applications extends ipsCommand } $sys_module_admin = $module['sys_module_admin']; - $formcode = 'module_edit_do'; - $title = $this->lang->words['a_editmod'] . $module['sys_module_title']; - $button = $this->lang->words['a_savechanges']; + $formcode = 'module_edit_do'; + $title = $this->lang->words['a_editmod'] . $module['sys_module_title']; + $button = $this->lang->words['a_savechanges']; } //----------------------------------------- // Form elements //----------------------------------------- - $form['sys_module_title'] = $this->registry->output->formInput( 'sys_module_title' , $_POST['sys_module_title'] ? $_POST['sys_module_title'] : $module['sys_module_title'] ); - $form['sys_module_description'] = $this->registry->output->formInput( 'sys_module_description', $_POST['sys_module_description'] ? $_POST['sys_module_description'] : $module['sys_module_description'] ); - $form['sys_module_key'] = $this->registry->output->formInput( 'sys_module_key' , $_POST['sys_module_key'] ? $_POST['sys_module_key'] : $module['sys_module_key'] ); - $form['sys_module_version'] = $this->registry->output->formInput( 'sys_module_version' , $_POST['sys_module_version'] ? $_POST['sys_module_version'] : $module['sys_module_version'] ); - $form['sys_module_protected'] = $this->registry->output->formYesNo( 'sys_module_protected' , $_POST['sys_module_protected'] ? $_POST['sys_module_protected'] : $module['sys_module_protected'] ); - $form['sys_module_visible'] = $this->registry->output->formYesNo( 'sys_module_visible' , $_POST['sys_module_visible'] ? $_POST['sys_module_visible'] : $module['sys_module_visible'] ); - $form['sys_module_admin'] = $this->registry->output->formDropdown( 'sys_module_admin' , $module_type, $_POST['sys_module_admin'] ? $_POST['sys_module_admin'] : $module['sys_module_admin'] ); + + $form['sys_module_title'] = $this->registry->output->formInput( 'sys_module_title', $_POST['sys_module_title'] ? $_POST['sys_module_title'] : $module['sys_module_title'] ); + $form['sys_module_description'] = $this->registry->output->formInput( 'sys_module_description', $_POST['sys_module_description'] ? $_POST['sys_module_description'] : $module['sys_module_description'] ); + $form['sys_module_key'] = $this->registry->output->formInput( 'sys_module_key', $_POST['sys_module_key'] ? $_POST['sys_module_key'] : $module['sys_module_key'] ); + $form['sys_module_version'] = $this->registry->output->formInput( 'sys_module_version', $_POST['sys_module_version'] ? $_POST['sys_module_version'] : $module['sys_module_version'] ); + $form['sys_module_protected'] = $this->registry->output->formYesNo( 'sys_module_protected', $_POST['sys_module_protected'] ? $_POST['sys_module_protected'] : $module['sys_module_protected'] ); + $form['sys_module_visible'] = $this->registry->output->formYesNo( 'sys_module_visible', $_POST['sys_module_visible'] ? $_POST['sys_module_visible'] : $module['sys_module_visible'] ); + $form['sys_module_admin'] = $this->registry->output->formDropdown( 'sys_module_admin', $module_type, $_POST['sys_module_admin'] ? $_POST['sys_module_admin'] : $module['sys_module_admin'] ); //----------------------------------------- // Nav //----------------------------------------- + $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . '&do=modules_overview&app_id=' . $application['app_id'] . '&sys_module_admin=' . $module['sys_module_admin'], $application['app_title'] ); $this->registry->output->html .= $this->html->module_form( $form, $title, $formcode, $button, $module, $application ); @@ -952,61 +1182,64 @@ class admin_core_applications_applications extends ipsCommand /** * Move a module up/down * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function moduleManagePosition() + public function moduleManagePosition() { - $app_id = intval( $this->request['app_id'] ); + $app_id = intval( $this->request['app_id'] ); //----------------------------------------- // INIT //----------------------------------------- + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); - $ajax = new $classToLoad(); + $ajax = new $classToLoad(); //----------------------------------------- // Checks... //----------------------------------------- + - if( !$app_id ) + if ( ! $app_id ) { $ajax->returnString( $this->lang->words['postform_badmd5'] ); exit(); } - if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) + if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) { $ajax->returnString( $this->lang->words['postform_badmd5'] ); exit(); } - - //----------------------------------------- - // Save new position - //----------------------------------------- + + //----------------------------------------- + // Save new position + //----------------------------------------- + - $position = 1; - - if( is_array($this->request['modules']) AND count($this->request['modules']) ) - { - foreach( $this->request['modules'] as $this_id ) - { - $this->DB->update( 'core_sys_module', array( 'sys_module_position' => $position ), 'sys_module_id=' . $this_id ); - - $position++; - } - } - - $this->moduleRecache(); - - $ajax->returnString( 'OK' ); - exit(); + $position = 1; + + if ( is_array( $this->request['modules'] ) and count( $this->request['modules'] ) ) + { + foreach( $this->request['modules'] as $this_id ) + { + $this->DB->update( 'core_sys_module', array( 'sys_module_position' => $position ), 'sys_module_id=' . $this_id ); + + $position ++; + } + } + + $this->moduleRecache(); + + $ajax->returnString( 'OK' ); + exit(); } /** * Recache modules * - * @return void + * @return @e void */ public function moduleRecache() { @@ -1015,19 +1248,13 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Load known modules //----------------------------------------- + - $this->DB->build( array( 'select' => 'm.*', - 'from' => array( 'core_sys_module' => 'm' ), - 'where' => 'm.sys_module_visible=1', - 'order' => 'a.app_position, m.sys_module_position ASC', - 'add_join' => array( 0 => array( 'select' => 'a.*', - 'from' => array( 'core_applications' => 'a' ), - 'where' => 'm.sys_module_application=a.app_directory', - 'type' => 'inner' ) ) ) ); - + $this->DB->build( array( 'select' => 'm.*', 'from' => array( 'core_sys_module' => 'm' ), 'where' => 'm.sys_module_visible=1', 'order' => 'a.app_position, m.sys_module_position ASC', 'add_join' => array( array( 'select' => 'a.*', 'from' => array( 'core_applications' => 'a' ), 'where' => 'm.sys_module_application=a.app_directory', 'type' => 'inner' ) ) ) ); + $this->DB->execute(); - - while( $row = $this->DB->fetch() ) + + while ( $row = $this->DB->fetch() ) { $_row = array(); @@ -1035,31 +1262,31 @@ class admin_core_applications_applications extends ipsCommand { if ( strpos( $k, "sys_" ) === 0 ) { - $_row[ $k ] = $v; + $_row[$k] = $v; } } - $modules[ $row['sys_module_application'] ][] = $_row; + $modules[$row['sys_module_application']][] = $_row; } - + $this->cache->setCache( 'module_cache', $modules, array( 'array' => 1 ) ); } /** * Recache apps, modules and menus * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - public function moduleRecacheAll( $return=0 ) + public function moduleRecacheAll( $return = 0 ) { $this->applicationsRecache(); $this->applicationsMenuDataRecache(); $this->moduleRecache(); - if( ! $return ) + if ( ! $return ) { $this->registry->output->global_message = $this->lang->words['a_recachecomplete']; - + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); } } @@ -1067,31 +1294,30 @@ class admin_core_applications_applications extends ipsCommand /** * View al module * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function modules_overview() + public function modules_overview() { //----------------------------------------- // INIT //----------------------------------------- - $sys_module_admin = intval( $this->request['sys_module_admin'] ); - $app_id = intval( $this->request['app_id'] ); - $application = array(); - $modules = array(); - $_modules = array(); - $_parents = array(); - $seen_count = 0; - $_modules_admin = ( $sys_module_admin ) ? 'modules_admin' : 'modules_public'; + + $sys_module_admin = intval( $this->request['sys_module_admin'] ); + $app_id = intval( $this->request['app_id'] ); + $application = array(); + $modules = array(); + $_modules = array(); + $_parents = array(); + $_modules_admin = ( $sys_module_admin ) ? 'modules_admin' : 'modules_public'; //----------------------------------------- // Get application //----------------------------------------- - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id='.$app_id ) ); - + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); + if ( ! $application['app_id'] ) { $this->registry->output->global_message = $this->lang->words['a_noid']; @@ -1103,102 +1329,98 @@ class admin_core_applications_applications extends ipsCommand // Get modules //----------------------------------------- - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_module', - 'where' => "sys_module_application='".$application['app_directory']."' AND sys_module_admin=".$sys_module_admin, - 'order' => 'sys_module_position ASC' ) ); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => "sys_module_application='" . $application['app_directory'] . "' AND sys_module_admin=" . $sys_module_admin, 'order' => 'sys_module_position ASC' ) ); $this->DB->execute(); - while( $row = $this->DB->fetch() ) + while ( $row = $this->DB->fetch() ) { //----------------------------------------- // Enabled? //----------------------------------------- - $row['_sys_module_visible'] = ( $row['sys_module_visible'] ) ? 'tick.png' : 'cross.png'; - //----------------------------------------- - // Exists... - //----------------------------------------- - - if ( ! file_exists( IPSLib::getAppDir( $application['app_directory'] ) . '/'. $_modules_admin . '/'. $row['sys_module_key'] ) ) - { - $row['_missing'] = 1; - } + $row['_sys_module_visible'] = ( $row['sys_module_visible'] ) ? 'tick.png' : 'cross.png'; //----------------------------------------- // Add to row //----------------------------------------- - $_modules[ $row['sys_module_id'] ] = $row; - - $_parents[ $row['sys_module_id'] ] = $row['sys_module_id']; - } + $_modules[$row['sys_module_id']] = $row; + + $_parents[$row['sys_module_id']] = $row['sys_module_id']; + } + //----------------------------------------- // Loop... //----------------------------------------- + foreach( $_parents as $_sys_module_id => $sys_module_id ) { - $row = $_modules[ $_sys_module_id ]; - - $seen_count++; + $row = $_modules[$_sys_module_id]; //----------------------------------------- // Add to row //----------------------------------------- + $modules[] = $row; } - + //----------------------------------------- // List 'em //----------------------------------------- + $this->registry->output->html .= $this->html->modules_list( $modules, $application, $sys_module_admin ); } /** * Remove an application (confirm screen) * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function applicationRemoveSplash() + public function applicationRemoveSplash() { //-------------------------------------------- // INIT //-------------------------------------------- + $app_id = intval( $this->request['app_id'] ); //----------------------------------------- // Got an application? //----------------------------------------- - $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id='.$app_id ) ); + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); - $this->registry->output->html .= $this->html->application_remove_splash( $application ); + $this->registry->output->html .= $this->html->application_remove_splash( $application ); } /** * Remove an application * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function applicationRemove() + public function applicationRemove() { //-------------------------------------------- // INIT //-------------------------------------------- + $app_id = intval( $this->request['app_id'] ); //----------------------------------------- // Got an application? //----------------------------------------- - $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id='.$app_id ) ); + + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); if ( ! $application['app_id'] ) { @@ -1211,45 +1433,48 @@ class admin_core_applications_applications extends ipsCommand // Protected? //----------------------------------------- + if ( ! IN_DEV and $application['app_protected'] ) { $this->registry->output->global_message = $this->lang->words['a_protectapp']; $this->applicationsOverview(); return; } - + //----------------------------------------- // Remove Settings //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_app='{$application['app_directory']}'" ) ); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_app='{$application['app_directory']}'" ) ); $this->DB->execute(); $conf_title_id = array(); - while( $r = $this->DB->fetch() ) + + while ( $r = $this->DB->fetch() ) { $conf_title_id[] = $r['conf_title_id']; } - if( count( $conf_title_id ) ) + if ( count( $conf_title_id ) ) { $this->DB->delete( 'core_sys_conf_settings', 'conf_group IN(' . implode( ',', $conf_title_id ) . ')' ); } $this->DB->delete( 'core_sys_settings_titles', "conf_title_app='{$application['app_directory']}'" ); - + //----------------------------------------- // Remove Application Caches //----------------------------------------- - $_file = IPSLib::getAppDir( $application['app_directory'] ).'/extensions/coreVariables.php'; + + $_file = IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/coreVariables.php'; - if ( file_exists( $_file ) ) + if ( is_file( $_file ) ) { $CACHE = array(); - require( $_file ); + require ( $_file );/*noLibHook*/ - if ( is_array( $CACHE ) AND count( $CACHE ) ) + if ( is_array( $CACHE ) and count( $CACHE ) ) { foreach( $CACHE as $key => $data ) { @@ -1261,23 +1486,25 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Remove tables //----------------------------------------- + $_file = IPSLib::getAppDir( $application['app_directory'] ) . '/setup/versions/install/sql/' . $application['app_directory'] . '_' . ipsRegistry::dbFunctions()->getDriverType() . '_tables.php'; - - if( file_exists( $_file ) ) + + if ( is_file( $_file ) ) { $TABLE = array(); - require( $_file ); - + require ( $_file );/*noLibHook*/ + foreach( $TABLE as $q ) { //----------------------------------------- // Capture create tables first //----------------------------------------- + preg_match( "/CREATE TABLE (\S+)(\s)?\(/", $q, $match ); - if( $match[1] ) + if ( $match[1] ) { $this->DB->dropTable( preg_replace( '#^' . ipsRegistry::dbFunctions()->getPrefix() . "(\S+)#", "\\1", $match[1] ) ); } @@ -1287,9 +1514,10 @@ class admin_core_applications_applications extends ipsCommand // Then capture alter tables //----------------------------------------- + preg_match( "/ALTER TABLE (\S+)\sADD\s(\S+)\s/i", $q, $match ); - if( $match[1] AND $match[2] ) + if ( $match[1] and $match[2] ) { $this->DB->dropField( preg_replace( '#^' . ipsRegistry::dbFunctions()->getPrefix() . "(\S+)#", "\\1", $match[1] ), $match[2] ); } @@ -1300,92 +1528,161 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Check for uninstall sql //----------------------------------------- + /* Any "extra" configs required for this driver? */ - if( file_exists( IPS_ROOT_PATH . 'setup/sql/' . $this->settings['sql_driver'] . '_install.php' ) ) + if ( is_file( IPS_ROOT_PATH . 'setup/sql/' . $this->settings['sql_driver'] . '_install.php' ) ) { - require_once( IPS_ROOT_PATH . 'setup/sql/' . $this->settings['sql_driver'] . '_install.php' ); - + require_once ( IPS_ROOT_PATH . 'setup/sql/' . $this->settings['sql_driver'] . '_install.php' );/*noLibHook*/ + $extra_install = new install_extra( $this->registry ); } - $_file = IPSLib::getAppDir( $application['app_directory'] ) . '/setup/versions/install/sql/' . $application['app_directory'] . '_' . ipsRegistry::dbFunctions()->getDriverType() . '_uninstall.php'; + $_file = IPSLib::getAppDir( $application['app_directory'] ) . '/setup/versions/install/sql/' . $application['app_directory'] . '_' . ipsRegistry::dbFunctions()->getDriverType() . '_uninstall.php'; - if( file_exists( $_file ) ) + if ( is_file( $_file ) ) { $QUERY = array(); - require( $_file ); + require ( $_file );/*noLibHook*/ - if ( is_array( $QUERY ) AND count( $QUERY ) ) - { + if ( is_array( $QUERY ) and count( $QUERY ) ) + { foreach( $QUERY as $q ) { - if ( $extra_install AND method_exists( $extra_install, 'process_query_create' ) ) + if ( $extra_install and method_exists( $extra_install, 'process_query_create' ) ) { - $q = $extra_install->process_query_create( $q ); + $q = $extra_install->process_query_create( $q ); } $this->DB->query( $q ); } } - } + } //----------------------------------------- // Remove Misc Stuff //----------------------------------------- - $this->DB->delete( 'core_sys_lang_words' , "word_app='{$application['app_directory']}'" ); - $this->DB->delete( 'task_manager' , "task_application='{$application['app_directory']}'" ); - $this->DB->delete( 'permission_index' , "app='{$application['app_directory']}'" ); - $this->DB->delete( 'reputation_index' , "app='{$application['app_directory']}'" ); - $this->DB->delete( 'tags_index' , "app='{$application['app_directory']}'" ); - $this->DB->delete( 'faq' , "app='{$application['app_directory']}'" ); - $this->DB->delete( 'custom_bbcode' , "bbcode_app='{$application['app_directory']}'" ); + $this->DB->delete( 'core_sys_lang_words', "word_app='{$application['app_directory']}'" ); + $this->DB->delete( 'task_manager', "task_application='{$application['app_directory']}'" ); + $this->DB->delete( 'permission_index', "app='{$application['app_directory']}'" ); + $this->DB->delete( 'reputation_index', "app='{$application['app_directory']}'" ); + $this->DB->delete( 'reputation_cache', "app='{$application['app_directory']}'" ); + $this->DB->delete( 'tags_index', "app='{$application['app_directory']}'" ); + $this->DB->delete( 'faq', "app='{$application['app_directory']}'" ); + $this->DB->delete( 'custom_bbcode', "bbcode_app='{$application['app_directory']}'" ); + $this->DB->delete( 'upgrade_history', "upgrade_app='{$application['app_directory']}'" ); + $this->DB->delete( 'core_like_cache', "like_cache_app='{$application['app_directory']}'" ); + $this->DB->delete( 'core_like', "like_app='{$application['app_directory']}'" ); + $this->DB->delete( 'core_item_markers', "item_app='{$application['app_directory']}'" ); + + //----------------------------------------- + // Report center.. + //----------------------------------------- + + $plugin = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'rc_classes', 'where' => "app='{$application['app_directory']}'" ) ); + + if ( $plugin['com_id'] ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'rc_reports_index', 'where' => 'rc_class=' . $plugin['com_id'] ) ); + $outer = $this->DB->execute(); + + while ( $r = $this->DB->fetch( $outer ) ) + { + $this->DB->delete( 'rc_reports', "rid=" . $r['id'] ); + $this->DB->delete( 'rc_comments', "rid=" . $r['id'] ); + } + + $this->DB->delete( 'rc_reports_index', 'rc_class=' . $plugin['com_id'] ); + } + + //----------------------------------------- + // Attachments + //----------------------------------------- + + $_plugins = array(); + + try + { + foreach( new DirectoryIterator( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/attachments/' ) as $file ) + { + if ( ! $file->isDot() && $file->isFile() ) + { + if ( preg_match( "/^plugin_(.+?)\.php$/", $file->getFileName(), $matches ) ) + { + $_plugins[] = $matches[1]; + } + } + } + + if ( count( $_plugins ) ) + { + foreach( $_plugins as $_plugin ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='{$_plugin}'" ) ); + $outer = $this->DB->execute(); + + while ( $r = $this->DB->fetch( $outer ) ) + { + if ( is_file( $this->settings['upload_dir'] . "/" . $r['attach_location'] ) ) + { + @unlink( $this->settings['upload_dir'] . "/" . $r['attach_location'] ); + } + } + + $this->DB->delete( 'attachments', "attach_rel_module='{$_plugin}'" ); + } + } + } + catch( Exception $e ) + { + } + //----------------------------------------- // Get all hook files //----------------------------------------- - - if( is_dir( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/hooks' ) ) + + if ( is_dir( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/hooks' ) ) { - $files = scandir( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/hooks' ); - $hooks = array(); + $files = scandir( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/hooks' ); + $hooks = array(); - require_once( IPS_KERNEL_PATH . 'classXML.php' ); - $xml = new classXML( IPS_DOC_CHAR_SET ); + require_once ( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); - if( count($files) AND is_array($files) ) + if ( count( $files ) and is_array( $files ) ) { foreach( $files as $_hookFile ) { - if( $_hookFile != '.' AND $_hookFile != '..' AND preg_match( "/(\.xml)$/", $_hookFile ) ) + if ( $_hookFile != '.' and $_hookFile != '..' and preg_match( "/(\.xml)$/", $_hookFile ) ) { $xml->loadXML( file_get_contents( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/hooks/' . $_hookFile ) ); - - foreach( $xml->fetchElements('config') as $data ) + + foreach( $xml->fetchElements( 'config' ) as $data ) { - $config = $xml->fetchElementsFromRecord( $data ); - - if( !count($config) ) + $config = $xml->fetchElementsFromRecord( $data ); + + if ( ! count( $config ) ) { continue; } else { - $hooks[] = $config['hook_key']; + $hooks[] = $config['hook_key']; } } } } } - if( count($hooks) ) + if ( count( $hooks ) ) { foreach( $hooks as $hook ) { - $hook = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => "hook_key='" . $hook . "'" ) ); + $hook = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => "hook_key='" . $hook . "'" ) ); - if( ! $hook['hook_id'] ) + if ( ! $hook['hook_id'] ) { continue; } @@ -1396,7 +1693,7 @@ class admin_core_applications_applications extends ipsCommand $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $hook['hook_id'] ) ); $this->DB->execute(); - while( $r = $this->DB->fetch() ) + while ( $r = $this->DB->fetch() ) { @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); } @@ -1412,19 +1709,19 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Remove Files //----------------------------------------- - + /* Languages */ try { foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/lang_cache/' ) as $dir ) { - if( ! $dir->isDot() && intval( $dir->getFileName() ) ) + if ( ! $dir->isDot() && intval( $dir->getFileName() ) ) { foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/lang_cache/' . $dir->getFileName() . '/' ) as $file ) { - if( ! $file->isDot() ) + if ( ! $file->isDot() ) { - if( preg_match( "/^({$application['app_directory']}_)/", $file->getFileName() ) ) + if ( preg_match( "/^({$application['app_directory']}_)/", $file->getFileName() ) ) { unlink( $file->getPathName() ); } @@ -1432,103 +1729,112 @@ class admin_core_applications_applications extends ipsCommand } } } - } catch ( Exception $e ) {} + } + catch( Exception $e ) + { + } /* Remove Skins */ - require_once( IPS_KERNEL_PATH . 'classXML.php' ); - $xml = new classXML( $this->settings['gb_char_set'] ); - $xml->load( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/information.xml' ); - - if ( is_object( $xml->fetchElements( 'template' ) ) ) + if( is_file( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/information.xml' ) ) { - foreach( $xml->fetchElements( 'template' ) as $template ) + require_once ( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( $this->settings['gb_char_set'] ); + $xml->load( IPSLib::getAppDir( $application['app_directory'] ) . '/xml/information.xml' ); + + if ( is_object( $xml->fetchElements( 'template' ) ) ) { - $name = $xml->fetchItem( $template ); - $match = $xml->fetchAttribute( $template, 'match' ); - - if ( $name ) + foreach( $xml->fetchElements( 'template' ) as $template ) { - $templateGroups[ $name ] = $match; + $name = $xml->fetchItem( $template ); + $match = $xml->fetchAttribute( $template, 'match' ); + + if ( $name ) + { + $templateGroups[$name] = $match; + } } } - } - - if( is_array($templateGroups) AND count($templateGroups) ) - { - /* Loop through skin directories */ - try + + if ( is_array( $templateGroups ) and count( $templateGroups ) ) { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/skin_cache/' ) as $dir ) + /* Loop through skin directories */ + try { - if( preg_match( "/^(cacheid_)/", $dir->getFileName() ) ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/skin_cache/' ) as $dir ) { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/skin_cache/' . $dir->getFileName() . '/' ) as $file ) + if ( preg_match( "/^(cacheid_)/", $dir->getFileName() ) ) { - if( ! $file->isDot() ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/skin_cache/' . $dir->getFileName() . '/' ) as $file ) { - foreach( $templateGroups as $name => $match ) + if ( ! $file->isDot() ) { - if( $match == 'contains' ) + foreach( $templateGroups as $name => $match ) { - if( stristr( $file->getFileName(), $name ) ) + if ( $match == 'contains' ) + { + if ( stristr( $file->getFileName(), $name ) ) + { + unlink( $file->getPathName() ); + } + } + else if ( $file->getFileName() == $name . '.php' ) { unlink( $file->getPathName() ); } } - else if( $file->getFileName() == $name . '.php' ) - { - unlink( $file->getPathName() ); - } } } } } } - } catch ( Exception $e ) {} - - /* Delete from database */ - foreach( $templateGroups as $name => $match ) - { - if( $match == 'contains' ) + catch( Exception $e ) { - $this->DB->delete( 'skin_templates', "template_group LIKE '%{$name}%'" ); } - else + + /* Delete from database */ + foreach( $templateGroups as $name => $match ) { - $this->DB->delete( 'skin_templates', "template_group='{$name}'" ); + if ( $match == 'contains' ) + { + $this->DB->delete( 'skin_templates', "template_group LIKE '%{$name}%'" ); + } + else + { + $this->DB->delete( 'skin_templates', "template_group='{$name}'" ); + } } } } /* CSS files */ - $css_files = array(); + $css_files = array(); $this->DB->build( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_app='" . $application['app_directory'] . "'" ) ); $this->DB->execute(); - while( $r = $this->DB->fetch() ) + while ( $r = $this->DB->fetch() ) { - $css_files[ $r['css_group'] ] = $r['css_group']; + $css_files[$r['css_group']] = $r['css_group']; } - if( count($css_files) ) + if ( count( $css_files ) ) { $this->DB->delete( 'skin_css', "css_app='" . $application['app_directory'] . "'" ); $this->DB->delete( 'skin_cache', "cache_type='css' AND cache_value_1 IN('" . implode( "','", $css_files ) . "')" ); try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_css/' ) as $dir ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/' ) as $dir ) { - if( preg_match( "/^(css_)/", $dir->getFileName() ) ) + if ( preg_match( "/^(css_)/", $dir->getFileName() ) ) { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_css/' . $dir->getFileName() . '/' ) as $file ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/' . $dir->getFileName() . '/' ) as $file ) { - if( ! $file->isDot() ) + if ( ! $file->isDot() ) { foreach( $css_files as $css_file ) { - if( $file->getFileName() == $css_file . '.css' ) + if ( $file->getFileName() == $css_file . '.css' ) { unlink( $file->getPathName() ); } @@ -1537,26 +1843,29 @@ class admin_core_applications_applications extends ipsCommand } } } - } catch ( Exception $e ) {} + } + catch( Exception $e ) + { + } } //----------------------------------------- // Remove Modules //----------------------------------------- - + $this->DB->delete( 'core_sys_module', "sys_module_application='{$application['app_directory']}'" ); //----------------------------------------- // Remove Application //----------------------------------------- - - $this->DB->delete( 'core_applications', 'app_id='.$app_id ); + + $this->DB->delete( 'core_applications', 'app_id=' . $app_id ); //----------------------------------------- // Recache //----------------------------------------- - - $this->moduleRecacheAll(1); + + $this->moduleRecacheAll( 1 ); $this->cache->rebuildCache( 'settings', 'global' ); $this->cache->rebuildCache( 'notifications', 'global' ); @@ -1567,117 +1876,175 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // FURL templates //----------------------------------------- - + try { IPSLib::cacheFurlTemplates(); + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ) + { } - catch( Exception $e ){} //----------------------------------------- // Sphinx involved? //----------------------------------------- - - if( $this->settings['search_method'] == 'sphinx' ) + + if ( $this->settings['search_method'] == 'sphinx' ) { $this->registry->output->global_message .= sprintf( $this->lang->words['rebuild_sphinx'], $this->settings['_base_url'] ); } - + //----------------------------------------- // Done... //----------------------------------------- - $this->registry->output->global_message = $this->lang->words['a_appremoved']; + $this->registry->output->global_message = $this->lang->words['a_appremoved']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); } - + /** - * Export an application + * Export information.xml files + * for every application * - * @param integer Return XML [1] or print to browser [0] - * @return mixed XML content or void [Outputs to screen] + * @return @e void [Returns to the applications list] */ - private function applicationExport( $return_xml=0 ) + protected function inDevApplicationsExport() { - //----------------------------------------- - // INIT - //----------------------------------------- - - $xml = ''; - - //----------------------------------------- - // Get xml mah-do-dah - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' ); - - $xml = new classXML( IPS_DOC_CHAR_SET ); - - $xml->newXMLDocument(); - $xml->addElement( 'applicationexport' ); - $xml->addElement( 'applicationgroup', 'applicationexport' ); - - //----------------------------------------- - // Get applications - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_applications' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) + /* Not IN_DEV? */ + if ( ! IN_DEV ) { - unset( $r['app_id'] ); + $this->applicationsOverview(); + return; + } + + /* Get our libs! */ + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ + + /* Do each app */ + $this->DB->build( array( 'select' => '*', 'from' => 'core_applications' ) ); + $outer = $this->DB->execute(); + + /* Loop */ + while ( $app = $this->DB->fetch( $outer ) ) + { + /* Set some vars */ + $oldXml = array(); + $newXml = null; + $infoFile = IPSLib::getAppDir( $app['app_directory'] ) . '/xml/information.xml'; - $xml->addElementAsRecord( 'applicationgroup', 'application', $r ); + /* Got some 'old' template data to retain? */ + if ( is_file( $infoFile ) ) + { + if ( ! is_writeable( $infoFile ) ) + { + $output[] = "Cannot write to {$infoFile}"; + continue; + } + + $oldXml = IPSSetUp::fetchXmlAppInformation( $app['app_directory'], $this->settings['gb_char_set'] ); + } + + $data = array( 'name' => trim( $app['app_title'] ), + 'public_name' => trim( $app['app_public_title'] ), + 'hide_tab' => intval( $app['app_hide_tab'] ), + 'author' => trim( $app['app_author'] ), + 'description' => trim( $app['app_description'] ), + 'disabledatinstall' => ( isset( $oldXml['disabledatinstall'] ) && $oldXml['disabledatinstall'] ) ? intval( $oldXml['disabledatinstall'] ) : 0, + 'ipskey' => '', + 'global_caches' => trim( $app['app_global_caches'] ), + 'website' => trim( $app['app_website'] ), + 'update_check' => trim( $app['app_update_check'] ) + ); + + /* Got an IPS key to add? */ + if ( $app['app_location'] == 'ips' ) + { + $data['ipskey'] = md5( 'ips_' . $app['app_directory'] ); + } + else + { + unset( $data['ipskey'] ); + } + + /* Create xml object */ + $newXml = new classXML( IPS_DOC_CHAR_SET ); + $newXml->newXMLDocument(); + + /* Create elements */ + $newXml->addElement( 'information' ); + $newXml->addElementAsRecord( 'information', 'data', $data ); + + /* Get data till now */ + $xmlData = $newXml->fetchDocument(); + + /* Got templates? */ + if ( isset( $oldXml['templates'] ) && count( $oldXml['templates'] ) ) + { + $XML_TEMPLATES = <<\n +XML; + + foreach( $oldXml['templates'] as $k => $v ) + { + $XML_TEMPLATES .= <<{$k}\n +XML; + } + + $XML_TEMPLATES .= << +XML; + } + else + { + $XML_TEMPLATES = << +XML; + } + + /* Add templates into our XML - yeah I know.. a bit hackish.. */ + if ( $data['update_check'] ) + { + $xmlData = str_replace( '', "\n{$XML_TEMPLATES}", $xmlData ); + } + else + { + $xmlData = str_replace( '', "\n{$XML_TEMPLATES}", $xmlData ); + } + + file_put_contents( $infoFile, $xmlData ); + + $output[] = $app['app_title'] . " information exported in '" . str_replace( DOC_IPS_ROOT_PATH, '', $infoFile ) . "'"; } - - //----------------------------------------- - // Send to browser. - //----------------------------------------- - if( $return_xml ) - { - return array( 'title' => 'applications.xml', 'xml' => $xml->fetchDocument() ); - } - else - { - $this->registry->output->showDownload( $xml->fetchDocument(), 'applications.xml', '', 0 ); - } + /* Done, setup message and redirect */ + $this->registry->output->setMessage( implode( "
", $output ), 1 ); + + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); } /** * Save an application * * @param string Type [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function applicationSave( $type='add' ) + public function applicationSave( $type = 'add' ) { - //-------------------------------------------- - // INIT - //-------------------------------------------- - - $app_id = intval( $this->request['app_id'] ); - $app_title = trim( $this->request['app_title'] ); - $app_public_title = trim( $this->request['app_public_title'] ); - $app_description = trim( $this->request['app_description'] ); - $app_author = trim( $this->request['app_author'] ); - $app_version = trim( $this->request['app_version'] ); - $app_directory = trim( $this->request['app_directory'] ); - $app_protected = intval( $this->request['app_protected'] ); - $app_enabled = intval( $this->request['app_enabled'] ); - $app_hide_tab = intval( $this->request['app_hide_tab'] ); - $application = array(); - - //-------------------------------------------- - // Check - //-------------------------------------------- + /* Init vars */ + $app_title = trim( $this->request['app_title'] ); + $app_directory = trim( $this->request['app_directory'] ); + $app_enabled = intval( $this->request['app_enabled'] ); + $application = array(); + /* Editing? */ if ( $type == 'edit' ) { - $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $app_id ) ); + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . intval( $this->request['app_id'] ) ) ); if ( ! $application['app_id'] ) { @@ -1686,53 +2053,55 @@ class admin_core_applications_applications extends ipsCommand return; } } + else + { + $_check = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => "app_directory='{$app_directory}'" ) ); + + if ( $_check['app_id'] ) + { + $this->registry->output->showError( $this->lang->words['app_already_added'], 111161.3 ); + } + } - if ( ! $app_title OR ! $app_directory ) + /* Error check */ + if ( ! $app_title or ! $app_directory ) { $this->registry->output->global_message = $this->lang->words['a_titledirectory']; $this->applicationForm( $type ); return; } - //-------------------------------------------- - // Check... - //-------------------------------------------- + if ( ! $app_enabled && in_array( $app_directory, array( 'core', 'forums', 'members' ) ) ) + { + $this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.2 ); + } - $array = array( 'app_title' => $app_title, - 'app_public_title' => $app_public_title, - 'app_description' => $app_description, - 'app_author' => $app_author, - 'app_version' => $app_version, - 'app_directory' => $app_directory, - 'app_enabled' => $app_enabled, - 'app_hide_tab' => $app_hide_tab ); + /* $setup update array */ + $array = array( 'app_title' => $app_title, 'app_public_title' => trim( $this->request['app_public_title'] ), 'app_enabled' => $app_enabled, 'app_hide_tab' => intval( $this->request['app_hide_tab'] ), 'app_description' => trim( $this->request['app_description'] ), 'app_author' => trim( $this->request['app_author'] ), 'app_version' => trim( $this->request['app_version'] ), 'app_directory' => $app_directory, 'app_website' => trim( $this->request['app_website'] ), 'app_update_check' => trim( $this->request['app_update_check'] ), 'app_global_caches' => ( is_array( $this->request['app_global_caches'] ) && count( $this->request['app_global_caches'] ) ) ? implode( ',', $this->request['app_global_caches'] ) : '', 'app_tab_groups' => ( is_array( $this->request['app_tab_groups'] ) && count( $this->request['app_tab_groups'] ) ) ? implode( ',', $this->request['app_tab_groups'] ) : '' ); //----------------------------------------- // IN DEV? //----------------------------------------- + if ( IN_DEV ) { - $array['app_protected'] = $app_protected; - } - - if( in_array( $array['app_directory'], array( 'core', 'forums', 'members' ) ) AND !$array['app_enabled'] ) - { - $this->registry->output->showError( $this->lang->words['cannot_toggle_defaults'], 111161.2 ); + $array['app_protected'] = intval( $this->request['app_protected'] ); } //----------------------------------------- // Save... //----------------------------------------- + if ( $type == 'add' ) { - $array['app_added'] = time(); - $array['app_location'] = 'other'; + $array['app_added'] = time(); + $array['app_location'] = 'other'; - $max = $this->DB->buildAndFetch( array( 'select' => 'MAX(app_position) as position', 'from' => 'core_applications' ) ); + $max = $this->DB->buildAndFetch( array( 'select' => 'MAX(app_position) as position', 'from' => 'core_applications' ) ); - $array['app_position'] = $max['position'] + 1; + $array['app_position'] = $max['position'] + 1; $this->DB->insert( 'core_applications', $array ); $this->registry->output->global_message = $this->lang->words['a_newapp']; @@ -1740,12 +2109,33 @@ class admin_core_applications_applications extends ipsCommand else { /* Update the application record */ - $this->DB->update( 'core_applications', $array, 'app_id='.$app_id ); + $this->DB->update( 'core_applications', $array, 'app_id=' . $application['app_id'] ); - /* Update modules, if the application directory changed */ - if( $application['app_directory'] != $app_directory ) + /* Update modules and tasks, if the application directory changed */ + if ( $application['app_directory'] != $app_directory ) { + $this->DB->update( 'task_manager', array( 'task_application' => $app_directory ), "task_application='{$application['app_directory']}'" ); $this->DB->update( 'core_sys_module', array( 'sys_module_application' => $app_directory ), "sys_module_application='{$application['app_directory']}'" ); + $this->DB->update( 'admin_logs', array( 'appcomponent' => $app_directory ), "appcomponent='{$application['app_directory']}'" ); + $this->DB->update( 'core_editor_autosave', array( 'eas_app' => $app_directory ), "eas_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_incoming_emails', array( 'rule_app' => $app_directory ), "rule_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_item_markers', array( 'item_app' => $app_directory ), "item_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_like', array( 'like_app' => $app_directory ), "like_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_like_cache', array( 'like_cache_app' => $app_directory ), "like_cache_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_share_links_log', array( 'log_data_app' => $app_directory ), "log_data_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_sys_lang_words', array( 'word_app' => $app_directory ), "word_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_app' => $app_directory ), "conf_title_app='{$application['app_directory']}'" ); + $this->DB->update( 'core_tags', array( 'tag_meta_app' => $app_directory ), "tag_meta_app='{$application['app_directory']}'" ); + $this->DB->update( 'custom_bbcode', array( 'bbcode_app' => $app_directory ), "bbcode_app='{$application['app_directory']}'" ); + $this->DB->update( 'faq', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" ); + $this->DB->update( 'inline_notifications', array( 'notify_meta_app' => $app_directory ), "notify_meta_app='{$application['app_directory']}'" ); + $this->DB->update( 'permission_index', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" ); + $this->DB->update( 'reputation_cache', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" ); + $this->DB->update( 'reputation_index', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" ); + $this->DB->update( 'skin_css', array( 'css_app' => $app_directory ), "css_app='{$application['app_directory']}'" ); + $this->DB->update( 'skin_css_previous', array( 'p_css_app' => $app_directory ), "p_css_app='{$application['app_directory']}'" ); + $this->DB->update( 'tags_index', array( 'app' => $app_directory ), "app='{$application['app_directory']}'" ); + $this->DB->update( 'upgrade_history', array( 'upgrade_app' => $app_directory ), "upgrade_app='{$application['app_directory']}'" ); } /* Set the message */ @@ -1755,63 +2145,77 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Recache //----------------------------------------- - + $this->applicationsRecache(); $this->applicationsMenuDataRecache(); try { IPSLib::cacheFurlTemplates(); + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ) + { + } + + /** + * Re-enable the tasks if app is active + * (more effective than checking per-case) + */ + if ( $app_enabled ) + { + $this->DB->update( 'task_manager', array( 'task_enabled' => 1 ), "task_application='{$app_directory}'" ); + } + + /* Check for possible hook warnings */ + if ( $type == 'edit' && $application['app_enabled'] && ! $app_enabled ) + { + // Switch the enabled value here or check will fail with the current cache! + ipsRegistry::$applications[$application['app_directory']]['app_enabled'] = 0; + + $this->_checkHooksWarnings( $application['app_directory'] ); } - catch( Exception $e ){} //----------------------------------------- // Sphinx involved? //----------------------------------------- - if( $this->settings['search_method'] == 'sphinx' ) + + if ( $this->settings['search_method'] == 'sphinx' ) { $this->registry->output->global_message .= sprintf( $this->lang->words['rebuild_sphinx'], $this->settings['_base_url'] ); } - //----------------------------------------- - // List... - //----------------------------------------- - - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=applications_overview' ); + /* All done */ + $this->applicationsOverview(); } /** * Add/edit application form * * @param string Type [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function applicationForm( $type='add' ) + public function applicationForm( $type = 'add' ) { - //----------------------------------------- - // INIT - //----------------------------------------- - - $app_id = intval( $this->request['app_id'] ); + /* Init vars */ $application = array(); - $form = array(); + $form = array(); //----------------------------------------- // Add or edit? //----------------------------------------- + if ( $type == 'add' ) { $formcode = 'application_add_do'; - $title = $this->lang->words['a_addnewapp']; - $button = $this->lang->words['a_addnewapp']; + $title = $this->lang->words['a_addnewapp']; + $button = $this->lang->words['a_addnewapp']; } else { - $application = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_applications', - 'where' => 'app_id='.$app_id ) ); + $application = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . intval( $this->request['app_id'] ) ) ); if ( ! $application['app_id'] ) { @@ -1821,137 +2225,189 @@ class admin_core_applications_applications extends ipsCommand } $formcode = 'application_edit_do'; - $title = $this->lang->words['a_editapp'] . $application['app_title']; - $button = $this->lang->words['a_savechanges']; + $title = $this->lang->words['a_editapp'] . ': ' . $application['app_title']; + $button = $this->lang->words['a_savechanges']; } //----------------------------------------- // Form elements //----------------------------------------- - $form['app_title'] = $this->registry->output->formInput( 'app_title' , $_POST['app_title'] ? $_POST['app_title'] : $application['app_title'] ); - $form['app_public_title'] = $this->registry->output->formInput( 'app_public_title', $_POST['app_public_title'] ? $_POST['app_public_title'] : $application['app_public_title'] ); - $form['app_description'] = $this->registry->output->formInput( 'app_description', $_POST['app_description'] ? $_POST['app_description'] : $application['app_description'] ); - $form['app_author'] = $this->registry->output->formInput( 'app_author' , $_POST['app_author'] ? $_POST['app_author'] : $application['app_author'] ); - $form['app_version'] = $this->registry->output->formInput( 'app_version' , $_POST['app_version'] ? $_POST['app_version'] : $application['app_version'] ); - $form['app_directory'] = $this->registry->output->formInput( 'app_directory' , $_POST['app_directory'] ? $_POST['app_directory'] : $application['app_directory'] ); - $form['app_protected'] = $this->registry->output->formYesNo( 'app_protected' , $_POST['app_protected'] ? $_POST['app_protected'] : $application['app_protected'] ); - $form['app_enabled'] = $this->registry->output->formYesNo( 'app_enabled' , $_POST['app_enabled'] ? $_POST['app_enabled'] : $application['app_enabled'] ); - $form['app_hide_tab'] = $this->registry->output->formYesNo( 'app_hide_tab' , $_POST['app_hide_tab'] ? $_POST['app_hide_tab'] : $application['app_hide_tab'] ); + + /* Input */ + foreach( array( 'app_title', 'app_public_title', 'app_description', 'app_author', 'app_version', 'app_directory', 'app_website', 'app_update_check' ) as $_app_key ) + { + $form[$_app_key] = $this->registry->output->formSimpleInput( $_app_key, isset( $_POST[$_app_key] ) ? $_POST[$_app_key] : $application[$_app_key], 60 ); + } + /* Y/N */ + foreach( array( 'app_protected', 'app_enabled', 'app_hide_tab' ) as $_app_key ) + { + $form[$_app_key] = $this->registry->output->formYesNo( $_app_key, isset( $_POST[$_app_key] ) ? $_POST[$_app_key] : $application[$_app_key] ); + } + + /* Sort the tab permissions MDD */ + $_groups = array(); + + foreach( $this->cache->getCache( 'group_cache' ) as $gid => $gdata ) + { + $_groups[] = array( $gid, $gdata['g_title'] ); + } + + sort( $_groups ); + + $form['app_tab_groups'] = $this->registry->output->formMultiDropdown( 'app_tab_groups[]', $_groups, isset( $_POST['app_tab_groups'] ) ? $_POST['app_tab_groups'] : explode( ',', $application['app_tab_groups'] ), 7 ); + + /* Setup the global caches MDD */ + $_caches = array(); + + $this->DB->build( array( 'select' => 'cs_key', 'from' => 'cache_store', 'order' => 'cs_key ASC' ) ); + $this->DB->execute(); + + while ( $gc = $this->DB->fetch() ) + { + $_caches[] = array( $gc['cs_key'], $gc['cs_key'] ); + } + + sort( $_caches ); + + $form['app_global_caches'] = $this->registry->output->formMultiDropdown( 'app_global_caches[]', $_caches, isset( $_POST['app_global_caches'] ) ? $_POST['app_global_caches'] : explode( ',', $application['app_global_caches'] ), 15 ); + + /* Output */ $this->registry->output->html .= $this->html->application_form( $form, $title, $formcode, $button, $application ); } /** * Move an application up/down * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function applicationManagePosition() + public function applicationManagePosition() { //----------------------------------------- // INIT //----------------------------------------- + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); - $ajax = new $classToLoad(); + $ajax = new $classToLoad(); //----------------------------------------- // Checks... //----------------------------------------- + - if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) + if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) { $ajax->returnString( $this->lang->words['postform_badmd5'] ); exit(); } - - //----------------------------------------- - // Save new position - //----------------------------------------- + + //----------------------------------------- + // Save new position + //----------------------------------------- + - $position = 1; - - if( is_array($this->request['apps']) AND count($this->request['apps']) ) - { - foreach( $this->request['apps'] as $this_id ) - { - $location = $this->DB->buildAndFetch( array( 'select' => 'app_location', 'from' => 'core_applications', 'where' => 'app_id=' . $this_id ) ); - $buffer = array( 'root' => 0, 'ips' => 100, 'other' => 200 ); - $this->DB->update( 'core_applications', array( 'app_position' => $position+$buffer[ $location['app_location'] ] ), 'app_id=' . $this_id ); - - $position++; - } - } - + $position = 1; + + if ( is_array( $this->request['apps'] ) and count( $this->request['apps'] ) ) + { + foreach( $this->request['apps'] as $this_id ) + { + $location = $this->DB->buildAndFetch( array( 'select' => 'app_location', 'from' => 'core_applications', 'where' => 'app_id=' . $this_id ) ); + $buffer = array( 'root' => 0, 'ips' => 100, 'other' => 200 ); + $this->DB->update( 'core_applications', array( 'app_position' => $position + $buffer[$location['app_location']] ), 'app_id=' . $this_id ); + + $position ++; + } + } + $this->applicationsRecache(); $this->applicationsMenuDataRecache(); - - $ajax->returnString( 'OK' ); - exit(); + + $ajax->returnString( 'OK' ); } /** * List applications * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function applicationsOverview() + public function applicationsOverview() { - //----------------------------------------- - // INIT - //----------------------------------------- - - $folders = array(); - $application = array(); - $_apps = array(); - $seen_count = 0; - $uninstalled = array(); + /* Init vars */ + $folders = array(); + $application = array(); + $_apps = array(); + $uninstalled = array(); + $appsUpdates = 0; + $checkUpdates = ! empty( $this->request['checkUpdates'] ) ? true : false; /* Get the setup class */ - require IPS_ROOT_PATH . "setup/sources/base/setup.php"; + require_once ( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ + + /* Get hooks file for update check */ + $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'core' ) . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' ); + $hooksClass = new $classToLoad(); + $hooksClass->makeRegistryShortcuts( $this->registry ); //----------------------------------------- // Get DB applications //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_applications', - 'order' => 'app_position' ) ); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_applications', 'order' => 'app_position' ) ); $this->DB->execute(); - while( $row = $this->DB->fetch() ) + while ( $row = $this->DB->fetch() ) { - $_apps[ IPSLib::getAppFolder( $row['app_directory'] ) . '/' . $row['app_directory'] ] = $row; + /* Got updates? */ + if ( $row['app_update_check'] && $checkUpdates === true ) + { + $row['app_update_available'] = $hooksClass->_updateAvailable( $row['app_update_check'], $row['app_long_version'] ); + + if ( $row['app_update_available'][0] ) + { + $appsUpdates++; + } + } + else + { + $row['app_update_available'] = array( 0 ); + } + + $_apps[IPSLib::getAppFolder( $row['app_directory'] ) . '/' . $row['app_directory']] = $row; } //----------------------------------------- // Get folder applications... //----------------------------------------- - + foreach( array( 'applications', 'applications_addon/ips', 'applications_addon/other' ) as $folder ) { try { foreach( new DirectoryIterator( IPS_ROOT_PATH . $folder ) as $file ) { - if ( ! $file->isDot() AND $file->isDir() ) + if ( ! $file->isDot() and $file->isDir() ) { $_name = $file->getFileName(); if ( substr( $_name, 0, 1 ) != '.' ) { - $folders[ $folder . '/' . $_name ] = $_name; + $folders[$folder . '/' . $_name] = $_name; } } } - } catch ( Exception $e ) {} + } + catch( Exception $e ) + { + } } //----------------------------------------- // Installed Loop... //----------------------------------------- - + foreach( $_apps as $_app_path => $row ) { $app_dir = $row['app_directory']; @@ -1959,39 +2415,52 @@ class admin_core_applications_applications extends ipsCommand //----------------------------------------- // Enabled? //----------------------------------------- - + $row['_app_enabled'] = ( $row['app_enabled'] ) ? 'tick.png' : 'cross.png'; /* Version numbers */ - $_a = ( $app_dir == 'forums' OR $app_dir == 'members' ) ? 'core' : $app_dir; - $numbers = IPSSetUp::fetchAppVersionNumbers( $_a ); - + $_a = ( $app_dir == 'forums' or $app_dir == 'members' ) ? 'core' : $app_dir; + $numbers = IPSSetUp::fetchAppVersionNumbers( $_a ); + $row['_human_version'] = $numbers['latest'][1]; - $row['_long_version'] = $numbers['latest'][0]; + $row['_long_version'] = $numbers['latest'][0]; $row['_human_current'] = $numbers['current'][1]; - $row['_long_current'] = $numbers['current'][0]; + $row['_long_current'] = $numbers['current'][0]; - /* Exists? */ - if ( ! file_exists( IPSLib::getAppDir( $app_dir ) ) ) + /* Nexus? */ + if ( $row['app_directory'] == 'nexus' ) { - $row['_missing'] = 1; + $encoding = 'Unencoded'; + + $file = file_get_contents( IPSLib::getAppDir('nexus') . '/app_class_nexus.php' ); + + if ( substr( $file, 6, 5 ) == '@Zend' ) + { + $phpVersion = phpversion(); + $phpVersion = str_replace( substr( $phpVersion, strrpos( $phpVersion, '.' ) ), '', $phpVersion ); + $encoding = "Zend {$phpVersion}"; + } + elseif ( substr( $file, 36, 7 ) == 'ionCube' ) + { + $encoding = 'Ioncube'; + } + + $row['_human_current'] .= " ({$encoding})"; } - $seen_count++; - $application[$row['app_location']][] = $row; } /* Make sure they are in the proper order, hacky but it works :) */ $__apps = array(); - $__apps['root'] = $application['root'] ? $application['root'] : array(); - $__apps['ips'] = $application['ips'] ? $application['ips'] : array(); + $__apps['root'] = $application['root'] ? $application['root'] : array(); + $__apps['ips'] = $application['ips'] ? $application['ips'] : array(); $__apps['other'] = $application['other'] ? $application['other'] : array(); $application = $__apps; - + //----------------------------------------- // Uninstalled //----------------------------------------- @@ -2024,142 +2493,288 @@ class admin_core_applications_applications extends ipsCommand if ( $info['name'] ) { - $uninstalled[ $_file ] = array( 'title' => $info['name'], - 'author' => $info['author'], - 'path' => $filepath, - 'okToGo' => $okToGo, - 'directory' => $_file ); + $uninstalled[$_file] = array( 'title' => $info['name'], 'author' => $info['author'], 'path' => $filepath, 'okToGo' => $okToGo, 'directory' => $_file ); } } } - - //----------------------------------------- - // Show it... - //----------------------------------------- - $this->registry->output->html .= $this->html->applications_list( $application, $uninstalled ); + /* Got updates to show? */ + $message = NULL; + if ( $checkUpdates === true ) + { + $message = ( $appsUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $appsUpdates ); + } + + /* Output */ + $this->registry->output->html .= $this->html->applications_list( $application, $uninstalled, $message ); } /** * Recache applications * - * @return void + * @return @e void */ public function applicationsRecache() { - $apps = array(); - $incomingEmails = FALSE; + $apps = array(); + $incomingEmails = FALSE; /* Rebuild Applications Cache */ - $this->DB->build( array( 'select' => '*', - 'from' => 'core_applications', - 'order' => 'app_position ASC' ) ); - $outer = $this->DB->execute(); - - while( $row = $this->DB->fetch($outer) ) + $this->DB->build( array( 'select' => '*', 'from' => 'core_applications', 'order' => 'app_position ASC' ) ); + $outer = $this->DB->execute(); + + while ( $row = $this->DB->fetch( $outer ) ) { - $apps[ $row['app_directory'] ] = $row; + /* Sort out tab groups */ + $row['app_tab_groups'] = IPSText::cleanPermString( $row['app_tab_groups'] ); + + if ( $row['app_tab_groups'] ) + { + $row['app_tab_groups'] = explode( ',', $row['app_tab_groups'] ); + } + else + { + $row['app_tab_groups'] = array(); + } + + $apps[$row['app_directory']] = $row; /* Search */ - if( IPSSearchIndex::appIsSearchable( $row['app_directory'] ) ) - { + // By checking if it's installed here, we don't build the search key properly during a fresh install. + // We should check if the app is installed at runtime instead. + //if ( IPSLib::appIsInstalled( $row['app_directory'] ) ) + //{ $_file = IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/search/config.php'; - if ( file_exists( $_file ) ) + if ( is_file( $_file ) ) { $CONFIG = array(); - require( $_file ); + require ( $_file );/*noLibHook*/ - if ( is_array( $CONFIG ) AND count( $CONFIG ) ) + if ( is_array( $CONFIG ) and count( $CONFIG ) ) { - $apps[ $row['app_directory'] ]['search'] = $CONFIG; - + $apps[$row['app_directory']]['search'] = $CONFIG; + unset( $CONFIG ); } } - } + //} - /* Supports like system? */ - if ( is_dir( IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/like' ) ) - { - try - { - foreach( new DirectoryIterator( IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/like' ) as $file ) - { - if ( !$file->isDot() AND !$file->isDir() ) - { - $_name = $file->getFileName(); - - if ( substr( $_name, -4 ) == '.php' ) - { - $apps[ $row['app_directory'] ]['_supports_likes'] = 1; - break; - } - } - } - } catch ( Exception $e ) {} - } + /* Fetch installed extensions */ + $apps[$row['app_directory']]['extensions'] = array( 'itemMarking' => false, 'comments' => false, 'like' => false, 'search' => false, 'incomingEmail' => false ); + + /* Now go */ + $apps[$row['app_directory']]['extensions']['comments'] = $this->_getHasExtensionComments( $row['app_directory'] ); + $apps[$row['app_directory']]['extensions']['itemMarking'] = $this->_getHasExtensionItemMarking( $row['app_directory'] ); + $apps[$row['app_directory']]['extensions']['incomingEmail'] = $this->_getHasExtensionIncomingEmail( $row['app_directory'] ); + $apps[$row['app_directory']]['extensions']['like'] = $this->_getHasExtensionLike( $row['app_directory'] ); + $apps[$row['app_directory']]['extensions']['search'] = $this->_getHasExtensionSearch( $row['app_directory'] ); + $apps[$row['app_directory']]['extensions']['groupOptions'] = $this->_getGroupExtensions( $row['app_directory'] ); /* incomingEmails? */ - if ( file_exists( IPSLib::getAppDir( $row['app_directory'] ) . '/extensions/incomingEmails.php' ) ) + if ( $apps[$row['app_directory']]['extensions']['incomingEmail'] ) { $incomingEmails = TRUE; } + + /* Has custom header? */ + $apps[ $row['app_directory'] ]['hasCustomHeader'] = ( method_exists( $this->registry->output->getTemplate( $row['app_directory'] . '_global' ), 'overwriteHeader' ) ) ? 1 : 0; } - + $this->cache->setCache( 'app_cache', $apps, array( 'array' => 1 ) ); /* Do we have an incomingEmails extension anywhere? */ - $systemvars = $this->cache->getCache('systemvars'); + $systemvars = $this->cache->getCache( 'systemvars' ); $systemvars['incomingEmails'] = $incomingEmails; $this->cache->setCache( 'systemvars', $systemvars, array( 'array' => 1 ) ); /* Rebuild navigation tabs too */ $tabs = array(); - foreach ( $apps as $dir => $data ) + foreach( $apps as $dir => $data ) { if ( ! $data['app_hide_tab'] ) - { - $tabs[] = array( - 'app' => $dir, - 'module'=> '', - 'title' => $this->lang->words[ $data['app_public_title'] ] ? $this->lang->words[ $data['app_public_title'] ] : $data['app_public_title'] - ); + { + $tabs[] = array( 'app' => $dir, 'groups' => $data['app_tab_groups'], 'module' => '', // Can't use IPSLib::getAppTitle() because of the IN_ACP check in it + 'title' => $this->lang->words[$data['app_public_title']] ? $this->lang->words[$data['app_public_title']] : $data['app_public_title'] ); } - if ( file_exists( IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php' ) ) + if ( is_file( IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php' ) ) { $extraTabs = array(); - require_once IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php'; + require_once ( IPSLib::getAppDir( $dir ) . '/extensions/coreVariables.php' );/*noLibHook*/ - if ( is_array($extraTabs) && count($extraTabs) ) + if ( is_array( $extraTabs ) && count( $extraTabs ) ) { $this->registry->class_localization->loadLanguageFile( array( 'admin_' . $dir ), $dir ); $_extraTabs = array(); - foreach ( $extraTabs as $t ) + foreach( $extraTabs as $t ) { - $t['title'] = $this->lang->words[ $t['title'] ]; + $t['title'] = $this->lang->words[$t['title']]; $_extraTabs[] = $t; } $tabs = array_merge( $tabs, $_extraTabs ); } + unset( $extraTabs ); } } $this->cache->setCache( 'navigation_tabs', $tabs, array( 'array' => 1 ) ); - } + $this->cache->rebuildCache( 'rss_output_cache', 'global' ); + } + + /** + * Has Incoming emails extension + * @param string $appDir + */ + protected function _getHasExtensionIncomingEmail( $appDir ) + { + if ( is_file( IPSLib::getAppDir( $appDir ) . '/extensions/incomingEmails.php' ) ) + { + return true; + } + + return false; + } + + /** + * Has itemMarking extension + * + * @param string $appDir Application directory + * @return @e boolean + */ + protected function _getHasExtensionItemMarking( $appDir ) + { + if ( is_file( IPSLib::getAppDir( $appDir ) . '/extensions/coreExtensions.php' ) ) + { + require_once( IPSLib::getAppDir( $appDir ) . '/extensions/coreExtensions.php' );/*noLibHook*/ + + if ( class_exists( 'itemMarking__' . $appDir ) ) + { + return true; + } + } + + return false; + } + + /** + * Has Comments extension + * + * @param string $appDir Application directory + * @return @e boolean + */ + protected function _getHasExtensionComments( $appDir ) + { + $return = false; + + if ( is_dir( IPSLib::getAppDir( $appDir ) . '/extensions/comments' ) ) + { + try + { + foreach( new DirectoryIterator( IPSLib::getAppDir( $appDir ) . '/extensions/comments' ) as $file ) + { + if ( ! $file->isDot() and ! $file->isDir() ) + { + $_name = $file->getFileName(); + + if ( substr( $_name, - 4 ) == '.php' ) + { + $return = true; + break; + } + } + } + } + catch( Exception $e ) + { + } + } + + return $return; + } + + /** + * Has Like extension + * + * @param string $appDir Application directory + * @return @e boolean + */ + protected function _getHasExtensionLike( $appDir ) + { + $return = false; + + if ( is_dir( IPSLib::getAppDir( $appDir ) . '/extensions/like' ) ) + { + try + { + foreach( new DirectoryIterator( IPSLib::getAppDir( $appDir ) . '/extensions/like' ) as $file ) + { + if ( ! $file->isDot() and ! $file->isDir() ) + { + $_name = $file->getFileName(); + + if ( substr( $_name, - 4 ) == '.php' ) + { + $return = true; + break; + } + } + } + } + catch( Exception $e ) + { + } + } + + return $return; + } + + /** + * Retrieve group inheritence options + * + * @param string $appDir Application directory + * @return @e boolean + */ + protected function _getGroupExtensions( $appDir ) + { + $_GROUP = array(); + + if ( is_file( IPSLib::getAppDir( $appDir ) . '/extensions/coreVariables.php' ) ) + { + require( IPSLib::getAppDir( $appDir ) . '/extensions/coreVariables.php' );/*noLibHook*/ + } + + return is_array($_GROUP) ? $_GROUP : array(); + } + + /** + * Has Search extension + * + * @param string $appDir Application directory + * @return @e boolean + */ + protected function _getHasExtensionSearch( $appDir ) + { + if ( is_file( IPSLib::getAppDir( $appDir ) . '/extensions/search/config.php' ) ) + { + return true; + } + + return false; + } + /** * Recache main version number * - * @return void + * @return @e void */ public function versionNumbersRecache() { - $numbers = IPSLib::fetchVersionNumber(); + $numbers = IPSLib::fetchVersionNumber(); $this->cache->setCache( 'vnums', $numbers, array( 'array' => 1, 'donow' => 1 ) ); } @@ -2167,221 +2782,226 @@ class admin_core_applications_applications extends ipsCommand /** * Recache menu data * - * @return void + * @return @e void */ public function applicationsMenuDataRecache() - { + { $app_menu_cache = array(); + $modules_cache = array(); + + //----------------------------------------- + // Get module data first in one query + //----------------------------------------- + - $this->DB->build( array( - 'select' => '*', - 'from' => 'core_applications', - 'order' => 'app_position ASC' ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'order' => 'sys_module_position ASC' ) ); + $this->DB->execute(); + + while ( $module = $this->DB->fetch() ) + { + $modules_cache[$module['sys_module_application']][] = $module['sys_module_key']; + } + + //----------------------------------------- + // Now get applications and loop + //----------------------------------------- + + + $this->DB->build( array( 'select' => '*', 'from' => 'core_applications', 'order' => 'app_position ASC' ) ); $outer = $this->DB->execute(); - - - while( $row = $this->DB->fetch( $outer ) ) + + while ( $row = $this->DB->fetch( $outer ) ) { $app_dir = $row['app_directory']; - $main_items = array(); - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_module', - 'where' => "sys_module_application='" . $app_dir . "'", - 'order' => 'sys_module_position ASC' ) ); - $inner = $this->DB->execute(); - - while( $module = $this->DB->fetch( $inner ) ) - { - $main_items[] = $module['sys_module_key']; - } + $main_items = $modules_cache[$app_dir]; //----------------------------------------- // Continue... //----------------------------------------- - - foreach( $main_items as $_current_module ) + + if( count($main_items) ) { - $_file = IPSLib::getAppDir( $app_dir ) . "/modules_admin/" . $_current_module . '/xml/menu.xml'; - - if ( file_exists( $_file ) ) + foreach( $main_items as $_current_module ) { - //----------------------------------------- - // Get xml mah-do-dah - //----------------------------------------- + $_file = IPSLib::getAppDir( $app_dir ) . "/modules_admin/" . $_current_module . '/xml/menu.xml'; - require_once( IPS_KERNEL_PATH . 'classXML.php' ); - $xml = new classXML( IPS_DOC_CHAR_SET ); - - $content = @file_get_contents( $_file ); - - if ( $content ) + if ( is_file( $_file ) ) { - $xml->loadXML( $content ); - $menu = $xml->fetchXMLAsArray(); - $item = array(); - $subItemIndex = 0; - $itemIndex = 0; - - /** - * Easiest way I could find to get the data in a proper multi-dimensional array - */ - - foreach( $menu as $id => $data ) + //----------------------------------------- + // Get xml mah-do-dah + //----------------------------------------- + + + require_once ( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + + $content = @file_get_contents( $_file ); + + if ( $content ) { - foreach( $data as $dataKey => $dataValue ) + $xml->loadXML( $content ); + $menu = $xml->fetchXMLAsArray(); + $item = array(); + $subItemIndex = 0; + $itemIndex = 0; + + /** + * Easiest way I could find to get the data in a proper multi-dimensional array + */ + foreach( $menu as $id => $data ) { - if( $dataKey == 'tabitems' ) + foreach( $data as $dataKey => $dataValue ) { - foreach( $dataValue as $tabitemsKey => $tabItemsValue ) + if ( $dataKey == 'tabitems' ) { - if( $tabitemsKey == 'item' ) + foreach( $dataValue as $tabitemsKey => $tabItemsValue ) { - foreach( $tabItemsValue as $itemKey => $itemValue ) + if ( $tabitemsKey == 'item' ) { - if( is_int($itemKey) ) + foreach( $tabItemsValue as $itemKey => $itemValue ) { - foreach( $itemValue as $_itemKey => $_itemValue ) + if ( is_int( $itemKey ) ) { - $subItemIndex = 0; - - if( $_itemKey == 'title' or $_itemKey == 'condition' ) + foreach( $itemValue as $_itemKey => $_itemValue ) { - $item[ $itemIndex ][ $_itemKey ] = $_itemValue['#alltext']; - } - else if( $_itemKey == 'subitems' ) - { - foreach( $_itemValue as $subitemKey => $subitemValue ) + $subItemIndex = 0; + + if ( $_itemKey == 'title' or $_itemKey == 'condition' ) { - if( $subitemKey != '#alltext' ) + $item[$itemIndex][$_itemKey] = $_itemValue['#alltext']; + } + else if ( $_itemKey == 'subitems' ) + { + foreach( $_itemValue as $subitemKey => $subitemValue ) { - foreach( $subitemValue as $subitemRealKey => $subitemRealValue ) + if ( $subitemKey != '#alltext' ) { - if( is_int( $subitemRealKey ) ) + foreach( $subitemValue as $subitemRealKey => $subitemRealValue ) { - foreach( $subitemRealValue as $_subitemRealKey => $_subitemRealValue ) + if ( is_int( $subitemRealKey ) ) { - if( $_subitemRealKey != '#alltext' ) + foreach( $subitemRealValue as $_subitemRealKey => $_subitemRealValue ) { - $item[ $itemIndex ][ $_itemKey ][ $subitemKey ][ $subItemIndex ][ $_subitemRealKey ] = $_subitemRealValue['#alltext']; + if ( $_subitemRealKey != '#alltext' ) + { + $item[$itemIndex][$_itemKey][$subitemKey][$subItemIndex][$_subitemRealKey] = $_subitemRealValue['#alltext']; + } } } - } - else if( $subitemRealKey != '#alltext' ) - { - $item[ $itemIndex ][ $_itemKey ][ $subitemKey ][ $subItemIndex ][ $subitemRealKey ] = $subitemRealValue['#alltext']; + else if ( $subitemRealKey != '#alltext' ) + { + $item[$itemIndex][$_itemKey][$subitemKey][$subItemIndex][$subitemRealKey] = $subitemRealValue['#alltext']; + } + + if ( is_int( $subitemRealKey ) ) + { + $subItemIndex ++; + } } - if( is_int( $subitemRealKey ) ) + $subItemIndex ++; + } + } + } + } + + $itemIndex ++; + } + else if ( $itemKey == 'title' ) + { + $item[$itemIndex][$itemKey] = $itemValue['#alltext']; + } + else if ( $itemKey == 'subitems' ) + { + foreach( $itemValue as $subitemKey => $subitemValue ) + { + if ( $subitemKey != '#alltext' ) + { + foreach( $subitemValue as $subitemRealKey => $subitemRealValue ) + { + if ( is_int( $subitemRealKey ) ) + { + foreach( $subitemRealValue as $_subitemRealKey => $_subitemRealValue ) { - $subItemIndex++; + if ( $_subitemRealKey != '#alltext' ) + { + $item[$itemIndex][$itemKey][$subitemKey][$subItemIndex][$_subitemRealKey] = $_subitemRealValue['#alltext']; + } } } + else if ( $subitemRealKey != '#alltext' ) + { + $item[$itemIndex][$itemKey][$subitemKey][$subItemIndex][$subitemRealKey] = $subitemRealValue['#alltext']; + } - $subItemIndex++; - } - } - } - } - - $itemIndex++; - } - else if( $itemKey == 'title' ) - { - $item[ $itemIndex ][ $itemKey ] = $itemValue['#alltext']; - } - else if( $itemKey == 'subitems' ) - { - foreach( $itemValue as $subitemKey => $subitemValue ) - { - if( $subitemKey != '#alltext' ) - { - foreach( $subitemValue as $subitemRealKey => $subitemRealValue ) - { - if( is_int( $subitemRealKey ) ) - { - foreach( $subitemRealValue as $_subitemRealKey => $_subitemRealValue ) + if ( is_int( $subitemRealKey ) ) { - if( $_subitemRealKey != '#alltext' ) - { - $item[ $itemIndex ][ $itemKey ][ $subitemKey ][ $subItemIndex ][ $_subitemRealKey ] = $_subitemRealValue['#alltext']; - } + $subItemIndex ++; } } - else if( $subitemRealKey != '#alltext' ) - { - $item[ $itemIndex ][ $itemKey ][ $subitemKey ][ $subItemIndex ][ $subitemRealKey ] = $subitemRealValue['#alltext']; - } - if( is_int( $subitemRealKey ) ) - { - $subItemIndex++; - } + $subItemIndex ++; } - - $subItemIndex++; } } } + + $itemIndex ++; } - - $itemIndex++; } } } } - } - - foreach( $item as $id => $data ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - if ( $data['condition'] ) - { - $func = create_function( '', $data['condition'] ); - if( ! $func() ) - { - continue; - } - } - - $_cat_title = $data['title']; - $_cat_title = str_replace( '&', '&', $_cat_title ); // Validation thing - $_nav_main_done = 0; - - if ( is_array( $data['subitems'] ) ) + foreach( $item as $id => $data ) { //----------------------------------------- - // Loop.... + // INIT //----------------------------------------- - - foreach( $data['subitems'] as $__data ) + + if ( $data['condition'] ) { - foreach( $__data as $_id => $_data ) + $func = create_function( '', $data['condition'] ); + + if ( ! $func() ) { - $_sub_item_title = $_data['subitemtitle']; - $_sub_item_url = $_data['subitemurl']; - $_sub_is_redirect = $_data['subisredirect']; - $_sub_section = $_data['subsection']; - $_sub_keywords = $_data['subitemkeywords']; - $_sub_item_role_key = isset( $_data['subitemrolekey'] ) ? $_data['subitemrolekey'] : ''; - - //----------------------------------------- - // Continue... - //----------------------------------------- + continue; + } + } - if ( $_sub_item_title AND $_sub_section ) + $_cat_title = $data['title']; + $_cat_title = str_replace( '&', '&', $_cat_title ); // Validation thing + $_nav_main_done = 0; + + if ( is_array( $data['subitems'] ) ) + { + //----------------------------------------- + // Loop.... + //----------------------------------------- + + + foreach( $data['subitems'] as $__data ) + { + foreach( $__data as $_id => $_data ) { - $app_menu_cache[ $app_dir ][ $id . '_' . $_current_module ]['title'] = $_cat_title; - $app_menu_cache[ $app_dir ][ $id . '_' . $_current_module ]['items'][ $_id ] = array( 'title' => $_sub_item_title, - 'module' => $_current_module, - 'keywords' => $_sub_keywords, - 'section' => $_sub_section, - 'url' => $_sub_item_url, - 'rolekey' => $_sub_item_role_key, - 'redirect' => $_sub_is_redirect ); + $_sub_item_title = $_data['subitemtitle']; + $_sub_item_url = $_data['subitemurl']; + $_sub_is_redirect = $_data['subisredirect']; + $_sub_section = $_data['subsection']; + $_sub_keywords = $_data['subitemkeywords']; + $_sub_item_role_key = isset( $_data['subitemrolekey'] ) ? $_data['subitemrolekey'] : ''; + $_sub_language = $_data['subitemlang']; + + //----------------------------------------- + // Continue... + //----------------------------------------- + + + if ( $_sub_item_title and $_sub_section ) + { + $app_menu_cache[$app_dir][$id . '_' . $_current_module]['title'] = $_cat_title; + $app_menu_cache[$app_dir][$id . '_' . $_current_module]['items'][$_id] = array( 'title' => $_sub_item_title, 'module' => $_current_module, 'langkey' => $_sub_language, 'keywords' => $_sub_keywords, 'section' => $_sub_section, 'url' => $_sub_item_url, 'rolekey' => $_sub_item_role_key, 'redirect' => $_sub_is_redirect ); + } } } } @@ -2393,5 +3013,5 @@ class admin_core_applications_applications extends ipsCommand } $this->cache->setCache( 'app_menu_cache', $app_menu_cache, array( 'array' => 1 ) ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/blog.php b/upload/admin/applications/core/modules_admin/applications/blog.php index 9ae91163..9a9a5193 100644 --- a/upload/admin/applications/core/modules_admin/applications/blog.php +++ b/upload/admin/applications/core/modules_admin/applications/blog.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Blog Application
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th Aug 2004 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ * */ @@ -30,14 +30,13 @@ class admin_core_applications_blog extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://betscms.ws"); + $this->registry->output->showInsideIframe("http://myipb.in/products/blog/"); } } diff --git a/upload/admin/applications/core/modules_admin/applications/ccs.php b/upload/admin/applications/core/modules_admin/applications/ccs.php index 8f24e0ac..db17a93c 100644 --- a/upload/admin/applications/core/modules_admin/applications/ccs.php +++ b/upload/admin/applications/core/modules_admin/applications/ccs.php @@ -2,18 +2,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Blog Application
- * Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Revision: 7126 $ + * @link http://hatynka.in + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -27,14 +27,13 @@ class admin_core_applications_ccs extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://betscms.ws"); + $this->registry->output->showInsideIframe("http://myipb.in/products/content/"); } } diff --git a/upload/admin/applications/core/modules_admin/applications/copyright.php b/upload/admin/applications/core/modules_admin/applications/copyright.php index 152f1a8b..49ae3ac7 100644 --- a/upload/admin/applications/core/modules_admin/applications/copyright.php +++ b/upload/admin/applications/core/modules_admin/applications/copyright.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Download Manager Application
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-05-11 12:57:46 -0400 (Wed, 11 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 17 February 2003 - * @version $Revision: 5713 $ + * @version $Revision: 8727 $ * */ @@ -30,7 +30,6 @@ class admin_core_applications_copyright extends ipsCommand /** * HTML skin * - * @access public * @var object Skin file */ public $html; @@ -38,9 +37,8 @@ class admin_core_applications_copyright extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -65,6 +63,6 @@ class admin_core_applications_copyright extends ipsCommand // Just redirect to the setting //----------------------------------------- - $this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=core&module=tools§ion=settings&do=setting_view&conf_title_keyword=ipbcopyright' ); + $this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=core&module=settings&section=settings&do=setting_view&conf_title_keyword=ipbcopyright' ); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/defaultSection.php b/upload/admin/applications/core/modules_admin/applications/defaultSection.php index bc631329..6544fecb 100644 --- a/upload/admin/applications/core/modules_admin/applications/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/applications/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default applications section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'applications' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'applications'; \ No newline at end of file +$DEFAULT_SECTION = 'applications'; diff --git a/upload/admin/applications/core/modules_admin/applications/downloads.php b/upload/admin/applications/core/modules_admin/applications/downloads.php index 9da15c51..ee622500 100644 --- a/upload/admin/applications/core/modules_admin/applications/downloads.php +++ b/upload/admin/applications/core/modules_admin/applications/downloads.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Download Manager Application
- * Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 7126 $ + * @version $Revision: 8644 $ * */ @@ -30,14 +30,13 @@ class admin_core_applications_downloads extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://betscms.ws"); + $this->registry->output->showInsideIframe("http://myipb.in/products/downloads/"); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/gallery.php b/upload/admin/applications/core/modules_admin/applications/gallery.php index 67573dfb..e358991d 100644 --- a/upload/admin/applications/core/modules_admin/applications/gallery.php +++ b/upload/admin/applications/core/modules_admin/applications/gallery.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Gallery Application
- * Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 7126 $ + * @version $Revision: 8644 $ * */ @@ -30,14 +30,13 @@ class admin_core_applications_gallery extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://betscms.ws"); + $this->registry->output->showInsideIframe("http://myipb.in/products/gallery/"); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/hooks.php b/upload/admin/applications/core/modules_admin/applications/hooks.php index 0fea5cc6..50b6e3d5 100644 --- a/upload/admin/applications/core/modules_admin/applications/hooks.php +++ b/upload/admin/applications/core/modules_admin/applications/hooks.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Hooks Management
- * Last Updated: $Date: 2010-10-19 08:45:58 -0400 (Tue, 19 Oct 2010) $
+ * Last Updated: $Date: 2011-10-07 22:31:51 -0400 (Fri, 07 Oct 2011) $
  * 
* - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 3.0.0 - * @version $Revision: 6994 $ + * @version $Revision: 9588 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,7 +30,7 @@ class admin_core_applications_hooks extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Hooks library @@ -46,11 +46,19 @@ class admin_core_applications_hooks extends ipsCommand */ protected $hooks; + /** + * Array of all the cache versions + * for the required applications + * + * @var $cachedVersions + */ + protected $cachedVersions = array(); + /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -67,14 +75,15 @@ class admin_core_applications_hooks extends ipsCommand $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/hooksFunctions.php', 'hooksFunctions' ); $this->hooksFunctions = new $classToLoad( $registry ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ) ); + // lang already loaded by hookFunctions + //$this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ), 'core' ); //----------------------------------------- // Set up stuff //----------------------------------------- - $this->form_code = $this->html->form_code = 'module=applications&section=hooks'; - $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=hooks'; + $this->form_code = $this->html->form_code = 'module=applications&section=hooks&'; + $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=hooks&'; //----------------------------------------- // What to do... @@ -155,11 +164,6 @@ class admin_core_applications_hooks extends ipsCommand $this->_hookSave( 'edit' ); break; - case 'skinsRebuild': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_rebuildSkins(); - break; - case 'removeDeadCaches': $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); $this->removeDeadCaches(); @@ -189,7 +193,7 @@ class admin_core_applications_hooks extends ipsCommand /** * Reimport all hooks for all installed applications * - * @return void + * @return @e void */ protected function reimportAppHooks() { @@ -204,36 +208,31 @@ class admin_core_applications_hooks extends ipsCommand $stats['skipped'] = $stats['skipped'] + $_stats['skipped']; } - //----------------------------------------- - // Message - //----------------------------------------- - - $this->registry->output->global_message = sprintf( $this->lang->words['app_hooks_rebuilt'], $stats['inserted'], $stats['updated'], $stats['skipped'] ); - - //----------------------------------------- - // Recache hooks so templates know that there - // are comments to preserve - //----------------------------------------- - + /* Rebuild cache */ $this->rebuildHooksCache(); - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} - /* Flag all for recache */ + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); $skinCaching->flagSetForRecache(); - /* Print message */ - - $this->_hooksOverview(); + /* Redirect */ + $this->registry->output->global_message = sprintf( $this->lang->words['app_hooks_rebuilt'], $stats['inserted'], $stats['updated'], $stats['skipped'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); } /** * Rebuild skins following hook import that included a template * - * @return void + * @return @e void */ protected function removeDeadCaches() { @@ -254,7 +253,7 @@ class admin_core_applications_hooks extends ipsCommand try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'hooks' ) as $file ) + foreach( new DirectoryIterator( IPS_HOOKS_PATH ) as $file ) { if ( ! $file->isDot() ) { @@ -276,79 +275,21 @@ class admin_core_applications_hooks extends ipsCommand { foreach( $unlink as $file ) { - @unlink( DOC_IPS_ROOT_PATH . 'hooks/' . $file ); + @unlink( IPS_HOOKS_PATH . $file ); } } /* Print message */ - $this->registry->output->global_message = count( $unlink ) . " Cached Hook Files Removed
" . implode( "
", $unlink ); - $this->_hooksOverview(); - } - - /** - * Rebuild skins following hook import that included a template - * - * @return void - */ - protected function _rebuildSkins() - { - $setID = intval( $this->request['setID'] ); - - if( $setID ) - { - //----------------------------------------- - // Get the libs - //----------------------------------------- - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); - - $skinCaching->rebuildPHPTemplates( $setID ); - - /* Fetch next id */ - $nextID = $setID; - - ksort( $this->registry->output->allSkins ); - - foreach( $this->registry->output->allSkins as $id => $data ) - { - if ( $id > $nextID ) - { - $nextID = $id; - break; - } - } - - if ( $nextID != $setID ) - { - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ) ); - - /* More to go.. */ - $this->registry->output->redirect( $this->settings['base_url'] . 'app=core&module=applications§ion=hooks&do=skinsRebuild&setID=' . $nextID, $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ); - } - } - - //----------------------------------------- - // Must be all done! - //----------------------------------------- - - $message = ipsRegistry::getClass('adminFunctions')->staffGetCookie( 'hookResult' ); - ipsRegistry::getClass('adminFunctions')->staffSaveCookie( 'hookResult', '' ); - - $this->registry->output->global_message = $message; - - $this->rebuildHooksCache(); - + $this->registry->output->global_message = sprintf( $this->lang->words['hook_removed_files'], count( $unlink ) ) . '
' . implode( '
', $unlink ); $this->_hooksOverview(); } /** * Reorder hooks * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _reorder() + protected function _reorder() { //----------------------------------------- // INIT @@ -375,6 +316,9 @@ class admin_core_applications_hooks extends ipsCommand if( is_array($this->request['hooks']) AND count($this->request['hooks']) ) { + /* Reset all hooks to 0 temporarily */ + $this->DB->update( 'core_hooks', array( 'hook_position' => 0 ) ); + foreach( $this->request['hooks'] as $this_id ) { $this->DB->update( 'core_hooks', array( 'hook_position' => $position ), 'hook_id=' . $this_id ); @@ -394,7 +338,7 @@ class admin_core_applications_hooks extends ipsCommand * * @return void */ - private function _installHook() + protected function _installHook() { //----------------------------------------- // Get uploaded schtuff @@ -410,11 +354,29 @@ class admin_core_applications_hooks extends ipsCommand $this->registry->output->showError( $this->lang->words['h_noxml'], 1110 ); } - $this->installHook( $content, TRUE ); + $this->installHook( $content, TRUE, FALSE ); + /* Rebuild cache */ $this->rebuildHooksCache(); - $this->_hooksOverview(); + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + + /* Redirect */ + $_msg = $this->registry->output->global_message; + $this->registry->output->global_message = ''; + + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview', $_msg ); } /** @@ -422,18 +384,16 @@ class admin_core_applications_hooks extends ipsCommand * Inserts new hooks * * @param string Application to install hooks for - * @todo Figure out how to upgrade hooks properly (db updates / template updates / file updates, etc) */ public function installAppHooks( $app ) { static $hooks = array(); $msgs = array( 'inserted' => 0, 'updated' => 0, 'skipped' => 0 ); - $hooks = array(); $xmlData = array(); $path = IPSLib::getAppDir( $app ) . '/xml'; - if ( file_exists( $path . '/hooks.xml' ) AND is_dir( $path . '/hooks' ) ) + if ( is_file( $path . '/hooks.xml' ) AND is_dir( $path . '/hooks' ) ) { if( !count($hooks) ) { @@ -452,7 +412,7 @@ class admin_core_applications_hooks extends ipsCommand } /* Alright. We're in. Read the XML file */ - require_once( IPS_KERNEL_PATH . 'classXML.php' ); + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); /* Grab wrapper file */ @@ -468,7 +428,7 @@ class admin_core_applications_hooks extends ipsCommand { foreach( $xmlData as $x ) { - if ( file_exists( $path . '/hooks/' . $x['file'] ) ) + if ( is_file( $path . '/hooks/' . $x['file'] ) ) { $xml->load( $path . '/hooks/' . $x['file'] ); @@ -503,7 +463,7 @@ class admin_core_applications_hooks extends ipsCommand * @param boolean Add message to output->global_message * @param boolean Allow skins to recache * @param int Install enabled - * @return void + * @return @e void */ public function installHook( $content, $addMessage=FALSE, $allowSkinRecache=TRUE, $enabled=1 ) { @@ -540,7 +500,7 @@ class admin_core_applications_hooks extends ipsCommand // Get xml mah-do-dah //----------------------------------------- - require_once( IPS_KERNEL_PATH . 'classXML.php' ); + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); //----------------------------------------- @@ -563,34 +523,34 @@ class admin_core_applications_hooks extends ipsCommand // Temp //----------------------------------------- - $tempExtraData = unserialize( $config['hook_extra_data'] ); + $tempExtraData = unserialize( $config['hook_extra_data'] ); //----------------------------------------- // Set config //----------------------------------------- - $config = array( - 'hook_name' => $config['hook_name'], - 'hook_desc' => $config['hook_desc'], - 'hook_author' => $config['hook_author'], - 'hook_email' => $config['hook_email'], - 'hook_website' => $config['hook_website'], - 'hook_update_check' => $config['hook_update_check'], - 'hook_requirements' => $config['hook_requirements'], - 'hook_version_human' => $config['hook_version_human'], - 'hook_version_long' => $config['hook_version_long'], - 'hook_key' => $config['hook_key'], - 'hook_enabled' => $enabled, - 'hook_updated' => time(), - ); + $config = array('hook_name' => $config['hook_name'], + 'hook_desc' => $config['hook_desc'], + 'hook_author' => $config['hook_author'], + 'hook_email' => $config['hook_email'], + 'hook_website' => $config['hook_website'], + 'hook_update_check' => $config['hook_update_check'], + 'hook_requirements' => $config['hook_requirements'], + 'hook_version_human' => $config['hook_version_human'], + 'hook_version_long' => $config['hook_version_long'], + 'hook_key' => $config['hook_key'], + 'hook_global_caches' => $config['hook_global_caches'], + 'hook_enabled' => $enabled, + 'hook_updated' => IPS_UNIX_TIME_NOW, + ); - $extra_data = array(); + $extra_data = array(); //----------------------------------------- // Set files //----------------------------------------- - $files = array(); + $files = array(); foreach( $xml->fetchElements('hookfiles') as $node ) { @@ -600,7 +560,7 @@ class admin_core_applications_hooks extends ipsCommand if( $file['hook_type'] ) { - $files[] = array( + $files[] = array( 'hook_file_real' => $file['hook_file_real'], 'hook_type' => $file['hook_type'], 'hook_classname' => $file['hook_classname'], @@ -625,9 +585,8 @@ class admin_core_applications_hooks extends ipsCommand if( count($file) ) { - $custom = array( - 'filename' => $file['filename'], - 'source' => $file['source'], + $custom = array( 'filename' => $file['filename'], + 'source' => $file['source'], ); } } @@ -691,12 +650,12 @@ class admin_core_applications_hooks extends ipsCommand $langbit = $xml->fetchElementsFromRecord( $_langbit ); $language[] = array( - 'word_app' => $langbit['word_app'], - 'word_pack' => $langbit['word_pack'], - 'word_key' => $langbit['word_key'], - 'word_default' => $langbit['word_default'], - 'word_custom' => $langbit['word_custom'], - 'word_js' => $langbit['word_js'], + 'word_app' => $langbit['word_app'], + 'word_pack' => $langbit['word_pack'], + 'word_key' => $langbit['word_key'], + 'word_default' => $langbit['word_default'], + 'word_custom' => $langbit['word_custom'], + 'word_js' => $langbit['word_js'], ); } } @@ -757,7 +716,6 @@ class admin_core_applications_hooks extends ipsCommand foreach( $xml->fetchElements('templates', $node) as $_template ) { $template = $xml->fetchElementsFromRecord( $_template ); - $templates[] = array( 'template_set_id' => 0, 'template_group' => $template['template_group'], @@ -766,16 +724,16 @@ class admin_core_applications_hooks extends ipsCommand 'template_data' => $template['template_data'], 'template_updated' => $template['template_updated'], 'template_removable' => $template['template_removable'], - 'template_added_to' => $template['template_added_to'], + 'template_added_to' => intval($template['template_added_to']), 'template_user_added' => 1, 'template_user_edited' => 0, - 'template_master_key' => ( $template['template_master_key'] ) ? $template['template_master_key'] : 'root', + 'template_master_key' => $template['template_master_key'] ? $template['template_master_key'] : 'root', ); } } //----------------------------------------- - // Set the tasks + // Set the CSS //----------------------------------------- $css = array(); @@ -784,7 +742,7 @@ class admin_core_applications_hooks extends ipsCommand { foreach( $xml->fetchElements('css', $node) as $_css ) { - $_css = $xml->fetchElementsFromRecord( $_css ); + $_css = $xml->fetchElementsFromRecord( $_css ); $css[] = array( 'css_set_id' => 0, 'css_group' => $_css['css_group'], @@ -796,7 +754,7 @@ class admin_core_applications_hooks extends ipsCommand 'css_attributes' => $_css['css_attributes'], 'css_removed' => $_css['css_removed'], 'css_modules' => $_css['css_modules'], - 'css_master_key' => ( $_css['css_master_key'] ) ? $_css['css_master_key'] : $_css['css_master_key'] + 'css_master_key' => $_css['css_master_key'], ); } } @@ -813,20 +771,20 @@ class admin_core_applications_hooks extends ipsCommand { $task = $xml->fetchElementsFromRecord( $_task ); $tasks[] = array( - 'task_title' => $task['task_title'], - 'task_file' => $task['task_file'], - 'task_week_day' => $task['task_week_day'], - 'task_month_day' => $task['task_month_day'], - 'task_hour' => $task['task_hour'], - 'task_minute' => $task['task_minute'], - 'task_cronkey' => $task['task_cronkey'], - 'task_log' => $task['task_log'], - 'task_description' => $task['task_description'], - 'task_enabled' => $task['task_enabled'], - 'task_key' => $task['task_key'], - 'task_safemode' => $task['task_safemode'], - 'task_locked' => $task['task_locked'], - 'task_application' => $task['task_application'], + 'task_title' => $task['task_title'], + 'task_file' => $task['task_file'], + 'task_week_day' => $task['task_week_day'], + 'task_month_day' => $task['task_month_day'], + 'task_hour' => $task['task_hour'], + 'task_minute' => $task['task_minute'], + 'task_cronkey' => $task['task_cronkey'], + 'task_log' => $task['task_log'], + 'task_description' => $task['task_description'], + 'task_enabled' => $task['task_enabled'], + 'task_key' => $task['task_key'], + 'task_safemode' => $task['task_safemode'], + 'task_locked' => $task['task_locked'], + 'task_application' => $task['task_application'], ); } } @@ -848,9 +806,9 @@ class admin_core_applications_hooks extends ipsCommand { $table = $xml->fetchElementsFromRecord( $_table ); $database['create'][] = array( - 'name' => $table['name'], - 'fields' => $table['fields'], - 'tabletype' => $table['tabletype'], + 'name' => $table['name'], + 'fields' => $table['fields'], + 'tabletype' => $table['tabletype'], ); } } @@ -861,12 +819,12 @@ class admin_core_applications_hooks extends ipsCommand { $table = $xml->fetchElementsFromRecord( $_table ); $database['alter'][] = array( - 'altertype' => $table['altertype'], - 'table' => $table['table'], - 'field' => $table['field'], - 'newfield' => $table['newfield'], - 'fieldtype' => $table['fieldtype'], - 'default' => $table['default'], + 'altertype' => $table['altertype'], + 'table' => $table['table'], + 'field' => $table['field'], + 'newfield' => $table['newfield'], + 'fieldtype' => $table['fieldtype'], + 'default' => $table['default'], ); } } @@ -892,9 +850,9 @@ class admin_core_applications_hooks extends ipsCommand { $table = $xml->fetchElementsFromRecord( $_table ); $database['insert'][] = array( - 'table' => $table['table'], - 'updates' => $table['updates'], - 'fordelete' => $table['fordelete'], + 'table' => $table['table'], + 'updates' => $table['updates'], + 'fordelete' => $table['fordelete'], ); } } @@ -915,7 +873,7 @@ class admin_core_applications_hooks extends ipsCommand $helpUpdated = 0; $templatesInserted = 0; $templatesUpdated = 0; - $templateHooks = 0; + $templateHooks = false; $tasksInserted = 0; $tasksUpdated = 0; $createQueries = 0; @@ -933,7 +891,8 @@ class admin_core_applications_hooks extends ipsCommand { if ( $_f['hook_type'] AND $_f['hook_type'] == 'templateHooks' ) { - $templateHooks++; + $templateHooks = true; + break; } } @@ -960,14 +919,14 @@ class admin_core_applications_hooks extends ipsCommand } else { - $config['hook_installed'] = time(); + $config['hook_installed'] = IPS_UNIX_TIME_NOW; $this->hook[ $config['hook_key'] ] = $config; $this->DB->insert( 'core_hooks', $config ); $hook_id = $this->DB->getInsertId(); - $this->hook[ $config['hook_key'] ]['hook_id'] = $hook_id; + $this->hook[ $config['hook_key'] ]['hook_id'] = $hook_id; $extra_data['display'] = $tempExtraData['display']; } @@ -999,7 +958,7 @@ class admin_core_applications_hooks extends ipsCommand $filename = $file['hook_classname'] . '_' . md5( uniqid( microtime(), true ) ) . '.php'; file_put_contents( IPS_HOOKS_PATH . $filename, $file['hooks_source'] ); - chmod( IPS_HOOKS_PATH . $filename, 0777 ); + chmod( IPS_HOOKS_PATH . $filename, IPS_FILE_PERMISSION ); $file['hook_file_stored'] = $filename; $file['hook_hook_id'] = $hook_id; @@ -1016,6 +975,7 @@ class admin_core_applications_hooks extends ipsCommand if( $custom['source'] AND $custom['filename'] ) { file_put_contents( IPS_HOOKS_PATH . "install_" . $custom['filename'], $custom['source'] ); + chmod( IPS_HOOKS_PATH . "install_" . $custom['filename'], IPS_FILE_PERMISSION ); } //----------------------------------------- @@ -1026,7 +986,7 @@ class admin_core_applications_hooks extends ipsCommand { $setting_groups = array(); - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_title' ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -1039,10 +999,7 @@ class admin_core_applications_hooks extends ipsCommand // Get current settings. //----------------------------------------- - $this->DB->build( array( 'select' => 'conf_id, conf_key', - 'from' => 'core_sys_conf_settings', - 'order' => 'conf_id' ) ); - + $this->DB->build( array( 'select' => 'conf_id, conf_key', 'from' => 'core_sys_conf_settings' ) ); $this->DB->execute(); while ( $r = $this->DB->fetch() ) @@ -1081,7 +1038,7 @@ class admin_core_applications_hooks extends ipsCommand $this->DB->insert( 'core_sys_settings_titles', $save ); $conf_id = $this->DB->getInsertId(); $settingGroupsInserted++; - $extra_data['settingGroups'][] = $conf_id; + $extra_data['settingGroups'][] = $save['conf_title_keyword']; } else { @@ -1130,8 +1087,7 @@ class admin_core_applications_hooks extends ipsCommand { $this->DB->insert( 'core_sys_conf_settings', $data ); $settingsInserted++; - $conf_id = $this->DB->getInsertId(); - $extra_data['settings'][] = $conf_id; + $extra_data['settings'][] = $data['conf_key']; } } } @@ -1144,7 +1100,7 @@ class admin_core_applications_hooks extends ipsCommand { foreach( $need_update as $i => $idx ) { - $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group='.$idx ) ); + $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $idx ) ); $count = intval($conf['count']); @@ -1244,7 +1200,7 @@ class admin_core_applications_hooks extends ipsCommand $this->DB->insert( 'core_sys_module', $module ); $modulesInserted++; $module_id = $this->DB->getInsertId(); - $extra_data['modules'][] = $module_id; + $extra_data['modules'][] = ( $module['sys_module_admin'] ? 'admin' : 'public' ) . '-' . $module['sys_module_application'] . '-' . $module['sys_module_key']; } } @@ -1283,7 +1239,7 @@ class admin_core_applications_hooks extends ipsCommand $this->DB->insert( 'faq', $entry ); $helpInserted++; $help_id = $this->DB->getInsertId(); - $extra_data['help'][] = $help_id; + $extra_data['help'][] = $entry['title']; } } } @@ -1297,27 +1253,52 @@ class admin_core_applications_hooks extends ipsCommand $bits = array(); /* Root will always be updated */ - $this->DB->build( array( 'select' => 'template_name,template_group', 'from' => 'skin_templates', 'where' => 'template_set_id=0 AND template_master_key=\'root\'' ) ); + $this->DB->build( array( 'select' => 'template_name,template_group,template_master_key', 'from' => 'skin_templates' ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) { - $bits[ $r['template_group'] ][] = $r['template_name']; + $bits[ $r['template_master_key'] ][ $r['template_group'] ][] = $r['template_name']; } foreach( $templates as $template ) { - if( is_array($bits[ $template['template_group'] ]) AND in_array( $template['template_name'], $bits[ $template['template_group'] ] ) ) + //----------------------------------------- + // If template is not in root set, add it to + // prevent fatal error selecting other skins + //----------------------------------------- + + if ( $template['template_master_key'] != 'root' && ( !isset($bits['root'][ $template['template_group'] ]) OR !in_array( $template['template_name'], $bits['root'][ $template['template_group'] ] ) ) ) { - $this->DB->update( 'skin_templates', $template, "template_group='{$template['template_group']}' AND template_name='{$template['template_name']}'" ); + $this->DB->insert( 'skin_templates', array_merge( $template, array( 'template_set_id' => 0, 'template_master_key' => 'root', 'template_content' => '' ) ) ); + + $extra_data['templates'][ $template['template_group'] ][ $template['template_name'] ] = $template['template_name']; + $bits['root'][ $template['template_group'] ][] = $template['template_name']; + } + + //----------------------------------------- + // Ignore unknown skin sets + //----------------------------------------- + + if ( !isset($bits[ $template['template_master_key'] ]) ) + { + continue; + } + + if( isset($bits[ $template['template_master_key'] ][ $template['template_group'] ]) AND in_array( $template['template_name'], $bits[ $template['template_master_key'] ][ $template['template_group'] ] ) ) + { + $template['template_updated'] = IPS_UNIX_TIME_NOW; + + $this->DB->update( 'skin_templates', $template, "template_master_key='{$template['template_master_key']}' AND template_group='{$template['template_group']}' AND template_name='{$template['template_name']}'" ); $templatesUpdated++; } else { $this->DB->insert( 'skin_templates', $template ); $templatesInserted++; - $template_id = $this->DB->getInsertId(); - $extra_data['templates'][ $template['template_group'] ][] = $template['template_name']; + + $extra_data['templates'][ $template['template_group'] ][ $template['template_name'] ] = $template['template_name']; + $bits[ $template['template_master_key'] ][ $template['template_group'] ][] = $template['template_name']; } } } @@ -1330,27 +1311,39 @@ class admin_core_applications_hooks extends ipsCommand { $bits = array(); - $this->DB->build( array( 'select' => '*', 'from' => 'skin_css', 'where' => 'css_set_id=0' ) ); + $this->DB->build( array( 'select' => 'css_master_key, css_group', 'from' => 'skin_css' ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) { - $bits[ $r['css_group'] ] = $r; + $bits[ $r['css_master_key'] ][ $r['css_group'] ] = $r['css_group']; } foreach( $css as $entry ) { - if( is_array( $bits[ $entry['css_group'] ] ) AND in_array( $entry['css_group'], $bits[ $entry['css_group'] ] ) ) + //----------------------------------------- + // Ignore unknown skin sets + //----------------------------------------- + + if ( !isset( $bits[ $entry['css_master_key'] ] ) ) { - $this->DB->update( 'skin_css', $entry, "css_group='{$entry['css_group']}'" ); + continue; + } + + if( in_array( $entry['css_group'], $bits[ $entry['css_master_key'] ] ) ) + { + $entry['css_updated'] = IPS_UNIX_TIME_NOW; + + $this->DB->update( 'skin_css', $entry, "css_master_key='{$entry['css_master_key']}' AND css_group='{$entry['css_group']}'" ); $cssUpdated++; } else { $this->DB->insert( 'skin_css', $entry ); $cssInserted++; - $css_id = $this->DB->getInsertId(); - $extra_data['css'][] = $css_id; + + $extra_data['css'][ $entry['css_group'] ] = $entry['css_group']; + $bits[ $entry['css_master_key'] ][ $entry['css_group'] ] = $entry['css_group']; } } } @@ -1383,7 +1376,7 @@ class admin_core_applications_hooks extends ipsCommand $this->DB->insert( 'task_manager', $entry ); $tasksInserted++; $task_id = $this->DB->getInsertId(); - $extra_data['tasks'][] = $task_id; + $extra_data['tasks'][] = $entry['task_key']; } } } @@ -1396,21 +1389,23 @@ class admin_core_applications_hooks extends ipsCommand { foreach($database['create'] as $create ) { - $query = "CREATE TABLE {$create['name']} ( + $query = "CREATE TABLE {$this->settings['sql_tbl_prefix']}{$create['name']} ( {$create['fields']} )"; if( $create['tabletype'] ) { - $query .= " TYPE=" . $create['tabletype']; + $query .= " ENGINE=" . $create['tabletype']; + } + else if( $this->settings['sql_driver'] == 'mysql' AND $this->settings['mysql_tbl_type'] ) + { + $query .= " ENGINE=" . $this->settings['mysql_tbl_type']; } //----------------------------------------- // Fix prefix //----------------------------------------- - - $query = preg_replace( "#^CREATE TABLE(?:\s+?)?(\S+?)#s", "CREATE TABLE " . $this->settings['sql_tbl_prefix']."\\1", $query ); - + $this->DB->return_die = true; $this->DB->query( $query ); $this->DB->return_die = false; @@ -1496,9 +1491,9 @@ class admin_core_applications_hooks extends ipsCommand } // } - if( $custom['filename'] AND file_exists( IPS_HOOKS_PATH . 'install_' . $custom['filename'] ) ) + if( $custom['filename'] AND is_file( IPS_HOOKS_PATH . 'install_' . $custom['filename'] ) ) { - require_once( IPS_HOOKS_PATH . 'install_' . $custom['filename'] ); + require_once( IPS_HOOKS_PATH . 'install_' . $custom['filename'] );/*noLibHook*/ $classname = str_replace( '.php', '', $custom['filename'] ); @@ -1534,7 +1529,7 @@ class admin_core_applications_hooks extends ipsCommand if ( $addMessage ) { - $this->registry->output->global_message = <<lang->words['h_followacts']}
  • {$this->lang->words['h_newhookin']}
  • @@ -1561,30 +1556,23 @@ class admin_core_applications_hooks extends ipsCommand
EOF; - //----------------------------------------- - // Got some skin recaching to do... - //----------------------------------------- + $this->registry->output->setMessage( $_tempMsg, 1 ); + } + + //----------------------------------------- + // Got some skin recaching to do... + //----------------------------------------- + + if( $allowSkinRecache === TRUE AND ( $templatesInserted OR $templatesUpdated OR $templateHooks OR $cssUpdated OR $cssInserted ) ) + { + /* Rebuild cache */ + $this->rebuildHooksCache(); - if( $allowSkinRecache === TRUE AND ( $templatesInserted OR $templatesUpdated OR $templateHooks ) ) - { - //----------------------------------------- - // Recache hooks so templates know that there - // are comments to preserve - //----------------------------------------- - - $this->rebuildHooksCache(); - - //----------------------------------------- - // Get the libs - //----------------------------------------- - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); - - /* Flag all for recache */ - $skinCaching->flagSetForRecache(); - } + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); } } @@ -1593,7 +1581,7 @@ EOF; * * @return void */ - private function _exportHook() + protected function _exportHook() { /* Get the hook */ $id = intval($this->request['id']); @@ -1603,7 +1591,7 @@ EOF; $this->registry->output->showError( $this->lang->words['h_noexport'], 1112 ); } - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); if( !$hookData['hook_id'] ) { @@ -1611,7 +1599,7 @@ EOF; } /* Set defaults */ - $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); + $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); /* Output */ $this->registry->output->html .= $this->html->hooksExport( $hookData ); @@ -1621,9 +1609,9 @@ EOF; * Actually export the damn hook already * Sorry, it has been a long day... * - * @return void + * @return @e void */ - private function _doExportHook() + protected function _doExportHook() { //----------------------------------------- // Get hook @@ -1649,8 +1637,8 @@ EOF; // Get hook files //----------------------------------------- - $files = array(); - $index = 1; + $files = array(); + $index = 1; $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); $this->DB->execute(); @@ -1665,7 +1653,7 @@ EOF; // Get XML class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -1711,7 +1699,7 @@ EOF; $content[ $k ] = $v; } - $source = file_exists( IPS_HOOKS_PATH . $r['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $r['hook_file_stored'] ) : ''; + $source = is_file( IPS_HOOKS_PATH . $r['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $r['hook_file_stored'] ) : ''; if( $r['hook_type'] == 'commandHooks' || $r['hook_type'] == 'libraryHooks' ) { @@ -1733,7 +1721,7 @@ EOF; $xml->addElement( 'hookextras_custom', 'hookexport' ); $content['filename'] = $extra_data['custom']; - $content['source'] = file_exists( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) ? file_get_contents( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) : ''; + $content['source'] = is_file( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) ? file_get_contents( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) : ''; $xml->addElementAsRecord( 'hookextras_custom', 'file', $content ); } @@ -1754,37 +1742,59 @@ EOF; if( is_array($extra_data['settingGroups']) AND count($extra_data['settingGroups']) ) { $_groups = $extra_data['settingGroups']; + $_groupIds = array(); - $this->DB->build( array( 'select' => 'conf_id', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group IN(' . implode( ',', $_groups ) . ')' ) ); + $this->DB->build( array( 'select' => 'conf_title_id', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN('" . implode( "','", $_groups ) . "')" ) ); $this->DB->execute(); - while( $setting = $this->DB->fetch() ) + while( $rr = $this->DB->fetch() ) { - $_settings[] = $setting['conf_id']; + $_groupIds[] = $rr['conf_title_id']; + } + + if( count($_groupIds) ) + { + $this->DB->build( array( 'select' => 'conf_key', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group IN(' . implode( ',', $_groupIds ) . ')' ) ); + $this->DB->execute(); + + while( $setting = $this->DB->fetch() ) + { + $_settings[] = $setting['conf_key']; + } } } # Store group ids and setting ids for indvidual settings if( is_array($extra_data['settings']) AND count($extra_data['settings']) ) { - foreach( $extra_data['settings'] as $settingId ) + foreach( $extra_data['settings'] as $_aSetting ) { - $_settings[] = $settingId; + $_settings[] = $_aSetting; } - $this->DB->build( array( 'select' => 'conf_group', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id IN(' . implode( ',', $extra_data['settings'] ) . ')' ) ); + $this->DB->build( array( 'select' => 't.conf_title_keyword', + 'from' => array( 'core_sys_settings_titles' => 't' ), + 'where' => "c.conf_key IN('" . implode( "','", $extra_data['settings'] ) . "')", + 'add_join' => array( + array( + 'from' => array( 'core_sys_conf_settings' => 'c' ), + 'where' => 'c.conf_group=t.conf_title_id', + 'type' => 'left', + ) + ) + ) ); $this->DB->execute(); while( $group = $this->DB->fetch() ) { - $_groups[] = $group['conf_group']; + $_groups[] = $group['conf_title_keyword']; } } if( count($_groups) ) { # Now get the group data for the XML file - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => 'conf_title_id IN(' . implode( ',', $_groups ) . ')' ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN('" . implode( "','", $_groups ) . "')" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -1810,7 +1820,7 @@ EOF; if( count($_settings) ) { # Now get the group data for the XML file - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id IN(' . implode( ',', $_settings ) . ')' ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key IN('" . implode( "','", $_settings ) . "')" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -1848,7 +1858,7 @@ EOF; foreach( $r as $k => $v ) { - if( in_array( $k, array( 'word_id', 'lang_id', 'word_default_version', 'word_custom_version' ) ) ) + if( !in_array( $k, array( 'word_app', 'word_pack', 'word_key', 'word_default' ) ) ) { continue; } @@ -1894,7 +1904,7 @@ EOF; if( is_array($extra_data['help']) AND count($extra_data['help']) ) { - $this->DB->build( array( 'select' => '*', 'from' => 'faq', 'where' => "id IN(" . implode( ",", $extra_data['help'] ) . ")" ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'faq', 'where' => "title IN('" . implode( "','", $extra_data['help'] ) . "')" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -1909,21 +1919,21 @@ EOF; // Skin templates //----------------------------------------- + $remapData = $this->registry->output->buildRemapData( true ); + $xml->addElement( 'hookextras_templates', 'hookexport' ); if( is_array($extra_data['templates']) AND count($extra_data['templates']) ) { - $templateSetIds = $this->registry->output->buildRemapData( true ); - foreach( $extra_data['templates'] as $file => $templates ) { - $this->DB->build( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id IN ('".implode( "','", $templateSetIds['export']) ."') AND template_group='{$file}' AND template_name IN('" . implode( "','", $templates ) . "')" ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id IN ('" . implode( "','", $remapData['export'] ) . "') AND template_master_key != '' AND template_group='{$file}' AND template_name IN('" . implode( "','", $templates ) . "')" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) { unset($r['template_id']); - $r['template_set_type'] = $templateSetIds['templates'][$r['template_set_id']]; + unset($r['template_set_id']); $xml->addElementAsRecord( 'hookextras_templates', 'templates', $r ); } @@ -1938,7 +1948,7 @@ EOF; if( is_array( $extra_data['css'] ) AND count ( $extra_data['css'] ) ) { - $this->DB->build( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_id IN(" . implode( ",", $extra_data['css'] ) . ")" ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id IN ('" . implode( "','", $remapData['export'] ) . "') AND css_master_key != '' AND css_group IN('" . implode( "','", $extra_data['css'] ) . "')" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -1958,7 +1968,7 @@ EOF; if( is_array($extra_data['tasks']) AND count($extra_data['tasks']) ) { - $this->DB->build( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_id IN(" . implode( ",", $extra_data['tasks'] ) . ")" ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_key IN('" . implode( "','", $extra_data['tasks'] ) . "')" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -2018,7 +2028,7 @@ EOF; // Print to browser //----------------------------------------- - $this->registry->output->showDownload( $xml->fetchDocument(), 'hook.xml', '', 0 ); + $this->registry->output->showDownload( $xml->fetchDocument(), $hookData['hook_key'] . '.xml', '', 0 ); } /** @@ -2027,7 +2037,7 @@ EOF; * @param string Hook source code * @return string "Cleaned" source code */ - private function _cleanSource( $source ) + protected function _cleanSource( $source ) { $source = preg_replace( "/class\s+(\S+)\s+extends\s+(\S+)/i", "class \\1 extends (~extends~)", $source ); @@ -2037,12 +2047,13 @@ EOF; /** * Fix hook positions * - * @return void + * @return @e void */ - private function _fixPositions() + protected function _fixPositions() { - $new_order = 0; - $usedActions = array(); + /* Init vars */ + $new_order = 0; + $usedActions = array(); $this->DB->build( array( 'select' => 'hook_id, hook_position', 'from' => 'core_hooks', 'where' => 'hook_enabled=1', 'order' => 'hook_position ASC' ) ); $qid = $this->DB->execute(); @@ -2052,7 +2063,7 @@ EOF; $new_order++; $this->DB->update( 'core_hooks', array ( 'hook_position' => $new_order ), "hook_id={$hook['hook_id']}" ); - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => "(hook_type='commandHooks' OR hook_type='skinHooks' OR hook_type='libraryHooks') AND hook_hook_id=" . $hook['hook_id'] ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => "hook_type IN ('commandHooks', 'skinHooks', 'libraryHooks' ) AND hook_hook_id=" . $hook['hook_id'] ) ); $this->DB->execute(); while( $file = $this->DB->fetch() ) @@ -2063,34 +2074,36 @@ EOF; } else { - $source = file_exists( IPS_HOOKS_PATH . $file['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $file['hook_file_stored'] ) : ''; + $source = is_file( IPS_HOOKS_PATH . $file['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $file['hook_file_stored'] ) : ''; if( $source ) { $source = $this->_cleanSource( $source ); } } - + if( $source ) { $hook_data = unserialize( $file['hook_data'] ); $overload = $hook_data['classToOverload']; $newClass = $overload; - - if( isset( $usedActions[ $overload ] ) ) + + $app = ( $file['hook_type'] == 'libraryHooks' ) ? trim($hook_data['libApplication']) : '~_NO_APP_~'; + + if( isset( $usedActions[ $app ][ $overload ] ) ) { - $newClass = $usedActions[ $overload ]; + $newClass = $usedActions[ $app ][ $overload ]; } else if( $file['hook_type'] == 'skinHooks' ) { $newClass .= "(~id~)"; } - + $source = str_replace( "(~extends~)", $newClass, $source ); - + file_put_contents( IPS_HOOKS_PATH . $file['hook_file_stored'], $source ); - $usedActions[ $hook_data['classToOverload'] ] = $file['hook_classname']; + $usedActions[ $app ][ $hook_data['classToOverload'] ] = $file['hook_classname']; } } } @@ -2103,72 +2116,79 @@ EOF; * @param string Long version number * @return bool */ - private function _updateAvailable( $url, $version ) + public function _updateAvailable( $url, $version ) { - if( !$version ) + if( empty($url) || $version === '' ) { - //return false; + return false; } $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); $checker = new $classToLoad(); - $checker->use_sockets = $this->settings['enable_sockets']; - //----------------------------------------- - // This is a low timeout to prevent page from taking too long - //----------------------------------------- + /* Timeout to prevent page from taking too long */ + $checker->timeout = 5; - $checker->timeout = 5; + /* Setup url and check */ + $url = str_replace( 'php&', 'php?', $url ); + $url .= '&boardVersion=' . IPB_LONG_VERSION . '&version=' . $version; - $return = $checker->getFileContents( str_replace( 'php&', 'php?', $url . '&version=' . $version ) ); - - return $return == 1 ? true : false; + $return = $checker->getFileContents( $url ); + + /* Return the content (if valid) or return 'no update' */ + return ( strpos( $return, '0' ) === 0 || strpos( $return, '1' ) === 0 ) ? explode( '|', $return ) : array( 0 ); } /** * Hooks overview * - * @return void [Outputs to screen] - * @todo [Future] Explore showing details/version requirements in a DHTML popup rather than a new page + * @return @e void [Outputs to screen] */ - private function _hooksOverview() + public function _hooksOverview() { /* INI */ $installedHooks = array(); $uninstalledHooks = array(); - $min_order = 999999; - $max_order = 0; - $checkUpdates = ( isset( $this->request['checkUpdates'] ) AND $this->request['checkUpdates'] ) ? true : false; + $hookwarnings = 0; + $hookUpdates = 0; + $checkUpdates = !empty( $this->request['checkUpdates'] ) ? true : false; /* Get current hooks */ $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks', 'order' => 'hook_position ASC' ) ); - $this->DB->execute(); + $outer = $this->DB->execute(); - while( $r = $this->DB->fetch() ) + while( $r = $this->DB->fetch($outer) ) { - $r['_updated'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_updated'] ); - $r['_installed'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_installed'] ); + /* Format some dates */ + $r['_updated'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_updated'] ); + $r['_installed'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_installed'] ); - $r['hook_update_available'] = ''; - - if( $r['hook_update_check'] && $checkUpdates === true ) + /* Got updates? */ + if ( $r['hook_update_check'] && $checkUpdates === true ) { - if( $this->_updateAvailable( $r['hook_update_check'], $r['hook_version_long'] ) ) + $r['hook_update_available'] = $this->_updateAvailable( $r['hook_update_check'], $r['hook_version_long'] ); + + if ( $r['hook_update_available'][0] ) { - $r['hook_update_available'] = "Update Available"; - - if( $r['hook_website'] ) - { - $r['hook_update_available'] = "" . $r['hook_update_available'] . ''; - } + $hookUpdates++; } } + else + { + $r['hook_update_available'] = array( 0 ); + } - $min_order = $r['hook_position'] < $min_order ? $r['hook_position'] : $min_order; - $max_order = $r['hook_position'] > $max_order ? $r['hook_position'] : $max_order; - + /* Check requirements */ + $r['_require_errors'] = $this->checkHookRequirements( $r ); + + /* Store */ if( $r['hook_enabled'] ) { + if ( count($r['_require_errors']) ) + { + $hookwarnings++; + } + $installedHooks[ $r['hook_id'] ] = $r; } else @@ -2176,29 +2196,24 @@ EOF; $uninstalledHooks[ $r['hook_id'] ] = $r; } } - - if( count($installedHooks) ) + + /* Got updates to show? */ + $message = NULL; + if ( $checkUpdates === true ) { - foreach( $installedHooks as $id => $r ) - { - $upButton = $r['hook_position'] > $min_order ? 1 : 0; - $downButton = $r['hook_position'] < $max_order ? 1 : 0; - - $installedHooks[ $id ]['upButton'] = $upButton; - $installedHooks[ $id ]['downButton'] = $downButton; - } + $message = ( $hookUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $hookUpdates ); } - + /* Output */ - $this->registry->output->html .= $this->html->hooksOverview( $installedHooks, $uninstalledHooks ); + $this->registry->output->html .= $this->html->hooksOverview( $installedHooks, $uninstalledHooks, $hookwarnings, $message ); } /** * Disables all hook * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _disableAllHooks() + protected function _disableAllHooks() { /* INIT */ $activeHookIds = array(); @@ -2234,7 +2249,12 @@ EOF; $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); } - private function _reenableAllHooks() + /** + * Re-enable all hook + * + * @return @e void [Outputs to screen] + */ + protected function _reenableAllHooks() { /* INIT */ $activeHookIds = $this->cache->getCache( 'disabledHooksCache' ); @@ -2257,8 +2277,8 @@ EOF; $this->rebuildHooksCache(); /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $skinCaching = new skinCaching( $this->registry ); /* Flag all for recache */ @@ -2272,27 +2292,45 @@ EOF; /** * Disables a hook * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _disableHook() + protected function _disableHook() { /* INI */ $hook_id = intval( $this->request['id'] ); - - /* Do update */ - $this->DB->update( 'core_hooks', array( 'hook_enabled' => 0 ), "hook_id={$hook_id}" ); + if( !$hook_id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1118.D' ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1119.D' ); + } + + /* Do update */ + $this->DB->update( 'core_hooks', array( 'hook_enabled' => 0 ), "hook_id={$hookData['hook_id']}" ); + + /* Rebuild cache */ $this->rebuildHooksCache(); - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} - /* Flag all for recache */ + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); $skinCaching->flagSetForRecache(); - /* Done */ + /* Redirect */ $this->registry->output->global_message = $this->lang->words['hook_disabled']; $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); } @@ -2300,27 +2338,56 @@ EOF; /** * Enables a hook * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _enableHook() + protected function _enableHook() { /* INI */ - $hook_id = intval( $this->request['id'] ); - - /* Do update */ - $this->DB->update( 'core_hooks', array( 'hook_enabled' => 1 ), "hook_id={$hook_id}" ); + $hook_id = intval($this->request['id']); + if( !$hook_id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1118.E' ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1119.E' ); + } + + /* Check for requirements */ + if ( empty($this->request['skipRequirements']) ) + { + $errors = $this->checkHookRequirements( $hookData ); + + if ( count($errors) ) + { + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=check_requirements&fromInstall=1&id='.$hook_id ); + } + } + + /* Do update */ + $this->DB->update( 'core_hooks', array( 'hook_enabled' => 1 ), "hook_id={$hookData['hook_id']}" ); + + /* Rebuild cache */ $this->rebuildHooksCache(); - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} - /* Flag all for recache */ + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); $skinCaching->flagSetForRecache(); - /* Done */ + /* Redirect */ $this->registry->output->global_message = $this->lang->words['h_hasbeenenabled']; $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); } @@ -2328,16 +2395,16 @@ EOF; /** * Uninstall a hook * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _uninstallHook() + protected function _uninstallHook() { /* INI */ $hook_id = intval( $this->request['id'] ); - + $hook = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); $extra_data = unserialize( $hook['hook_extra_data'] ); - + if ( ! $hook['hook_id'] ) { $this->registry->output->global_message = $this->lang->words['h_hasbeenun']; @@ -2362,16 +2429,16 @@ EOF; if( count($extra_data['settingGroups']) ) { - $this->DB->delete( 'core_sys_settings_titles', 'conf_title_id IN(' . implode( ',', $extra_data['settingGroups'] ) . ')' ); + $this->DB->delete( 'core_sys_settings_titles', "conf_title_keyword IN('" . implode( "','", $extra_data['settingGroups'] ) . "')" ); } if( count($extra_data['settings']) ) { - $this->DB->delete( 'core_sys_conf_settings', 'conf_id IN(' . implode( ',', $extra_data['settings'] ) . ')' ); + $this->DB->delete( 'core_sys_conf_settings', "conf_key IN('" . implode( "','", $extra_data['settings'] ) . "')" ); } $this->cache->rebuildCache( 'settings', 'global' ); - + //----------------------------------------- // Language strings/files //----------------------------------------- @@ -2409,7 +2476,13 @@ EOF; if( count($extra_data['modules']) ) { - $this->DB->delete( 'core_sys_module', "sys_module_id IN('" . implode( "','", $extra_data['modules'] ) . "')" ); + foreach( $extra_data['modules'] as $module ) + { + list( $_side, $_app, $_module ) = explode( '-', $module ); + $_is_admin = ( $_side == 'admin' ) ? 1 : 0; + + $this->DB->delete( 'core_sys_module', "sys_module_application='{$_app}' AND sys_module_key='{$_module}' AND sys_module_admin={$_is_admin}" ); + } $this->cache->rebuildCache( 'module_cache', 'global' ); $this->cache->rebuildCache( 'app_menu_cache', 'global' ); @@ -2421,39 +2494,39 @@ EOF; if( count($extra_data['help']) ) { - $this->DB->delete( 'faq', 'id IN(' . implode( ',', $extra_data['help'] ) . ')' ); + $this->DB->delete( 'faq', "title IN('" . implode( "','", $extra_data['help'] ) . "')" ); } - + //----------------------------------------- // Skin templates //----------------------------------------- if( count($extra_data['templates']) ) { - foreach( $extra_data['templates'] as $file => $bit ) + foreach( $extra_data['templates'] as $group => $bits ) { - $this->DB->delete( 'skin_templates', "template_group='{$file}' AND template_name IN('" . implode( "','", $bit ) . "')" ); + $this->DB->delete( 'skin_templates', "template_group='{$group}' AND template_name IN('" . implode( "','", $bits ) . "')" ); } - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); + + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); $skinCaching->rebuildPHPTemplates( 0 ); } //----------------------------------------- // CSS //----------------------------------------- - + if( count( $extra_data['css'] ) ) { - $this->DB->delete( 'skin_css', 'css_id IN(' . implode( ',', $extra_data['css'] ) . ')' ); + $this->DB->delete( 'skin_css', "css_group IN('" . implode( "','", $extra_data['css'] ) . "')" ); if( ! $skinCaching ) { - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); } $skinCaching->rebuildCSSCache( 0 ); @@ -2465,7 +2538,7 @@ EOF; if( count($extra_data['tasks']) ) { - $this->DB->delete( 'task_manager', 'task_id IN(' . implode( ',', $extra_data['tasks'] ) . ')' ); + $this->DB->delete( 'task_manager', "task_key IN('" . implode( "','", $extra_data['tasks'] ) . "')" ); } //----------------------------------------- @@ -2481,7 +2554,7 @@ EOF; $this->DB->return_die = false; } } - + if( is_array($extra_data['database']['alter']) AND count($extra_data['database']['alter']) ) { foreach( $extra_data['database']['alter'] as $alter_query ) @@ -2506,7 +2579,7 @@ EOF; $this->DB->return_die = false; } } - + if( is_array($extra_data['database']['update']) AND count($extra_data['database']['update']) ) { foreach( $extra_data['database']['update'] as $update_query ) @@ -2516,7 +2589,7 @@ EOF; $this->DB->return_die = false; } } - + if( is_array($extra_data['database']['insert']) AND count($extra_data['database']['insert']) ) { foreach( $extra_data['database']['insert'] as $insert_query ) @@ -2529,16 +2602,16 @@ EOF; } } } - + //----------------------------------------- // Custom install/uninstall script? //----------------------------------------- if( $extra_data['display']['custom'] ) { - if( file_exists( IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom'] ) ) + if( is_file( IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom'] ) ) { - require_once( IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom'] ); + require_once( IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom'] );/*noLibHook*/ $classname = str_replace( '.php', '', $extra_data['display']['custom'] ); @@ -2551,12 +2624,14 @@ EOF; $uninstall->uninstall(); } } + + @unlink( IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom'] ); } } - + /* Delete main hook entry */ $this->DB->delete( 'core_hooks', "hook_id={$hook_id}" ); - + $this->rebuildHooksCache(); /* Done */ @@ -2569,10 +2644,30 @@ EOF; * This dynamic form allows users to associate multiple files with a single hook. * * @param string [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _hookForm( $type='add' ) + protected function _hookForm( $type='add' ) { + /* Init vars */ + $form = array(); + $files = array(); + $hookData = array(); + $requirements = array(); + $entryPoints = array( 'foreach' => array( array( 'outer.pre', $this->lang->words['h_outerpre'] ), + array( 'inner.pre', $this->lang->words['h_innerpre'] ), + array( 'inner.post', $this->lang->words['h_innerpost'] ), + array( 'outer.post', $this->lang->words['h_outerpost'] ) + ), + 'if' => array( array( 'pre.startif', $this->lang->words['h_prestartif'] ), + array( 'post.startif', $this->lang->words['h_poststartif'] ), + array( 'pre.else', $this->lang->words['h_preelse']), + array( 'post.else', $this->lang->words['h_postelse'] ), + array( 'pre.endif', $this->lang->words['h_preendif'] ), + array( 'post.endif', $this->lang->words['h_postendif'] ) + ) + ); + + /* Edit time? */ if( $type == 'edit' ) { $id = intval($this->request['id']); @@ -2582,36 +2677,34 @@ EOF; $this->registry->output->showError( $this->lang->words['h_noedit'], 1116 ); } - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); if( !$hookData['hook_id'] ) { $this->registry->output->showError( $this->lang->words['h_noedit'], 1117 ); } + /* Sort out extra stuff and requirements */ $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); $hookData['hook_requirements'] = unserialize( $hookData['hook_requirements'] ); - $files = array(); + /* Old data? - @todo: we should remove that around 3.3(4?) */ + if ( ! isset($hookData['hook_requirements']['required_applications']['core']) && isset($hookData['hook_requirements']['hook_ipb_version_min']) && ( $hookData['hook_requirements']['hook_ipb_version_min'] > 0 || $hookData['hook_requirements']['hook_ipb_version_max'] > 0 ) ) + { + $requirements['core'] = array( 'min_version' => intval($hookData['hook_requirements']['hook_ipb_version_min']), 'max_version' => intval($hookData['hook_requirements']['hook_ipb_version_max']) ); + } + + if ( is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications']) ) + { + foreach( $hookData['hook_requirements']['required_applications'] as $appKey => $versionData ) + { + $requirements[ $appKey ] = $versionData; + } + } + + /* Sort out hook files */ $index = 1; $skinGroups = $this->hooksFunctions->getSkinGroups(); - $entryPoint = array(); - - $entryPoint['foreach'] = array( - array( 'outer.pre', $this->lang->words['h_outerpre'] ), - array( 'inner.pre', $this->lang->words['h_innerpre'] ), - array( 'inner.post', $this->lang->words['h_innerpost'] ), - array( 'outer.post', $this->lang->words['h_outerpost'] ), - ); - - $entryPoint['if'] = array( - array( 'pre.startif', $this->lang->words['h_prestartif'] ), - array( 'post.startif', $this->lang->words['h_poststartif'] ), - array( 'pre.else', $this->lang->words['h_preelse']), - array( 'post.else', $this->lang->words['h_postelse'] ), - array( 'pre.endif', $this->lang->words['h_preendif'] ), - array( 'post.endif', $this->lang->words['h_postendif'] ), - ); $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); $outer = $this->DB->execute(); @@ -2628,11 +2721,11 @@ EOF; $templates = $this->hooksFunctions->getSkinMethods( $r['hook_data']['skinGroup'] ); $hookIds = $this->hooksFunctions->getHookIds( $r['hook_data']['skinFunction'], $r['hook_data']['type'] ); - $r['_skinDropdown'] = $this->registry->output->formDropdown( "skinGroup[{$index}]", $skinGroups, $r['hook_data']['skinGroup'], "skinGroup[{$index}]", "onchange='getTemplatesForAdd({$index});'" ); - $r['_templateDropdown'] = $this->registry->output->formDropdown( "skinFunction[{$index}]", $templates, $r['hook_data']['skinFunction'], "skinFunction[{$index}]", "onchange='getTypeOfHook({$index});'" ); - $r['_hookTypeDropdown'] = $this->registry->output->formDropdown( "type[{$index}]", array( array( 'foreach', 'foreach loop' ), array( 'if', 'if statement' ) ), $r['hook_data']['type'], "type[{$index}]", "onchange='getHookIds({$index});'" ); - $r['_hookIdsDropdown'] = $this->registry->output->formDropdown( "id[{$index}]", $hookIds, $r['hook_data']['id'], "id[{$index}]", "onchange='getHookEntryPoints({$index});'" ); - $r['_hookEPDropdown'] = $this->registry->output->formDropdown( "position[{$index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoint['foreach'] : $entryPoint['if'], $r['hook_data']['position'] ); + $r['_skinDropdown'] = $this->registry->output->formDropdown( "skinGroup[{$index}]", $skinGroups, $r['hook_data']['skinGroup'], "skinGroup[{$index}]", "onchange='getTemplatesForAdd({$index});'" ); + $r['_templateDropdown'] = $this->registry->output->formDropdown( "skinFunction[{$index}]", $templates, $r['hook_data']['skinFunction'], "skinFunction[{$index}]", "onchange='getTypeOfHook({$index});'" ); + $r['_hookTypeDropdown'] = $this->registry->output->formDropdown( "type[{$index}]", array( array( 0, $this->lang->words['a_selectone'] ), array( 'foreach', $this->lang->words['hook_foreach_loop'] ), array( 'if', $this->lang->words['hook_if_statement'] ) ), $r['hook_data']['type'], "type[{$index}]", "onchange='getHookIds({$index});'" ); + $r['_hookIdsDropdown'] = $this->registry->output->formDropdown( "id[{$index}]", $hookIds, $r['hook_data']['id'], "id[{$index}]", "onchange='getHookEntryPoints({$index});'" ); + $r['_hookEPDropdown'] = $this->registry->output->formDropdown( "position[{$index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'], $r['hook_data']['position'] ); } if( $r['hook_type'] == 'dataHooks' ) @@ -2640,32 +2733,64 @@ EOF; $r['_dataLocationDropdown'] = $this->registry->output->formDropdown( "dataLocation[{$index}]", $_dataHooks, $r['hook_data']['dataLocation'] ); } - $files[ $index ] = $r; + $files[ $index ] = $r; $index++; } - $action = 'do_edit_hook'; + $action = 'do_edit_hook'; } else { - $hookData = array(); - - foreach( array( 'hook_enabled', 'hook_name', 'hook_desc', 'hook_author', 'hook_email', 'hook_website', 'hook_update_check', 'hook_requirements', 'hook_version_human', 'hook_version_long', 'hook_installed', 'hook_updated', 'hook_position', 'hook_extra_data' ) as $_hook ) + /* Format data for adding an hook.. */ + /*foreach( array( 'hook_name', 'hook_desc', 'hook_key', 'hook_version_human', 'hook_version_long', 'hook_author', 'hook_email', 'hook_website', 'hook_update_check' ) as $_hook ) { $hookData[ $_hook ] = $this->request[ $_hook ]; } - foreach( array( 'hook_ipb_version_max', 'hook_ipb_version_min', 'hook_php_version_min', 'hook_php_version_max' ) as $_version ) + foreach( array( 'hook_php_version_min', 'hook_php_version_max' ) as $_version ) { $hookData['hook_requirements'][ $_version ] = $this->request[ $_version ]; - } - - $files = array(); - $action = 'do_create_hook'; - } + }*/ + $action = 'do_create_hook'; + } + + /* Info */ + foreach( array( 'hook_name', 'hook_desc', 'hook_key', 'hook_version_human', 'hook_version_long', 'hook_author', 'hook_email', 'hook_website', 'hook_update_check' ) as $_hook_key ) + { + $form[ $_hook_key ] = $this->registry->output->formSimpleInput( $_hook_key , isset($_POST[ $_hook_key ]) ? $_POST[ $_hook_key ] : $hookData[ $_hook_key ], 60 ); + } + + /* Requirements */ + foreach( array( 'hook_php_version_min', 'hook_php_version_max' ) as $_version_key ) + { + $form[ $_version_key ] = $this->registry->output->formSimpleInput( $_version_key , isset($_POST[ $_version_key ]) ? $_POST[ $_version_key ] : $hookData['hook_requirements'][ $_version_key ], 20 ); + } + + /* Setup the global caches DD */ + $_caches = array(); + + $this->DB->build( array( 'select' => 'cs_key', + 'from' => 'cache_store', + 'order' => 'cs_key ASC' + ) ); + $this->DB->execute(); + + while( $gc = $this->DB->fetch() ) + { + $_caches[] = array( $gc['cs_key'], $gc['cs_key'] ); + } + + sort( $_caches ); + + $form['hook_global_caches'] = $this->registry->output->formMultiDropdown( 'hook_global_caches[]', $_caches, isset($_POST['hook_global_caches']) ? $_POST['hook_global_caches'] : explode(',',$hookData['hook_global_caches']), 15 ); + + /* Get some data for the javascript */ + $form['jsDataTypes'] = IPSText::br2nl( $this->registry->output->formDropdown( "type[#{index}]", array( array( 0, $this->lang->words['a_selectone'] ), array( 'foreach', $this->lang->words['hook_foreach_loop'] ), array( 'if', $this->lang->words['hook_if_statement'] ) ), '', "type[#{index}]", "onchange='getHookIds(#{index});'" ) ); + $form['jsDataPoints'] = IPSText::br2nl( $this->registry->output->formDropdown( "position[#{index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'] ) ); + /* Output */ - $this->registry->output->html .= $this->html->hookForm( $action, $hookData, $files ); + $this->registry->output->html .= $this->html->hookForm( $form, $action, $hookData, $files, $requirements ); } /** @@ -2673,10 +2798,34 @@ EOF; * Save the new (or updated) hook record * * @param string [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _hookSave( $type='add' ) + protected function _hookSave( $type='add' ) { + /* Init vars */ + $hookData = array(); + $newFiles = array(); + $requireApp = array(); + $_hookFiles = array(); + + /* Get data if we are editing */ + if( $type == 'edit' ) + { + $id = intval($this->request['hook_id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], 1118 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], 1119 ); + } + } + /* Error Checking */ if( ! $this->request['hook_name'] ) { @@ -2687,11 +2836,8 @@ EOF; { $errors[] = $this->lang->words['hook_form_no_key']; } - - $newFiles = array(); - - $_hookFiles = array(); + /* Not IN_DEV? */ if( !IN_DEV ) { $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . intval($this->request['hook_id']) ) ); @@ -2699,24 +2845,43 @@ EOF; while( $_r = $this->DB->fetch() ) { - $_hookFiles[ $_r['hook_classname'] ] = $_r['hook_file_stored']; + $_hookFiles[ $_r['hook_classname'] ] = $_r['hook_file_stored']; } } + /* Check for requirements */ + if( is_array( $this->request['requireApp'] ) AND count( $this->request['requireApp'] ) ) + { + foreach( $this->request['requireApp'] as $_index => $require ) + { + if( $require ) + { + $minVersion = intval($this->request['minVersion'][ $_index ]);/*noLibHook*/ + $maxVersion = intval($this->request['maxVersion'][ $_index ]); + + // Let's not require a version, we can simply force an app to be installed regardless this way + //if ( $minVersion > 0 || $maxVersion > 0 ) + //{ + $requireApp[ $require ] = array( 'app_name' => ipsRegistry::$applications[ $require ]['app_title'], + 'min_version' => $minVersion, + 'max_version' => $maxVersion + );/*noLibHook*/ + //} + } + } + } + + /* Check for files */ if( is_array( $this->request['file'] ) AND count( $this->request['file'] ) ) { foreach( $this->request['file'] as $index => $file ) { if( $file ) { - $newFiles[ $index ] = array( - 'hook_file_real' => $file, - //'hook_file_stored' => $file, - 'hook_type' => $this->request['hook_type'][ $index ], - 'hook_classname' => $this->request['hook_classname'][ $index ], - 'hook_data' => serialize( - array( - 'dataLocation' => trim( $this->request['dataLocation'][ $index ] ), + $newFiles[ $index ] = array('hook_file_real' => $file, + 'hook_type' => $this->request['hook_type'][ $index ], + 'hook_classname' => $this->request['hook_classname'][ $index ], + 'hook_data' => serialize( array('dataLocation' => trim( $this->request['dataLocation'][ $index ] ), 'libApplication' => trim( $this->request['libApplication'][ $index ] ), 'classToOverload' => trim($this->request['classToOverload'][ $index ]), 'skinGroup' => $this->request['skinGroup'][ $index ], @@ -2725,7 +2890,7 @@ EOF; 'id' => $this->request['id'][ $index ], 'position' => $this->request['position'][ $index ], ) - ) + ) ); /** @@ -2743,11 +2908,6 @@ EOF; } } } - - //if( !is_array( $newFiles ) OR !count( $newFiles ) ) - //{ - // $errors[] = $this->lang->words['h_onefile']; - //} if( is_array( $errors ) ) { @@ -2755,52 +2915,31 @@ EOF; $this->_hookForm(); return; } - - /* Get data if we are editing */ - if( $type == 'edit' ) - { - $id = intval($this->request['hook_id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], 1118 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], 1119 ); - } - } /* Get new position */ - $position = $this->DB->buildAndFetch( array( 'select' => 'MAX(hook_position) as newPos', 'from' => 'core_hooks' ) ); + $position = $this->DB->buildAndFetch( array( 'select' => 'MAX(hook_position) as newPos', 'from' => 'core_hooks' ) ); - $mainHookRecord = array( - 'hook_name' => trim($this->request['hook_name']), - 'hook_key' => substr( trim($this->request['hook_key']), 0, 32 ), - 'hook_desc' => trim($this->request['hook_desc']), - 'hook_version_human' => trim($this->request['hook_version_human']), - 'hook_version_long' => trim($this->request['hook_version_long']), - 'hook_author' => trim($this->request['hook_author']), - 'hook_email' => trim($this->request['hook_email']), - 'hook_website' => trim($this->request['hook_website']), - 'hook_update_check' => trim($this->request['hook_update_check']), - 'hook_enabled' => $type == 'add' ? 1 : $hookData['hook_enabled'], - 'hook_installed' => $type == 'add' ? time() : $hookData['hook_installed'], - 'hook_updated' => $type == 'add' ? 0 : time(), - 'hook_position' => $type == 'add' ? $position['newPos'] + 1 : $hookData['hook_position'], - 'hook_requirements' => serialize( - array( - 'hook_ipb_version_min' => intval($this->request['hook_ipb_version_min']), - 'hook_ipb_version_max' => intval($this->request['hook_ipb_version_max']), - 'hook_php_version_min' => $this->request['hook_php_version_min'], - 'hook_php_version_max' => $this->request['hook_php_version_max'], + $mainHookRecord = array('hook_name' => trim($this->request['hook_name']), + 'hook_key' => substr( trim($this->request['hook_key']), 0, 32 ), + 'hook_global_caches' => ( is_array($this->request['hook_global_caches']) && count($this->request['hook_global_caches']) ) ? implode(',', $this->request['hook_global_caches']) : '', + 'hook_desc' => trim($this->request['hook_desc']), + 'hook_version_human' => trim($this->request['hook_version_human']), + 'hook_version_long' => trim($this->request['hook_version_long']), + 'hook_author' => trim($this->request['hook_author']), + 'hook_email' => trim($this->request['hook_email']), + 'hook_website' => trim($this->request['hook_website']), + 'hook_update_check' => trim($this->request['hook_update_check']), + 'hook_enabled' => $type == 'add' ? 1 : $hookData['hook_enabled'], + 'hook_installed' => $type == 'add' ? IPS_UNIX_TIME_NOW : $hookData['hook_installed'], + 'hook_updated' => $type == 'add' ? 0 : IPS_UNIX_TIME_NOW, + 'hook_position' => $type == 'add' ? $position['newPos'] + 1 : $hookData['hook_position'], + 'hook_requirements' => serialize( array('required_applications' => $requireApp, + 'hook_php_version_min' => trim($this->request['hook_php_version_min']), + 'hook_php_version_max' => trim($this->request['hook_php_version_max']) ) - ) - ); - + ) + ); + if( $type == 'edit' ) { $this->DB->update( 'core_hooks', $mainHookRecord, 'hook_id=' . $hookData['hook_id'] ); @@ -2811,34 +2950,43 @@ EOF; { $this->DB->insert( 'core_hooks', $mainHookRecord ); - $hookData['hook_id'] = $this->DB->getInsertId(); + $hookData['hook_id'] = $this->DB->getInsertId(); } foreach( $newFiles as $index => $toInsert ) { - $toInsert['hook_hook_id'] = $hookData['hook_id']; + $toInsert['hook_hook_id'] = $hookData['hook_id']; $this->DB->insert( 'core_hooks_files', $toInsert ); } + /* Rebuild cache */ $this->rebuildHooksCache(); + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - $skinCaching = new skinCaching( $this->registry ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); $skinCaching->flagSetForRecache(); - $this->registry->output->global_message = $this->lang->words['h_saved']; - $this->_hooksOverview(); + /* Redirect */ + $this->registry->output->setMessage( $this->lang->words['h_saved'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); } /** * View details about a hook * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _viewDetails() + protected function _viewDetails() { $id = intval($this->request['id']); @@ -2847,58 +2995,41 @@ EOF; $this->registry->output->showError( $this->lang->words['h_nodetails'], 11110 ); } - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); if( !$hookData['hook_id'] ) { $this->registry->output->showError( $this->lang->words['h_nodetails'], 11111 ); } - $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); - $hookData['hook_requirements'] = unserialize( $hookData['hook_requirements'] ); + /* Extra data */ + $hookData['_updated'] = $this->registry->getClass('class_localization')->formatTime( $hookData['hook_updated'] ); + $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); - if( $hookData['hook_requirements']['hook_ipb_version_min'] OR $hookData['hook_requirements']['hook_ipb_version_max'] ) + /* Meets requirements? */ + $hookData['_require_errors'] = $this->checkHookRequirements( $hookData ); + + /* Got updates? */ + if ( $hookData['hook_update_check'] ) { - /* Get the setup class */ - require IPS_ROOT_PATH . "setup/sources/base/setup.php"; - - /* Fetch numbers */ - $versions = IPSSetUp::fetchXmlAppVersions( 'core' ); - - /* Ensure we match at least 3.0.0 */ - $hookData['hook_requirements']['hook_ipb_version_min'] = ( $hookData['hook_requirements']['hook_ipb_version_min'] < 30000 ) ? 30000 : $hookData['hook_requirements']['hook_ipb_version_min']; - - foreach( $versions as $long => $human ) - { - if( $hookData['hook_requirements']['hook_ipb_version_min'] <= $long ) - { - $hookData['hook_requirements']['hook_ipb_version_min'] = $human; - break; - } - } - - krsort( $versions ); - - foreach( $versions as $long => $human ) - { - if( $hookData['hook_requirements']['hook_ipb_version_max'] >= $long ) - { - $hookData['hook_requirements']['hook_ipb_version_max'] = $human; - break; - } - } + $hookData['hook_update_available'] = $this->_updateAvailable( $hookData['hook_update_check'], $hookData['hook_version_long'] ); + } + else + { + $hookData['hook_update_available'] = array( 0 ); } - $files = array(); - $index = 1; + /* Get files */ + $files = array(); + $index = 1; $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) { - $r['hook_data'] = unserialize( $r['hook_data'] ); - $files[ $index ] = $r; + $r['hook_data'] = unserialize( $r['hook_data'] ); + $files[ $index ] = $r; $index++; } @@ -2906,12 +3037,133 @@ EOF; $this->registry->output->html .= $this->html->hookDetails( $hookData, $files ); } + /** + * Check if the hook meets all the requirements + * + * @param mixed $hook Can be an hook ID or an array of the hook data + * @return @e array Errors found + */ + public function checkHookRequirements( $hook ) + { + /* Init vars */ + $hookData = array(); + $reqsData = array(); + $errors = array(); + + /* We already have some data? */ + if ( is_array($hook) && count($hook) ) + { + $hookData = $hook; + } + elseif ( is_int($hook) ) + { + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook ) ); + } + + /* Requirements are still serialized? */ + if ( !is_array($hookData['hook_requirements']) ) + { + $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']); + } + + /* Make our var shorter... */ + $reqsData = &$hookData['hook_requirements']; + + /* Old data? - @todo: remove this check around 3.3(4?) */ + if ( ! isset($reqsData['required_applications']['core']) && isset($reqsData['hook_ipb_version_min']) && ( $reqsData['hook_ipb_version_min'] > 0 || $reqsData['hook_ipb_version_max'] > 0 ) ) + { + $reqsData['hook_ipb_version_min'] = ( $reqsData['hook_ipb_version_min'] < 30000 ) ? 30000 : $reqsData['hook_ipb_version_min']; + + $reqsData['required_applications']['core'] = array( 'min_version' => intval($reqsData['hook_ipb_version_min']), 'max_version' => intval($reqsData['hook_ipb_version_max']) ); + } + + //----------------------------------------- + // Let's start checking requirements + //----------------------------------------- + + /* PHP */ + if( $reqsData['hook_php_version_min'] OR $reqsData['hook_php_version_max'] ) + { + if( $reqsData['hook_php_version_min'] AND version_compare( PHP_VERSION, $reqsData['hook_php_version_min'], '<' ) == true ) + { + $errors['php_min'] = sprintf( $this->lang->words['h_phpold'],$reqsData['hook_php_version_min'] ); + } + + if( $reqsData['hook_php_version_max'] AND version_compare( PHP_VERSION, $reqsData['hook_php_version_max'], '>' ) == true ) + { + $errors['php_max'] = sprintf( $this->lang->words['h_phpnew'], $reqsData['hook_php_version_max'] ); + } + } + + /* Additional applications */ + if ( is_array($reqsData['required_applications']) && count($reqsData['required_applications']) ) + { + /* Get the setup class */ + require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ + + /* Loop through all apps */ + foreach( $reqsData['required_applications'] as $appKey => $appData ) + { + /* Versions file doesn't exist? */ + if ( !is_file( IPSLib::getAppDir( $appKey ) . '/xml/versions.xml' ) ) + { + $errors[ $appKey.'_app' ] = sprintf( $this->lang->words['hook_require_appnotfound'], $appData['app_name'] ); + } + /* App not installed/enabled? */ + elseif( !IPSLib::appIsInstalled( $appKey ) ) + { + $errors[ $appKey.'_app' ] = sprintf( $this->lang->words['hook_require_appdisabled'], ipsRegistry::$applications[ $appKey ]['app_title'] ); + } + elseif ( $appData['min_version'] OR $appData['max_version'] ) + { + /* Fetch and check versions */ + if ( !isset($this->cachedVersions[ $appKey ]) ) + { + $this->cachedVersions[ $appKey ] = IPSSetUp::fetchXmlAppVersions( $appKey ); + } + + $versions = $this->cachedVersions[ $appKey ]; + + if ( is_array($versions) && count($versions) ) + { + if( !isset($this->cachedUpgradeInfo[ $appKey ]) ) + { + $_key = in_array( $appKey, array( 'forums', 'members' ) ) ? 'core' : $appKey; + $this->cachedUpgradeInfo[ $_key ] = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='{$_key}'", 'order' => 'upgrade_version_id DESC', 'limit' => array( 1 ) ) ); + + /* Extra caching for the three core apps */ + if( in_array( $appKey, array( 'core', 'forums', 'members' ) ) ) + { + $this->cachedUpgradeInfo['core'] = $this->cachedUpgradeInfo[ $_key ]; + $this->cachedUpgradeInfo['forums'] = $this->cachedUpgradeInfo[ $_key ]; + $this->cachedUpgradeInfo['members'] = $this->cachedUpgradeInfo[ $_key ]; + } + } + + /* Do we meet tha requirements? */ + if( $appData['min_version'] AND $this->cachedUpgradeInfo[ $appKey ]['upgrade_version_id'] < $appData['min_version'] ) + { + $errors[ $appKey.'_min' ] = sprintf( $this->lang->words['hook_require_tooold'], isset($versions[ $appData['min_version'] ]) ? $versions[ $appData['min_version'] ] : $appData['min_version'] ); + } + + if( $appData['max_version'] AND $this->cachedUpgradeInfo[ $appKey ]['upgrade_version_id'] > $appData['max_version'] ) + { + $errors[ $appKey.'_max' ] = sprintf( $this->lang->words['hook_require_toonew'], isset($versions[ $appData['max_version'] ]) ? $versions[ $appData['max_version'] ] : $appData['max_version'] ); + } + } + } + } + } + + return $errors; + } + /** * Check if you meet hook requirements * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _checkRequirements() + protected function _checkRequirements() { $id = intval($this->request['id']); @@ -2920,129 +3172,74 @@ EOF; $this->registry->output->showError( $this->lang->words['h_norequirements'], 11112 ); } - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); if( !$hookData['hook_id'] ) { $this->registry->output->showError( $this->lang->words['h_norequirements'], 11113 ); } - - $hookData['hook_requirements'] = unserialize( $hookData['hook_requirements'] ); - $hookIpbBad = false; - $hookPhpBad = false; - /* Ensure we match at least 3.0.0 */ - $hookData['hook_requirements']['hook_ipb_version_min'] = ( $hookData['hook_requirements']['hook_ipb_version_min'] < 30000 ) ? 30000 : $hookData['hook_requirements']['hook_ipb_version_min']; + /* Get requirements */ + $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']); - if( $hookData['hook_requirements']['hook_ipb_version_min'] OR $hookData['hook_requirements']['hook_ipb_version_max'] ) - { - /* Get the setup class */ - require IPS_ROOT_PATH . "setup/sources/base/setup.php"; - - /* Fetch numbers */ - $versions = IPSSetUp::fetchXmlAppVersions( 'core' ); - - $currentIPB = (int) IPB_LONG_VERSION; - - if( $hookData['hook_requirements']['hook_ipb_version_min'] AND $currentIPB < $hookData['hook_requirements']['hook_ipb_version_min'] ) - { - $hookIpbBad = $this->lang->words['h_tooold']; - } - - if( $hookData['hook_requirements']['hook_ipb_version_max'] AND $currentIPB > $hookData['hook_requirements']['hook_ipb_version_max'] ) - { - $hookIpbBad = $this->lang->words['h_toonew']; - } - - foreach( $versions as $long => $human ) - { - if( $hookData['hook_requirements']['hook_ipb_version_min'] <= $long ) - { - $hookData['hook_requirements']['hook_ipb_version_min'] = $human; - break; - } - } - - krsort( $versions ); - - foreach( $versions as $long => $human ) - { - if( $hookData['hook_requirements']['hook_ipb_version_max'] >= $long ) - { - $hookData['hook_requirements']['hook_ipb_version_max'] = $human; - break; - } - } - } - - if( $hookData['hook_requirements']['hook_php_version_min'] OR $hookData['hook_requirements']['hook_php_version_max'] ) - { - if( $hookData['hook_requirements']['hook_php_version_min'] AND version_compare( PHP_VERSION, $hookData['hook_requirements']['hook_php_version_min'], '<' ) == true ) - { - $hookPhpBad = $this->lang->words['h_phpold']; - } - - if( $hookData['hook_requirements']['hook_php_version_max'] AND version_compare( PHP_VERSION, $hookData['hook_requirements']['hook_php_version_max'], '>' ) == true ) - { - $hookPhpBad = $this->lang->words['h_phpnew']; - } - } + /* Check requirements */ + $errors = $this->checkHookRequirements( $hookData ); /* Output */ - $this->registry->output->html .= $this->html->hookRequirements( $hookData, $hookIpbBad, $hookPhpBad ); + $this->registry->output->html .= $this->html->hookRequirements( $hookData, $errors, $this->cachedVersions ); } /** * Rebuild hooks cache * - * @return void + * @return @e void */ public function rebuildHooksCache() { /* INI */ - $cache = array( 'commandHooks' => array(), 'skinHooks' => array(), 'templateHooks' => array(), 'dataHooks' => array(), 'libraryHooks' => array() ); + $cache = array( 'commandHooks' => array(), 'skinHooks' => array(), 'templateHooks' => array(), 'dataHooks' => array(), 'libraryHooks' => array() ); /* First fix positions */ $this->_fixPositions(); /* Get current hooks */ - $this->DB->build( array( 'select' => 'f.*', - 'from' => array( 'core_hooks_files' => 'f' ), - 'where' => 'c.hook_enabled=1', - 'order' => 'c.hook_position ASC', - 'add_join' => array( - array( - 'select' => 'c.hook_id, c.hook_key', - 'from' => array( 'core_hooks' => 'c' ), - 'where' => 'c.hook_id=f.hook_hook_id', - 'type' => 'left', - ) - ) + $this->DB->build( array( 'select' => 'f.*', + 'from' => array( 'core_hooks_files' => 'f' ), + 'where' => 'c.hook_enabled=1', + 'order' => 'c.hook_position ASC', + 'add_join' => array( array( 'select' => 'c.hook_id', + 'from' => array( 'core_hooks' => 'c' ), + 'where' => 'c.hook_id=f.hook_hook_id', + 'type' => 'left' ) ) ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) { + /* Got no main hook id? Weird but skip.. */ + if ( empty($r['hook_id']) ) + { + continue; + } + /* INIT */ $_cache = array(); $data = unserialize( $r['hook_data'] ); /* General Stuff */ - $_cache = array( - 'filename' => $r['hook_file_stored'], - 'className' => $r['hook_classname'], + $_cache = array( 'filename' => $r['hook_file_stored'], + 'className' => $r['hook_classname'] ); /* Hook type specific stuff */ if( $r['hook_type'] == 'templateHooks' ) { $_cache['type'] = $data['type']; - //$_cache['skinGroup'] = $data['skinGroup']; $_cache['skinFunction'] = $data['skinFunction']; $_cache['id'] = $data['id']; $_cache['position'] = $data['position']; } - else if( $r['hook_type'] == 'dataHooks' OR $r['hook_type'] == 'libraryHooks' ) + else if( /*$r['hook_type'] == 'dataHooks' OR*/ $r['hook_type'] == 'libraryHooks' ) { $_cache['classToOverload'] = $data['classToOverload']; } @@ -3065,8 +3262,8 @@ EOF; $cache[ $r['hook_type'] ][ $data['classToOverload'] ][] = $_cache; } } - + /* Update the cache */ $this->cache->setCache( 'hooks', $cache, array( 'array' => 1 ) ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/index.html b/upload/admin/applications/core/modules_admin/applications/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/applications/index.html +++ b/upload/admin/applications/core/modules_admin/applications/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/nexus.php b/upload/admin/applications/core/modules_admin/applications/nexus.php index 98f488e7..21840f2f 100644 --- a/upload/admin/applications/core/modules_admin/applications/nexus.php +++ b/upload/admin/applications/core/modules_admin/applications/nexus.php @@ -2,18 +2,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Nexus Application
- * Last Updated: $Date: 2010-11-10 06:51:11 -0500 (Wed, 10 Nov 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Revision: 7126 $ + * @link http://hatynka.in + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,12 +28,12 @@ class admin_core_applications_nexus extends ipsCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://betscms.ws"); + $this->registry->output->showInsideIframe("http://myipb.in/products/nexus/"); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/setup.php b/upload/admin/applications/core/modules_admin/applications/setup.php index 07333dbf..e7a654fe 100644 --- a/upload/admin/applications/core/modules_admin/applications/setup.php +++ b/upload/admin/applications/core/modules_admin/applications/setup.php @@ -2,18 +2,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Application Installation
- * Last Updated: $Date: 2010-10-19 11:43:08 -0400 (Tue, 19 Oct 2010) $
+ * Last Updated: $Date: 2011-08-01 09:21:24 -0400 (Mon, 01 Aug 2011) $
  * 
* - * @author $Author: mark $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6996 $ + * @link http://hatynka.in + * @version $Rev: 9340 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,41 +30,41 @@ class admin_core_applications_setup extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Shortcut for url * * @var string URL shortcut */ - private $form_code; + protected $form_code; /** * Shortcut for url (javascript) * * @var string JS URL shortcut */ - private $form_code_js; + protected $form_code_js; /** * Current app path * * @var object */ - private $app_full_path; + protected $app_full_path; /** * Product information * * @var array */ - private $product_information; + protected $product_information; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -80,7 +80,7 @@ class admin_core_applications_setup extends ipsCommand $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=setup'; /* Get the setup class */ - require IPS_ROOT_PATH . "setup/sources/base/setup.php"; + require( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ /* Set the path */ $this->app_full_path = IPSLib::getAppDir( $this->request['app_directory'] ) . '/'; @@ -105,7 +105,7 @@ class admin_core_applications_setup extends ipsCommand # Settings # Template Cache # Caches / Done - */ + */ switch( $this->request['do'] ) { default: @@ -158,137 +158,27 @@ class admin_core_applications_setup extends ipsCommand /** * Rebuild PHP Templates Cache * - * @return void + * @return @e void */ public function recacheTemplates() { - //----------------------------------------- - // Determine if we need to recache templates - //----------------------------------------- + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); - $vars = $this->getVars(); - $hasSkin = false; + /* Flag all for recache */ + $skinCaching->flagSetForRecache(); - if ( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) ) - { - $hasSkin = true; - } + $data = $this->getVars(); - if( !$hasSkin ) - { - //----------------------------------------- - // We'll check for any of the default 3 - //----------------------------------------- - - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_root_templates.xml' ) OR - file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_lofi_templates.xml' ) OR - file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_xmlskin_templates.xml' ) ) - { - $hasSkin = true; - } - } - - if( !$hasSkin ) - { - //----------------------------------------- - // We'll check for any of the default 3 - //----------------------------------------- - - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_root_css.xml' ) OR - file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_lofi_css.xml' ) OR - file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_xmlskin_css.xml' ) ) - { - $hasSkin = true; - } - } - - //----------------------------------------- - // See if any hooks were installed.. - //----------------------------------------- - - if( !$hasSkin ) - { - if( is_dir( $this->app_full_path . 'xml/hooks' ) ) - { - $files = scandir( $this->app_full_path . 'xml/hooks' ); - - foreach( $files as $file ) - { - if( $file != '.' AND $file != '..' ) - { - $hasSkin = true; - break; - } - } - } - } - - if( !$hasSkin ) - { - $this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['redir__no_template_re'] ) , '', $this->getNextURL( 'finish', $vars ) ); - return; - } - - if( $this->request['_recache_done'] == 'true' ) - { - $this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['to_recache_done'] ) , '', $this->getNextURL( 'finish', $vars ) ); - return; - } - - /* INIT */ - $setID = intval( $this->request['setID'] ); - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' ); - - $skinFunctions = new skinImportExport( $this->registry ); - - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); - - /* Get first set id */ - if( ! $setID ) - { - ksort( $this->registry->output->allSkins ); - $_skins = $this->registry->output->allSkins; - $_set = array_shift( $_skins ); - $setID = $_set['set_id']; - } - - /* Rebuild */ - $skinFunctions->rebuildPHPTemplates( $setID ); - $skinFunctions->rebuildCSS( $setID ); - $skinFunctions->rebuildReplacementsCache( $setID ); - $skinFunctions->rebuildSkinSetsCache(); - - /* Fetch next id */ - $nextID = $setID; - - ksort( $this->registry->output->allSkins ); - - foreach( $this->registry->output->allSkins as $id => $data ) - { - if ( $id > $nextID ) - { - $nextID = $id; - break; - } - } - if ( $nextID != $setID ) - { - $this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ), '', $this->getNextURL( 'tplcache&setID=' . $nextID, $vars ) ); - } - else - { - $this->showRedirectScreen( $vars['app_directory'], array( $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ), '', $this->getNextURL( 'tplcache&_recache_done=true', $vars ) ); - } - + $this->showRedirectScreen( $data['app_directory'], array( $this->lang->words['install_skins_flag_recache'] ), '', $this->getNextURL( 'finish', $data ) ); } /** * Finalizes installation and rebuilds caches * - * @return void + * @return @e void */ public function finish() { @@ -313,14 +203,15 @@ class admin_core_applications_setup extends ipsCommand $this->cache->rebuildCache( 'app_menu_cache', 'global' ); $this->cache->rebuildCache( 'group_cache', 'global' ); $this->cache->rebuildCache( 'notifications', 'global' ); + $this->cache->rebuildCache( 'report_plugins', 'global' ); /* Rebuild application specific caches */ $_file = $this->app_full_path . 'extensions/coreVariables.php'; - if( file_exists( $_file ) ) + if( is_file( $_file ) ) { $CACHE = array(); - require( $_file ); + require( $_file );/*noLibHook*/ if( is_array( $CACHE ) AND count( $CACHE ) ) { @@ -331,8 +222,18 @@ class admin_core_applications_setup extends ipsCommand } } + /* Rebuild GLOBAL CACHES! */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ) + { + // Show an error? + } + /* Rebuild FURLs */ - if( file_exists( $this->app_full_path . 'extensions/furlTemplates.php' ) ) + if( is_file( $this->app_full_path . 'extensions/furlTemplates.php' ) ) { try { @@ -351,7 +252,7 @@ class admin_core_applications_setup extends ipsCommand /** * Next Check * - * @return void + * @return @e void */ public function nextCheck() { @@ -379,30 +280,32 @@ class admin_core_applications_setup extends ipsCommand $new_pos = intval( $pos['pos'] ) + 1; /* Insert details into the DB */ - $this->DB->insert( 'core_applications', array( - 'app_title' => $this->product_information['name'], - 'app_public_title' => $this->product_information['public_name'], - 'app_author' => $this->product_information['author'], - 'app_description' => $this->product_information['description'], - 'app_hide_tab' => intval($this->product_information['hide_tab']), - 'app_version' => $_numbers['latest'][1], - 'app_long_version' => $_numbers['latest'][0], - 'app_directory' => $vars['app_directory'], - 'app_location' => $vars['app_location'], - 'app_added' => time(), - 'app_position' => $new_pos, - 'app_protected' => 0, - 'app_enabled' => $this->product_information['disabledatinstall'] ? 0 : 1 + $this->DB->insert( 'core_applications', array( 'app_title' => $this->product_information['name'], + 'app_public_title' => $this->product_information['public_name'], + 'app_author' => $this->product_information['author'], + 'app_description' => $this->product_information['description'], + 'app_hide_tab' => intval($this->product_information['hide_tab']), + 'app_version' => $_numbers['latest'][1], + 'app_long_version' => $_numbers['latest'][0], + 'app_directory' => $vars['app_directory'], + 'app_location' => $vars['app_location'], + 'app_added' => time(), + 'app_position' => $new_pos, + 'app_protected' => 0, + 'app_enabled' => $this->product_information['disabledatinstall'] ? 0 : 1, + 'app_website' => trim($this->product_information['website']), + 'app_update_check' => trim($this->product_information['update_check']), + 'app_global_caches' => trim($this->product_information['global_caches']), ) ); - + $this->DB->insert( 'upgrade_history', array( 'upgrade_version_id' => $_numbers['latest'][0], 'upgrade_version_human' => $_numbers['latest'][1], 'upgrade_date' => time(), 'upgrade_notes' => '', 'upgrade_mid' => $this->memberData['member_id'], - 'upgrade_app' => $vars['app_directory'] + 'upgrade_app' => $vars['app_directory'], ) ); /* Insert the modules */ @@ -413,14 +316,16 @@ class admin_core_applications_setup extends ipsCommand } else { - $this->DB->update( 'core_applications', array( - 'app_title' => $this->product_information['name'], + $this->DB->update( 'core_applications', array( 'app_title' => $this->product_information['name'], 'app_public_title' => $this->product_information['public_name'], 'app_author' => $this->product_information['author'], 'app_description' => $this->product_information['description'], 'app_hide_tab' => intval($this->product_information['hide_tab']), 'app_version' => $_numbers['current'][1], 'app_long_version' => $_numbers['current'][0], + 'app_website' => trim($this->product_information['website']), + 'app_update_check' => trim($this->product_information['update_check']), + 'app_global_caches' => trim($this->product_information['global_caches']), ), "app_directory='" . $vars['app_directory'] . "'" ); /* Update the modules */ @@ -453,7 +358,7 @@ class admin_core_applications_setup extends ipsCommand /** * Import Hooks * - * @return void + * @return @e void */ public function hooks() { @@ -465,7 +370,7 @@ class admin_core_applications_setup extends ipsCommand $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); - if( file_exists( $this->app_full_path . 'xml/hooks.xml' ) ) + if( is_file( $this->app_full_path . 'xml/hooks.xml' ) ) { /* Get the hooks class */ $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' ); @@ -494,7 +399,7 @@ class admin_core_applications_setup extends ipsCommand /** * Import Settings * - * @return void + * @return @e void */ public function settings() { @@ -504,12 +409,12 @@ class admin_core_applications_setup extends ipsCommand $errors = array(); $knownSettings = array(); - $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ), 'core' ); - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) ) + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) ) { /* Get the settings class */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/settings.php', 'admin_core_tools_settings' ); + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' ); $settings = new $classToLoad(); $settings->makeRegistryShortcuts( $this->registry ); @@ -530,9 +435,9 @@ class admin_core_applications_setup extends ipsCommand } /* Fetch known settings */ - if ( file_exists( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ) ) + if ( is_file( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ) ) { - require( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ); + require( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' );/*noLibHook*/ } $settings->importAllSettings( 1, 1, $knownSettings ); @@ -555,7 +460,7 @@ class admin_core_applications_setup extends ipsCommand /** * Import tasks * - * @return void + * @return @e void */ public function tasks() { @@ -564,7 +469,7 @@ class admin_core_applications_setup extends ipsCommand $output = array(); $errors = array(); - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) ) + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) ) { /* Get the language class */ $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php', 'admin_core_system_taskmanager' ); @@ -586,7 +491,7 @@ class admin_core_applications_setup extends ipsCommand /** * Import bbcode * - * @return void + * @return @e void */ public function bbcode() { @@ -595,7 +500,7 @@ class admin_core_applications_setup extends ipsCommand $output = array(); $errors = array(); - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) ) + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) ) { /* Get the language class */ $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' ); @@ -607,7 +512,7 @@ class admin_core_applications_setup extends ipsCommand $output[] = $this->lang->words['bbcode_and_media']; } - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) ) + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) ) { /* Get the language class */ $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' ); @@ -634,7 +539,7 @@ class admin_core_applications_setup extends ipsCommand /** * Import help * - * @return void + * @return @e void */ public function help() { @@ -643,7 +548,7 @@ class admin_core_applications_setup extends ipsCommand $output = array(); $errors = array(); - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) ) + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) ) { $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php', 'admin_core_tools_help' ); $help = new $classToLoad(); @@ -666,7 +571,7 @@ class admin_core_applications_setup extends ipsCommand /** * Language Import * - * @return void + * @return @e void */ public function languages() { @@ -710,7 +615,7 @@ class admin_core_applications_setup extends ipsCommand /** * Install templates * - * @return void + * @return @e void */ public function templates() { @@ -719,9 +624,9 @@ class admin_core_applications_setup extends ipsCommand $output = array(); $errors = array(); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/ $skinFunctions = new skinImportExport( $this->registry ); $skinCaching = new skinCaching( $this->registry ); @@ -746,7 +651,7 @@ class admin_core_applications_setup extends ipsCommand foreach( $skinSets as $skinKey => $skinData ) { /* Skin files first */ - if( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_templates.xml' ) ) + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_templates.xml' ) ) { $return = $skinFunctions->importTemplateAppXML( $vars['app_directory'], $skinKey, $skinData['set_id'], TRUE ); @@ -754,7 +659,7 @@ class admin_core_applications_setup extends ipsCommand } /* Then CSS files */ - if ( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_css.xml' ) ) + if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_css.xml' ) ) { //----------------------------------------- // Install @@ -766,7 +671,7 @@ class admin_core_applications_setup extends ipsCommand } /* And we can support replacements for good measure */ - if ( file_exists( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) ) + if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) ) { //----------------------------------------- // Install @@ -796,7 +701,7 @@ class admin_core_applications_setup extends ipsCommand /** * Runs any additional sql files * - * @return void + * @return @e void */ public function sqlSteps() { @@ -809,16 +714,16 @@ class admin_core_applications_setup extends ipsCommand $sql_files = array(); /* Any "extra" configs required for this driver? */ - if( file_exists( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) + if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) { - require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ); + require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/ $extra_install = new install_extra( $this->registry ); } /* Run any sql files we found */ - if( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ) ) + if( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ) ) { /* INIT */ $new_id = $id + 1; @@ -826,7 +731,7 @@ class admin_core_applications_setup extends ipsCommand $SQL = array(); /* Get the sql file */ - require_once( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ); + require_once( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' );/*noLibHook*/ $this->DB->return_die = 1; @@ -872,7 +777,7 @@ class admin_core_applications_setup extends ipsCommand /** * Creates Tables, Runs Inserts, and Indexes * - * @return void + * @return @e void */ public function sqlBasics() { @@ -884,9 +789,9 @@ class admin_core_applications_setup extends ipsCommand $count = 0; /* Any "extra" configs required for this driver? */ - if( file_exists( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) + if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) { - require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ); + require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/ $extra_install = new install_extra( $this->registry ); } @@ -897,10 +802,10 @@ class admin_core_applications_setup extends ipsCommand $this->DB->return_die = 1; - if ( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ) ) + if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ) ) { $TABLE = array(); - include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ); + include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' );/*noLibHook*/ if ( is_array( $TABLE ) and count( $TABLE ) ) { @@ -910,7 +815,7 @@ class admin_core_applications_setup extends ipsCommand // Is this a create? //----------------------------------------- - preg_match("/CREATE TABLE (\S+)(\s)?\(/", $q, $match); + preg_match("/CREATE TABLE\s+(\S+)(\s)?\(/", str_ireplace( 'if not exists', '', $q ), $match); if( $match[1] AND $vars['dupe_tables'] == 'drop' ) { @@ -972,10 +877,10 @@ class admin_core_applications_setup extends ipsCommand if ( $this->DB->checkFulltextSupport() ) { - if ( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ) ) + if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ) ) { $INDEX = array(); - include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ); + include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' );/*noLibHook*/ $count = 0; @@ -1011,13 +916,13 @@ class admin_core_applications_setup extends ipsCommand } /* INSERTS */ - if ( file_exists( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ) ) + if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ) ) { $INSERT = array(); $count = 0; /* Get the SQL File */ - include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ); + include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' );/*noLibHook*/ foreach( $INSERT as $q ) { @@ -1057,7 +962,7 @@ class admin_core_applications_setup extends ipsCommand /** * Begin installation * - * @return void + * @return @e void */ public function start() { @@ -1112,7 +1017,7 @@ class admin_core_applications_setup extends ipsCommand { if ( $data['dir'] ) { - if ( ! @mkdir( $_path, 0777, TRUE ) ) + if ( ! @mkdir( $_path, IPS_FOLDER_PERMISSION, TRUE ) ) { $info['notexist'][] = $_path; } @@ -1124,7 +1029,7 @@ class admin_core_applications_setup extends ipsCommand } else if ( ! is_writeable( $_path ) ) { - if ( ! @chmod( $_path, 0777 ) ) + if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) ) { $info['notwrite'][] = $_path; } @@ -1175,7 +1080,7 @@ class admin_core_applications_setup extends ipsCommand foreach( $required_xml as $r ) { - if( ! file_exists( $this->app_full_path . "xml/{$r}.xml" ) ) + if( ! is_file( $this->app_full_path . "xml/{$r}.xml" ) ) { $errors[] = sprintf( $this->lang->words['error__file_needed'], $this->app_full_path . "xml/{$r}.xml" ); } @@ -1190,7 +1095,7 @@ class admin_core_applications_setup extends ipsCommand * * @return array */ - private function getVars() + protected function getVars() { /* INIT */ $env = array(); @@ -1227,7 +1132,7 @@ class admin_core_applications_setup extends ipsCommand * @param array $env * @return string */ - private function getNextURL( $next_action, $env ) + protected function getNextURL( $next_action, $env ) { return $this->settings['base_url'] . $this->form_code . '&do=' . $next_action . '&app_directory=' . $env['app_directory'] . '&type=' . $env['type'] . '&version=' . $env['version']; } @@ -1239,9 +1144,9 @@ class admin_core_applications_setup extends ipsCommand * @param string $output * @param string $errors * @param string $next_url - * @return void + * @return @e void */ - private function showRedirectScreen( $app_directory, $output, $errors, $next_url ) + protected function showRedirectScreen( $app_directory, $output, $errors, $next_url ) { /* Init Data */ $data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] ); diff --git a/upload/admin/applications/core/modules_admin/applications/xml/index.html b/upload/admin/applications/core/modules_admin/applications/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/applications/xml/index.html +++ b/upload/admin/applications/core/modules_admin/applications/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/xml/menu.xml b/upload/admin/applications/core/modules_admin/applications/xml/menu.xml index 6e2f0b50..20e0e770 100644 --- a/upload/admin/applications/core/modules_admin/applications/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/applications/xml/menu.xml @@ -6,22 +6,24 @@ Список модулей + manage_apps_modules applications do=applications_overview - + app_manage 0 - + Управление хуками (hooks) Список хуков + manage_hooks hooks do=hooks_overview - + hooks_manage 0 diff --git a/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml b/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml index 71672b65..2767cf8a 100644 --- a/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml @@ -2,6 +2,7 @@ Управление приложениями + core_manage_apps app_manage @@ -23,6 +24,7 @@ Управление модулями + core_manage_modules module_manage @@ -36,6 +38,7 @@ Покупка приложений + core_purchase_app purchase_app @@ -45,6 +48,7 @@ Управление модификациями + core_manage_hooks hooks_manage diff --git a/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php b/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php index bcb84134..5843a48b 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default diagnostics section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'diagnostics' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'diagnostics'; diff --git a/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php b/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php index 71c74dac..5e70ceab 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php +++ b/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Diagnostic tools
- * Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
+ * Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
  * 
* - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 1st march 2002 - * @version $Revision: 6990 $ + * @version $Revision: 9487 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -31,62 +31,42 @@ class admin_core_diagnostics_diagnostics extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Shortcut for url * * @var string URL shortcut */ - private $form_code; + protected $form_code; /** * Shortcut for url (javascript) * * @var string JS URL shortcut */ - private $form_code_js; - - /** - * Directory separator - * - * @var string Directory separator - */ - private $dir_split = "/"; + protected $form_code_js; /** * Db tools * * @var object */ - private $dbTools; + protected $dbTools; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { - //----------------------------------------- - // Load skin - //----------------------------------------- - + /* Load skin and setup stuff */ $this->html = $this->registry->output->loadTemplate('cp_skin_diagnostics'); - - //----------------------------------------- - // Set up stuff - //----------------------------------------- - $this->form_code = $this->html->form_code = 'module=diagnostics&section=diagnostics'; $this->form_code_js = $this->html->form_code_js = 'module=diagnostics§ion=diagnostics'; - if( strpos( strtolower( PHP_OS ), 'win' ) === 0 ) - { - $this->dir_split = "\\"; - } - //----------------------------------------- // Some of these functions can take a while.. //----------------------------------------- @@ -97,7 +77,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand // Load lang //----------------------------------------- - ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) ); + ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ), 'core' ); ///---------------------------------------- // What to do... @@ -162,9 +142,9 @@ class admin_core_diagnostics_diagnostics extends ipsCommand /** * Test outbound connections * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _checkConnections() + public function _checkConnections() { //----------------------------------------- // Turn errors on so we can view them @@ -175,188 +155,22 @@ class admin_core_diagnostics_diagnostics extends ipsCommand $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); $_files = new $classToLoad(); - $_files->use_sockets = 1; - $_test = $_files->getFileContents( "http://yandex.ru/" ); + $_test = $_files->getFileContents( "http://www.google.com/" ); $_headers = $_files->raw_headers; - $_test1 = $_files->getFileContents( "https://yandex.ru/" ); + $_test1 = $_files->getFileContents( "https://www.google.com/" ); $_headers1 = $_files->raw_headers; - + $this->registry->output->html .= $this->html->connectionCheckerResult( $_headers, $_test, $_headers1, $_test1 ); } - /** - * Displays a log entry - * - * @return void [Outputs to screen] - */ - private function _tmViewLog() - { - /* INIT */ - $member_id = intval( $this->request['member_id'] ); - $marker_microtime = base64_decode( trim( $this->request['_id'] ) ); - - /* Fetch row */ - $data = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_topicmarker_debug', - 'where' => 'marker_member_id=' . $member_id . ' AND marker_microtime=\'' . $marker_microtime . '\'' ) ); - - /* Format date */ - if ( $data ) - { - $data['_marker_timestamp'] = $this->registry->class_localization->getDate( $data['marker_timestamp'], 'long' ); - } - - /* unserialize */ - if ( $data['marker_data_storage'] AND strstr( 'a:', $data['marker_data_storage'] ) ) - { - $data['_marker_data_storage'] = unserialize( $data['marker_data_storage'] ); - } - - /* unserialize */ - if ( $data['marker_data_memory'] AND strstr( 'a:', $data['marker_data_memory'] ) ) - { - $data['_marker_data_memory'] = unserialize( $data['marker_data_memory'] ); - } - - /* unserialize */ - if ( $data['marker_data_freezer'] AND strstr( 'a:', $data['marker_data_freezer'] ) ) - { - $data['_marker_data_freezer'] = unserialize( $data['marker_data_freezer'] ); - } - - /* unserialize */ - foreach( array( 1,2,3,4,5 ) as $n ) - { - if ( $data['marker_data_' . $n ] AND strstr( 'a:', $data['marker_data_' . $n ] ) ) - { - $data['marker_data_' . $n ] = unserialize( $data['marker_data_' . $n ] ); - } - } - - /* Print pop-up window */ - $this->registry->output->html .= $this->html->topicMarkers_viewLog( $data ); - $this->registry->output->printPopupWindow(); - } - - /** - * Displays a member's session - * - * @return void [Outputs to screen] - */ - private function _tmMemberIndex() - { - /* INIT */ - $markers = array(); - $member_id = intval( $this->request['member_id'] ); - $marker_session_key = trim( $this->request['marker_session_key'] ); - $st = intval( $this->request['st'] ); - $perpage = 100; - $query = array(); - $url = array(); - - /* Load member */ - $member = IPSMember::buildDisplayData( $member_id ); - - /* Generate SQL */ - $query[] = 't.marker_member_id=' . $member_id; - $url[] = 'member_id=' . $member_id; - - if ( $marker_session_key ) - { - $query[] = 't.marker_session_key=\'' . $marker_session_key. '\''; - $url[] = 'marker_session_key=' . $marker_session_key; - } - - /* Fetch count */ - $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', - 'from' => 'core_topicmarker_debug t', - 'where' => implode( " AND ", $query ) ) ); - - $pages = $this->registry->output->generatePagination( array( 'totalItems' => $count['count'], - 'itemsPerPage' => $perpage, - 'currentStartValue' => $st, - 'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}&do=" . $this->request['do'] . '&' . implode( "&", $url ), - ) ); - /* Grab members */ - $this->DB->build( array( 'select' => '*', - 'from' => 'core_topicmarker_debug t', - 'where' => implode( " AND ", $query ), - 'limit' => array( $st, $perpage ), - 'order' => 't.marker_timestamp ASC, t.marker_microtime ASC' ) ); - $this->DB->execute(); - - /* Barney and Luke rule the world <-- Debbie typed that */ - while( $row = $this->DB->fetch() ) - { - $markers[] = $row; - } - - /* Send to output */ - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . "&{$this->form_code}&do=tm_index", "Topic Marker Debugging" ); - - if ( count( $query ) > 1 ) - { - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . "&{$this->form_code}&do=tm_memberindex&member_id=" . $member_id, "Log Overview (Unfiltered)" ); - } - - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . "&{$this->form_code}&do=tm_memberindex" . '&' . implode( "&", $url ), "Log Overview" ); - - $this->registry->output->html .= $this->html->topicMarkers_membersIndex( $member, $markers, $pages ); - } - - /** - * List topic marking debugging index screen (shows members) - * - * @return void [Outputs to screen] - */ - private function _tmIndex() - { - /* INIT */ - $_debug = array(); - $debug = array(); - $members = array(); - - /* Grab members */ - $this->DB->build( array( 'select' => 't.*, COUNT(*) as count, MAX(t.marker_timestamp) as max_ts', - 'from' => array( 'core_topicmarker_debug' => 't' ), - 'group' => 't.marker_member_id', - 'order' => 'm.members_l_display_name', - 'add_join' => array( array( 'select' => 'm.*', - 'from' => array( 'members' => 'm' ), - 'where' => 'm.member_id=t.marker_member_id', - 'type' => 'left' ) ) ) ); - $this->DB->execute(); - - /* Barney and Luke rule the world <-- Debbie typed that */ - while( $row = $this->DB->fetch() ) - { - $members[] = $row['marker_member_id']; - $_debug[] = $row; - } - - /* Grab members */ - $loadedMembers = IPSMember::load( $members ); - - /* Parse 'em */ - foreach( $_debug as $row ) - { - $row['_memberData'] = IPSMember::buildDisplayData( $loadedMembers[ $row['marker_member_id'] ] ); - - $debug[] = $row; - } - - /* Send to output */ - $this->registry->output->html .= $this->html->topicMarkers_index( $debug ); - } - /** * Check file versions * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _versionCheck() + public function _versionCheck() { $file_versions = array(); $upgrade_history = array(); @@ -380,8 +194,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand // Got real version number? //----------------------------------------- - $version['version'] = (IPB_VERSION == '3.1.4') ? $latest_version['upgrade_version_human'] : IPB_VERSION; - $version['version_full'] = (IPB_LONG_VERSION == '31007') ? $latest_version['upgrade_version_id'] : IPB_LONG_VERSION; + $version['version'] = ( IPB_VERSION == '3.2.3' ) ? $latest_version['upgrade_version_human'] : IPB_VERSION; + $version['version_full'] = ( IPB_LONG_VERSION == '32006' ) ? $latest_version['upgrade_version_id'] : IPB_LONG_VERSION; //----------------------------------------- // Version History @@ -406,15 +220,17 @@ class admin_core_diagnostics_diagnostics extends ipsCommand * @param string Directory to check * @return array Files => Versions */ - private function _versionDirRecurse($dir) + public function _versionDirRecurse($dir) { - $skip_dirs = array( 'public', + /* Init some vars */ + $files = array(); + $skip_dirs = array( PUBLIC_DIRECTORY, 'cache', 'uploads', 'images', 'i18n', 'PEAR', - 'hooks', + rtrim( str_replace( DOC_IPS_ROOT_PATH, '', IPS_HOOKS_PATH ), '/\\' ), 'facebook-client', 'FirePHPCore', 'facebook', @@ -427,18 +243,15 @@ class admin_core_diagnostics_diagnostics extends ipsCommand 'Auth' ); - $skip_files = array( 'conf_global.php', + $skip_files = array('conf_global.php', 'conf.php', $this->settings['sql_driver'] . '_updates.php', $this->settings['sql_driver'] . '_install.php', $this->settings['sql_driver'] . '_fulltext.php', - 'versionnumbers.php', - 'recaptcha.php', 'classGraph.php', // This is Wizzy's ); - $files = array(); - + /* Check files */ try { foreach( new DirectoryIterator( $dir ) as $directory ) @@ -453,8 +266,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand continue; } - $newpath = $dir . $this->dir_split . $directory->getFilename(); - $level = explode( $this->dir_split, $newpath ); + $newpath = $dir . '/' . $directory->getFilename(); + $level = explode( '/', $newpath ); if ( is_dir($newpath) && !in_array( $directory->getFilename(), $skip_dirs ) ) { @@ -466,7 +279,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand { $file = file_get_contents($newpath); - preg_match( "#IP\.Board v([\d\.]+?)\\n#i", $file, $matches ); + preg_match( "#@version\s+?v(.+?)\\n#i", $file, $matches ); $files[ $newpath ] = isset($matches[1]) ? $matches[1] : ''; } @@ -480,25 +293,23 @@ class admin_core_diagnostics_diagnostics extends ipsCommand /** * Check file permissions * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _permissionsCheck() - { - $checkdirs = array( - 'public', - 'public' . $this->dir_split . 'style_images', - 'public' . $this->dir_split . 'style_css', - 'public' . $this->dir_split . 'style_emoticons', + public function _permissionsCheck() + { + $checkdirs = array( PUBLIC_DIRECTORY . '/style_images', + PUBLIC_DIRECTORY . '/style_css', + PUBLIC_DIRECTORY . '/style_emoticons', 'cache', - 'cache' . $this->dir_split . 'skin_cache', - 'cache' . $this->dir_split . 'lang_cache', - 'cache' . $this->dir_split . 'tmp', - 'cache' . $this->dir_split . 'openid', + 'cache/skin_cache', + 'cache/lang_cache', + 'cache/tmp', + 'cache/openid', 'uploads', - 'uploads' . $this->dir_split . 'profile', - 'hooks', + 'uploads/profile', + rtrim( str_replace( DOC_IPS_ROOT_PATH, '', IPS_HOOKS_PATH ), '/\\' ), ); - + //----------------------------------------- // Get language directories //----------------------------------------- @@ -507,16 +318,16 @@ class admin_core_diagnostics_diagnostics extends ipsCommand { foreach( $this->cache->getCache('lang_data') as $v ) { - $this_lang = 'cache' . $this->dir_split . 'lang_cache' . $this->dir_split . $v['lang_id']; - $checkdirs[] = $this_lang; + $this_lang = 'cache/lang_cache/' . $v['lang_id']; + $checkdirs[] = $this_lang; try { - foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $this_lang ) as $file ) + foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . '/' . $this_lang ) as $file ) { if( $file->isFile() ) { - $checkdirs[] = $this_lang . $this->dir_split . $file->getFilename(); + $checkdirs[] = $this_lang . '/' . $file->getFilename(); } } } catch ( Exception $e ) {} @@ -529,16 +340,16 @@ class admin_core_diagnostics_diagnostics extends ipsCommand while( $v = $this->DB->fetch() ) { - $this_lang = 'cache' . $this->dir_split . 'lang_cache' . $this->dir_split . $v['lang_id']; + $this_lang = 'cache/lang_cache/' . $v['lang_id']; $checkdirs[] = $this_lang; try { - foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $this_lang ) as $file ) + foreach( new DirectoryIterator( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . '/' . $this_lang ) as $file ) { if( $file->isFile() ) { - $checkdirs[] = $this_lang . $this->dir_split . $file->getFilename(); + $checkdirs[] = $this_lang . '/' . $file->getFilename(); } } } catch ( Exception $e ) {} @@ -553,7 +364,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand { foreach( $this->cache->getCache('emoticons') as $v ) { - $checkdirs[] = 'public' . $this->dir_split . 'style_emoticons' . $this->dir_split . $v['emo_set']; + $checkdirs[] = PUBLIC_DIRECTORY . '/style_emoticons/' . $v['emo_set']; } } else @@ -563,7 +374,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand while( $v = $this->DB->fetch() ) { - $checkdirs[] = 'public' . $this->dir_split . 'style_emoticons' . $this->dir_split . $v['emo_set']; + $checkdirs[] = PUBLIC_DIRECTORY . '/style_emoticons/' . $v['emo_set']; } } @@ -582,7 +393,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand continue; } - $checkdirs[] = 'cache' . $this->dir_split . 'skin_cache' . $this->dir_split . 'cacheid_' . $v['set_id']; + $checkdirs[] = 'cache/skin_cache/cacheid_' . $v['set_id']; $skin_dirs[] = $v['set_skin_set_id']; } } @@ -593,7 +404,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand while( $v = $this->DB->fetch() ) { - $checkdirs[] = 'cache' . $this->dir_split . 'skin_cache' . $this->dir_split . 'cacheid_' . $v['set_id']; + $checkdirs[] = 'cache/skin_cache/cacheid_' . $v['set_id']; $skin_dirs[] = $v['set_skin_set_id']; } } @@ -602,18 +413,17 @@ class admin_core_diagnostics_diagnostics extends ipsCommand // Get skin files //----------------------------------------- - $this->DB->build( array( - 'select' => $this->DB->buildDistinct( 'template_group' ), - 'from' => 'skin_templates', - 'group' => 'template_group', - ) ); + $this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_group' ), + 'from' => 'skin_templates', + 'group' => 'template_group', + ) ); $this->DB->execute(); while( $v = $this->DB->fetch() ) { foreach( $skin_dirs as $dir ) { - $checkdirs[] = 'cache' . $this->dir_split . 'skin_cache' . $this->dir_split . 'cacheid_' . $dir . $this->dir_split . $v['group_name'] . '.php'; + $checkdirs[] = 'cache/skin_cache/cacheid_' . $dir . '/' . $v['group_name'] . '.php'; } } @@ -622,7 +432,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand foreach( $checkdirs as $dir_to_check ) { - if( !file_exists( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check ) ) + if( !file_exists( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . '/' . $dir_to_check ) ) { # Could be skin files from custom skins for components they don't own # or they could be using safe_mode skins @@ -630,56 +440,44 @@ class admin_core_diagnostics_diagnostics extends ipsCommand if( !strpos( $dir_to_check, 'skin_' ) OR !strpos( $dir_to_check, '.php' ) ) { - $output[] = "{$this->lang->words['d_p404']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check . ""; + $output[] = "{$this->lang->words['d_p404']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . "/{$dir_to_check}"; } } - else if( !is_writeable( DOC_IPS_ROOT_PATH . $this->dir_split . $dir_to_check ) ) + else { - $output[] = "{$this->lang->words['d_pno']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check . ""; - } - else if( is_writeable( DOC_IPS_ROOT_PATH . $this->dir_split . $dir_to_check ) ) - { - $output[] = "" . rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . $this->dir_split . $dir_to_check . " {$this->lang->words['d_pyes']}"; + $output[] = ( is_writable( DOC_IPS_ROOT_PATH . '/' . $dir_to_check ) ) ? "" . rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . "/{$dir_to_check} {$this->lang->words['d_pyes']}" : "{$this->lang->words['d_pno']} ". rtrim( DOC_IPS_ROOT_PATH, '/\\' ) . "/{$dir_to_check}";; } } $this->registry->output->html .= $this->html->permissionsResults( $output ); } - /** * Whitespace checking * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _whitespaceCheck() + public function _whitespaceCheck() { - $files_with_junk = array(); - $files_with_junk = $this->_whitespaceDirRecurse( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) ); - //$files_with_junk = $this->_whitespaceDirRecurse( '/var/' ); + $files_with_junk = $this->_whitespaceDirRecurse( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) ); $this->registry->output->html .= $this->html->whitespaceResults( $files_with_junk ); } - /** * Recurse over a directory * * @param string Directory to check * @return array Array of files with whitespace in them */ - private function _whitespaceDirRecurse( $dir ) + public function _whitespaceDirRecurse( $dir ) { - $skip_dirs = array( - 'uploads', - 'gallery_setup', - 'blog_setup', - 'idm_setup', - 'public', - 'js', - 'images', + $skip_dirs = array( 'uploads', + PUBLIC_DIRECTORY, + 'js', + 'images', ); - + $files = array(); try @@ -696,8 +494,8 @@ class admin_core_diagnostics_diagnostics extends ipsCommand continue; } - $newpath = $dir . $this->dir_split . $directory->getFilename(); - $level = explode( $this->dir_split, $newpath ); + $newpath = $dir . '/' . $directory->getFilename(); + $level = explode( '/', $newpath ); if ( is_dir($newpath) && !in_array( $directory->getFilename(), $skip_dirs ) ) { @@ -716,7 +514,14 @@ class admin_core_diagnostics_diagnostics extends ipsCommand } else if( substr( rtrim($file), -2 ) == '?>' AND substr( $file, -2 ) != '?>' ) { - $has_whitespace = true; + //----------------------------------------- + // PHP explicitly allows one newline after closing tag + //----------------------------------------- + + if( substr( rtrim($file), -2 ) == '?>' AND substr( $file, -3 ) != "?>\n" ) + { + $has_whitespace = true; + } } if( $has_whitespace ) @@ -737,7 +542,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand * @param void * @return array Table files */ - private function _getDbTools() + public function _getDbTools() { //----------------------------------------- // First we get the SQL definitions for each app @@ -749,7 +554,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand { $_file = IPSLib::getAppDir( $app['app_directory'] ) . '/setup/versions/install/sql/' . $app['app_directory'] . '_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tables.php'; - if( file_exists( $_file ) ) + if( is_file( $_file ) ) { $sql_table_files[ $app['app_title'] ] = $_file; } @@ -768,9 +573,9 @@ class admin_core_diagnostics_diagnostics extends ipsCommand /** * Check the database for missing indexes * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _indexCheck() + public function _indexCheck() { //----------------------------------------- // First we get the SQL definitions for each app @@ -788,7 +593,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand foreach( $sql_table_files as $app_title => $sql_file ) { $TABLE = array(); - require_once( $sql_file ); + require_once( $sql_file );/*noLibHook*/ if ( is_array( $TABLE ) AND count( $TABLE ) ) { @@ -806,7 +611,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand $tables_array[$app_title] = $output['results']; } - } + } /* Output */ $this->registry->output->html .= $this->html->indexChecker( $errors_array, $tables_array ); @@ -815,10 +620,10 @@ class admin_core_diagnostics_diagnostics extends ipsCommand /** * Check the database for missing tables/columns * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] * @todo [Future] Functionality to show EXTRA columns/tables? */ - private function _dbCheck() + public function _dbCheck() { //----------------------------------------- // First we get the SQL definitions for each app @@ -836,7 +641,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand foreach( $sql_table_files as $app_title => $sql_file ) { $TABLE = array(); - require_once( $sql_file ); + require_once( $sql_file );/*noLibHook*/ $output = $this->dbTools->dbTableDiag( $TABLE, $this->request['fix'] ); @@ -863,9 +668,9 @@ class admin_core_diagnostics_diagnostics extends ipsCommand /** * Show the overview page * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _listFunctions() + public function _listFunctions() { //----------------------------------------- // Stats @@ -886,35 +691,31 @@ class admin_core_diagnostics_diagnostics extends ipsCommand $lock = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as mems' , 'from' => 'members', 'where' => 'failed_login_count >= ' . $this->settings['ipb_bruteforce_attempts'] ) ); } - $coppa = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as coppa', 'from' => 'validating', 'where' => 'coppa_user=1' ) ); - $my_timestamp = time() - $this->settings['au_cutoff'] * 60; $online = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as sessions', 'from' => 'sessions', 'where' => 'running_time>' . $my_timestamp ) ); $pending = $this->DB->buildAndFetch( array( 'select' => 'SUM(queued_topics) as topics, SUM(queued_posts) as posts', 'from' => 'forums' ) ); - $spammers = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count, MAX(joined) as joined', + $spammers = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', 'from' => 'members', - //'where' => IPSBWOptions::sql( 'bw_is_spammer', 'members_bitoptions', 'members', 'global', 'has' ) ) ); 'where' => "members_bitoptions = '1'" ) ); $statsbox = $this->html->acp_stats_wrapper( array( 'topics' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_topics']), - 'replies' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_replies']), - 'topics_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['topics']), - 'posts_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['posts']), - 'members' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['mem_count']), - 'validate' => ipsRegistry::getClass('class_localization')->formatNumber( $reg['reg'] ), - 'spammer' => array( ipsRegistry::getClass('class_localization')->formatNumber( $spammers['count'] ), ipsRegistry::getClass('class_localization')->formatNumber( $spammers['joined'] ) ), - 'locked' => ipsRegistry::getClass('class_localization')->formatNumber( $lock['mems'] ), - 'coppa' => ipsRegistry::getClass('class_localization')->formatNumber( $coppa['coppa'] ), - 'sql_driver' => strtoupper(SQL_DRIVER), - 'sql_version' => $this->DB->true_version, - 'php_version' => phpversion(), - 'sessions' => ipsRegistry::getClass('class_localization')->formatNumber($online['sessions']), - 'php_sapi' => @php_sapi_name(), - 'ipb_version' => ipsRegistry::$version, - 'ipb_id' => ipsRegistry::$vn_full ) ); + 'replies' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_replies']), + 'topics_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['topics']), + 'posts_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['posts']), + 'members' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['mem_count']), + 'validate' => ipsRegistry::getClass('class_localization')->formatNumber( $reg['reg'] ), + 'spammer' => ipsRegistry::getClass('class_localization')->formatNumber( $spammers['count'] ), + 'locked' => ipsRegistry::getClass('class_localization')->formatNumber( $lock['mems'] ), + 'sql_driver' => strtoupper(SQL_DRIVER), + 'sql_version' => $this->DB->true_version, + 'php_version' => phpversion(), + 'sessions' => ipsRegistry::getClass('class_localization')->formatNumber($online['sessions']), + 'php_sapi' => @php_sapi_name(), + 'ipb_version' => ipsRegistry::$version, + 'ipb_id' => ipsRegistry::$vn_full ) ); //----------------------------------------- // PHP INFO? @@ -946,7 +747,7 @@ class admin_core_diagnostics_diagnostics extends ipsCommand #PREVENT WRAP: Cookie , split $php_body = preg_replace( "#,(\d+),#", ",
\\1," , $php_body ); - $this->registry->output->html = $this->html->phpInfo( $php_body ); + $this->registry->output->html .= $this->html->phpInfo( $php_body ); return; } @@ -1117,6 +918,4 @@ class admin_core_diagnostics_diagnostics extends ipsCommand $this->registry->output->html .= $this->html->acp_version_history_wrapper( $thiscontent ); } - - } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/index.html b/upload/admin/applications/core/modules_admin/diagnostics/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/index.html +++ b/upload/admin/applications/core/modules_admin/diagnostics/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html b/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html +++ b/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml b/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml index ab381a26..7f594bc6 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml @@ -6,8 +6,10 @@ Обзор системы + diag_overview diagnostics + 0 @@ -17,8 +19,10 @@ Проверка версий файлов + version_checker diagnostics do=fileversions + version_checker 0 @@ -28,8 +32,10 @@ Поиск файлов содержащих лишние пробелы + whitespace_checker diagnostics do=whitespace + whitespace_checker 0 @@ -39,8 +45,10 @@ Проверка прав доступа к файлам + permissions_checker diagnostics do=filepermissions + permission_checker 0 @@ -50,8 +58,10 @@ Проверка сетевых соединений + connection_checker diagnostics do=connections + connection_checker 0 @@ -61,8 +71,10 @@ Проверка структуры базы данных + db_checker diagnostics do=dbchecker + database_checker 0 @@ -72,8 +84,10 @@ Проверка индексов базы данных + dbi_checker diagnostics do=dbindex + index_checker 0 diff --git a/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml b/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml index 1141f2d0..73acf1a1 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml @@ -2,6 +2,7 @@ Инструменты диагностики + core_diag_tools index_checker diff --git a/upload/admin/applications/core/modules_admin/help/defaultSection.php b/upload/admin/applications/core/modules_admin/help/defaultSection.php index 03222b47..46589b3c 100644 --- a/upload/admin/applications/core/modules_admin/help/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/help/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default help section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'help' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'quickhelp'; diff --git a/upload/admin/applications/core/modules_admin/help/index.html b/upload/admin/applications/core/modules_admin/help/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/help/index.html +++ b/upload/admin/applications/core/modules_admin/help/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/help/quickhelp.php b/upload/admin/applications/core/modules_admin/help/quickhelp.php index bc59a30a..a93d5f45 100644 --- a/upload/admin/applications/core/modules_admin/help/quickhelp.php +++ b/upload/admin/applications/core/modules_admin/help/quickhelp.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Quick help - shows popups with help information
- * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 1st march 2002 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ * */ @@ -30,18 +30,16 @@ class admin_core_help_quickhelp extends ipsCommand /** * Array of help text * - * @access private * @var array Help texts */ - private $help_text = array(); + protected $help_text = array(); /** * Initialize the help text array * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _initText() + protected function _initText() { ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ) ); @@ -82,9 +80,8 @@ class admin_core_help_quickhelp extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -110,41 +107,36 @@ class admin_core_help_quickhelp extends ipsCommand /** * Redirect offsite for more help/options * - * @access private * @param string 'key' to redirect to - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ private function _redirect( $id ) { switch( $id ) { case 'docs': - $url = "http://anonym.to/?http://external.iblink.ru/docs-ipb"; - break; - - case 'kb': - $url = "http://anonym.to/?http://external.iblink.ru/wiki"; + $url = "http://myipb.in/docs-ipb"; break; case 'resources': - $url = "http://anonym.to/?http://external.iblink.ru/forums"; + $url = "http://myipb.in/forums"; break; case 'contact': - $url = "http://anonym.to/?http://external.iblink.ru/contact"; + $url = "http://myipb.in/contact"; break; case 'features': - $url = "http://anonym.to/?http://external.iblink.ru/suggestfeatures"; + $url = "http://myipb.in/suggestfeatures"; break; case 'bugs': - $url = "http://anonym.to/?http://external.iblink.ru/bugtrack"; + $url = "http://myipb.in/bugtrack"; break; default: case 'support': - $url = "http://anonym.to/?http://external.iblink.ru/clientarea"; + $url = "http://myipb.in/clientarea"; break; } diff --git a/upload/admin/applications/core/modules_admin/help/xml/index.html b/upload/admin/applications/core/modules_admin/help/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/help/xml/index.html +++ b/upload/admin/applications/core/modules_admin/help/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/help/xml/menu.xml b/upload/admin/applications/core/modules_admin/help/xml/menu.xml index 95f29b30..6935841f 100644 --- a/upload/admin/applications/core/modules_admin/help/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/help/xml/menu.xml @@ -6,28 +6,20 @@ Документация + help_documentation quickhelp do=redirect&id=docs 1
- - База знаний - - - База знаний - quickhelp - do=redirect&id=kb - 1 - - - - + + Тех. поддержка Техническая поддержка + help_support quickhelp do=redirect&id=support 1 @@ -39,6 +31,7 @@ Форумы IBResource + help_resources quickhelp do=redirect&id=resources 1 @@ -50,6 +43,7 @@ Контактная информация + help_contact quickhelp do=redirect&id=contact 1 @@ -61,6 +55,7 @@ Сообщить об ошибке + help_bugs quickhelp do=redirect&id=bugs 1 diff --git a/upload/admin/applications/core/modules_admin/index.html b/upload/admin/applications/core/modules_admin/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/index.html +++ b/upload/admin/applications/core/modules_admin/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/defaultSection.php b/upload/admin/applications/core/modules_admin/languages/defaultSection.php index 1c254e8c..8384e9a0 100644 --- a/upload/admin/applications/core/modules_admin/languages/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/languages/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default languages section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'languages' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'manage_languages'; diff --git a/upload/admin/applications/core/modules_admin/languages/index.html b/upload/admin/applications/core/modules_admin/languages/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/languages/index.html +++ b/upload/admin/applications/core/modules_admin/languages/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/manage_languages.php b/upload/admin/applications/core/modules_admin/languages/manage_languages.php index 7f1c90d4..43269586 100644 --- a/upload/admin/applications/core/modules_admin/languages/manage_languages.php +++ b/upload/admin/applications/core/modules_admin/languages/manage_languages.php @@ -1,19 +1,20 @@ * Invision Power Services - * IP.Board v3.1.4 + * IP.Board v3.2.3 * Language Pack Management - * Last Updated: $LastChangedDate: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $ + * Last Updated: $LastChangedDate: 2011-09-19 20:56:02 -0400 (Mon, 19 Sep 2011) $ * * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6990 $ + * @link http://hatynka.in + * @version $Rev: 9511 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,12 +31,40 @@ class admin_core_languages_manage_languages extends ipsCommand * @var bool */ private $__daily = false; + + /** + * Tab buttons + * + * @var array + */ + public $tab_buttons = array(); + + /** + * Tabs + * + * @var array + */ + public $tab_tabs = array(); + + /** + * Javascript action to execute on tab click + * + * @var string + */ + public $tab_js_action = ''; + + /** + * Default tab + * + * @var string + */ + public $default_tab = ''; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -43,16 +72,15 @@ class admin_core_languages_manage_languages extends ipsCommand // Get skin and language file //----------------------------------------- - $this->html = $this->registry->output->loadTemplate( 'cp_skin_system' ); - - $this->registry->class_localization->loadLanguageFile( array( 'admin_system' ) ); + $this->html = $this->registry->output->loadTemplate( 'cp_skin_system', 'core' ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_system' ), 'core' ); //----------------------------------------- // Set urls //----------------------------------------- - $this->form_code = $this->html->form_code = 'module=languages&section=manage_languages'; - $this->form_code_js = $this->html->form_code_js = 'module=languages§ion=manage_languages'; + $this->form_code = $this->html->form_code = 'module=languages&section=manage_languages&'; + $this->form_code_js = $this->html->form_code_js = 'module=languages§ion=manage_languages&'; //----------------------------------------- // Go @@ -62,7 +90,7 @@ class admin_core_languages_manage_languages extends ipsCommand { case 'copy_lang_pack': $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageCopy( 'edit' ); + $this->languageCopy(); break; case 'edit_word_entry': @@ -120,6 +148,11 @@ class admin_core_languages_manage_languages extends ipsCommand $this->handleLanguageInformationForm( 'new' ); break; + case 'language_swap': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); + $this->swapLanguages(); + break; + case 'revert': $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); $this->languageDoRevertWord(); @@ -198,10 +231,37 @@ class admin_core_languages_manage_languages extends ipsCommand $this->registry->output->sendOutput(); } + /** + * Swap member language choice globally + * + * @return @e void + */ + public function swapLanguages() + { + /* INIT */ + $langFrom = intval( $this->request['lang_from'] ); + $langTo = intval( $this->request['lang_to'] ); + + /* Run query... */ + if( !$langFrom ) + { + $this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : '' ), "language='' OR language " . $this->DB->buildIsNull( true ) ); + } + else + { + $this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : '' ), "language='{$langFrom}'" ); + } + + /* Done */ + $this->registry->output->global_message = $this->lang->words['mem_lang_choice_swapped']; + $this->languagesList(); + return; + } + /** * Finish a session and remove data * - * @return void + * @return @e void */ public function translateKill() { @@ -248,7 +308,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Translate externally import changed files * - * @return void + * @return @e void */ public function translateImport() { @@ -355,7 +415,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Translate externally splash * - * @return void + * @return @e void */ public function translateExtSplash() { @@ -480,7 +540,7 @@ class admin_core_languages_manage_languages extends ipsCommand { fwrite( $fh, $to_write, strlen( $to_write ) ); fclose( $fh ); - @chmod( $mainDir . '/' . $_file, 0777 ); + @chmod( $mainDir . '/' . $_file, IPS_FILE_PERMISSION ); $mtime = @filemtime( $mainDir . '/' . $_file ); @@ -577,13 +637,13 @@ class admin_core_languages_manage_languages extends ipsCommand $counts[ $f ] = array(); - if ( ! file_exists( $mainDir . $f ) ) + if ( ! is_file( $mainDir . $f ) ) { continue; } /* Require the file */ - require( $mainDir . $f ); + require( $mainDir . $f );/*noLibHook*/ //----------------------------------------- // Loop @@ -771,7 +831,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Recaches a language pack * - * @return void + * @return @e void */ public function recacheLangPack() { @@ -785,15 +845,14 @@ class admin_core_languages_manage_languages extends ipsCommand $this->cacheToDisk( $lang_id ); - $this->registry->output->global_message = $this->lang->words['language_recache_done'] . "
" . implode( "
", $this->cache_errors ); + $this->registry->output->global_message = $this->lang->words['language_recache_done'] . ( !empty( $this->cache_errors ) ? ( "
" . implode( "
", $this->cache_errors ) ) : '' ); $this->languagesList(); } - /** * Remove a word entry * - * @return void + * @return @e void */ public function removeWordEntry() { @@ -828,7 +887,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Remove a word pack * - * @return void + * @return @e void */ public function removeWordPack() { @@ -853,7 +912,7 @@ class admin_core_languages_manage_languages extends ipsCommand $_file = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' . $pack[0] . '_' . $pack[1] . '.php'; - if( file_exists( $_file ) ) + if( is_file( $_file ) ) { @unlink( $_file ); } @@ -877,7 +936,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Rebuilds language from XML files * - * @return void + * @return @e void */ public function rebuildFromXml() { @@ -897,7 +956,7 @@ class admin_core_languages_manage_languages extends ipsCommand if ( ! is_writeable( IPS_CACHE_PATH . 'cache/lang_cache/' . $id ) ) { - $this->registry->output->global_message = "Cannot write to cache/lang_cache/" . $id; + $this->registry->output->global_error = $this->lang->words['cannot_write_to_cache'] ? sprintf( $this->lang->words['cannot_write_to_cache'], $id ) : "Cannot write to cache/lang_cache/" . $id; $this->languagesList(); return; } @@ -906,7 +965,7 @@ class admin_core_languages_manage_languages extends ipsCommand // Get setup class //----------------------------------------- - require_once( IPS_ROOT_PATH . "setup/sources/base/setup.php" ); + require_once( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ //----------------------------------------- // Get apps @@ -954,7 +1013,9 @@ class admin_core_languages_manage_languages extends ipsCommand // Off to next setp //----------------------------------------- - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=rebuildFromXml&id={$id}&type={$type}&previous=" . $next['key'], $msg ); + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type={$type}&previous=" . $next['key'], $msg . '
' . $this->registry->output->global_message ); + $this->registry->output->global_message = ''; + return; } else { @@ -964,7 +1025,8 @@ class admin_core_languages_manage_languages extends ipsCommand // Onto admin languages //----------------------------------------- - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=rebuildFromXml&id={$id}&type=admin", $this->lang->words['starting_admin_import'] ); + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type=admin", $this->lang->words['starting_admin_import'] ); + return; } else { @@ -972,7 +1034,7 @@ class admin_core_languages_manage_languages extends ipsCommand // And we're done //----------------------------------------- - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages", $this->lang->words['lang_reimport_done'] ); + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['lang_reimport_done'] ); } } } @@ -1025,8 +1087,9 @@ class admin_core_languages_manage_languages extends ipsCommand //----------------------------------------- $this->cacheToDisk( $new_id ); - - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages", $this->lang->words['l_copied'] ); + $this->registry->class_localization->rebuildLanguagesCache(); + + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_copied'] ); } /** @@ -1069,7 +1132,9 @@ class admin_core_languages_manage_languages extends ipsCommand // Delete from disk //----------------------------------------- - $this->registry->adminFunctions->removeDirectory( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/' ); + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); + $fileManagement = new $classToLoad(); + $fileManagement->removeDirectory( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/' ); //----------------------------------------- // Update member default choice @@ -1078,22 +1143,17 @@ class admin_core_languages_manage_languages extends ipsCommand $this->DB->update( 'members', array( 'language' => intval($default['lang_id']) ), "language={$id}" ); //----------------------------------------- - // Update cache + // Update cache and redirect //----------------------------------------- $this->registry->class_localization->rebuildLanguagesCache(); - - //----------------------------------------- - // Redirect - //----------------------------------------- - - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages", $this->lang->words['l_removed'] ); + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_removed'] ); } /** * Revert a word pack entry to the default value * - * @return void + * @return @e void */ public function languageDoRevertWord() { @@ -1129,7 +1189,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Saves new language edits * - * @return void + * @return @e void */ public function languageEditWordPackValues() { @@ -1170,14 +1230,14 @@ class admin_core_languages_manage_languages extends ipsCommand $this->cacheToDisk( $id ); - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] ); + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] ); } /** * Handles the word entry form * * @param string $mode Either add or edit - * @return void + * @return @e void */ public function handleWordEntryForm( $mode='add' ) { @@ -1195,21 +1255,21 @@ class admin_core_languages_manage_languages extends ipsCommand if( ! $this->request['word_pack_db'] ) { - $this->registry->output->global_message = $this->lang->words['l_packreq']; + $this->registry->output->global_error = $this->lang->words['l_packreq']; $this->languageWordEntryForm( $mode ); return; } if( ! $this->request['word_key'] ) { - $this->registry->output->global_message = $this->lang->words['l_keyreq']; + $this->registry->output->global_error = $this->lang->words['l_keyreq']; $this->languageWordEntryForm( $mode ); return; } if( ! $this->request['word_default'] ) { - $this->registry->output->global_message = $this->lang->words['l_textreq']; + $this->registry->output->global_error = $this->lang->words['l_textreq']; $this->languageWordEntryForm( $mode ); return; } @@ -1240,6 +1300,16 @@ class admin_core_languages_manage_languages extends ipsCommand if( $mode == 'add' ) { + /* Check for a duplicate */ + $_check = $this->DB->buildAndFetch( array( 'select' => 'word_id', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}' AND word_key='{$db_array['word_key']}'" ) ); + + if( $_check['word_id'] ) + { + $this->registry->output->global_error = $this->lang->words['l_textexistsalready']; + $this->languageWordEntryForm( $mode ); + return; + } + $this->DB->insert( 'core_sys_lang_words', $db_array ); $text = $this->lang->words['l_added']; @@ -1264,7 +1334,7 @@ class admin_core_languages_manage_languages extends ipsCommand * Form for adding/editing a word entry * * @param string $mode Either add or edit - * @return void + * @return @e void */ public function languageWordEntryForm( $mode='add' ) { @@ -1306,10 +1376,10 @@ class admin_core_languages_manage_languages extends ipsCommand // Set defaults //----------------------------------------- - $data['word_app'] = ( isset( $this->request['word_app'] ) && $this->request['word_app'] ) ? $this->request['word_app'] : $data['word_app']; - $data['word_pack'] = ( isset( $this->request['word_pack_db'] ) && $this->request['word_pack_db'] ) ? $this->request['word_pack_db'] : $data['word_pack']; - $data['word_key'] = ( isset( $this->request['word_key'] ) && $this->request['word_key'] ) ? $this->request['word_key'] : $data['word_key']; - $data['word_default'] = ( isset( $this->request['word_default'] ) && $this->request['word_default'] ) ? $this->request['word_default'] : $data['word_default']; + $data['word_app'] = !empty( $this->request['word_app'] ) ? $this->request['word_app'] : $data['word_app']; + $data['word_pack'] = !empty( $this->request['word_pack_db'] ) ? $this->request['word_pack_db'] : $data['word_pack']; + $data['word_key'] = !empty( $this->request['word_key'] ) ? $this->request['word_key'] : $data['word_key']; + $data['word_default'] = !empty( $this->request['word_default'] ) ? $this->request['word_default'] : $data['word_default']; //----------------------------------------- // Applications dropdown @@ -1322,19 +1392,104 @@ class admin_core_languages_manage_languages extends ipsCommand $_apps[] = array( $app, $appdata['app_title'] ); } - $data['word_app'] = $this->registry->output->compileSelectOptions( $_apps, $data['word_app'] ); + $data['word_app'] = $this->compileSelectOptions( $_apps, $data['word_app'] ); //----------------------------------------- // Output form //----------------------------------------- $this->registry->output->html .= $this->html->languageWordEntryForm( $op, $word_id, $lang_id, $title, $header, $data, $button ); - } + } + /** + * Creates an option list for select tags + * + * @param array $options Array of values/text for dropdown + * @param mixed [$selected] Selected value or array of selected values + * @return string + */ + public function compileSelectOptions( $options, $selected='' ) + { + if( ! is_array( $selected ) ) + { + $selected = array( $selected ); + } + + $html = ''; + if( is_array( $options ) ) + { + foreach( $options as $option ) + { + $sel = ( $option[0] AND in_array( $option[0], $selected ) ) ? ' selected="selected"' : ''; + $val = ( $option[0] == 'disabled' ) ? 'disabled="disabled"' : "value='{$option[0]}'"; + + $html .= ""; + } + } + + return $html; + } + + /** + * Adds the button and content to the tab list for this object + * + * @param string $button + * @param string $content + * @param string [$js_action] + * @return @e void + */ + public function addTab( $button, $content, $js_action='', $default_tab=0 ) + { + $this->tab_buttons[] = $button; + $this->tab_tabs[] = $content; + $this->tab_js_action[] = $js_action; + + if( $default_tab ) + { + $this->default_tab = count( $this->tab_tabs ) - 1; + } + } + + /** + * Builds the html for the tabbed area + * + * @return string Tab HTML + */ + public function buildTabs() + { + /* Buttons */ + $i = 0; + $tabs = array(); + foreach( $this->tab_buttons as $i => $button ) + { + /* Tab Button */ + $js = ( $this->tab_js_action[$i] ) ? 'onmousedown="'.$this->tab_js_action[$i].'"' : ''; + $class = ( $i == 0 ) ? 'mini_tab_on' : 'mini_tab_off'; + $tabs[] = array( 'id' => $i, 'class' => $class, 'text' => $button, 'js' => $js ); + } + + /* Tab Contents */ + $i = 0; + $content = array(); + foreach( $this->tab_tabs as $tab ) + { + /* Create the pane */ + $content[] = array( 'id' => $i, 'content' => $tab ); + $i++; + } + + $default_tab = ( $this->default_tab ) ? $this->default_tab : ''; + + /* End of tab pane */ + $tabs = $this->html->ui_content_tabs( $tabs, $content, $default_tab ); + + return $tabs; + } + /** * Edit the entries in a word pack * - * @return void + * @return @e void */ public function languageEditWordPack() { @@ -1419,7 +1574,7 @@ class admin_core_languages_manage_languages extends ipsCommand /** * List the word packs available for the selected language set * - * @return void + * @return @e void * @author Josh */ public function languageListWordPacks() @@ -1449,10 +1604,9 @@ class admin_core_languages_manage_languages extends ipsCommand // Some init before looping //----------------------------------------- - $_packs = array(); - $_missing = array(); - $_stats = array(); - $_menus = array(); + $_packs = array(); + $_missing = array(); + $_stats = array(); while( $r = $this->DB->fetch() ) { @@ -1476,11 +1630,6 @@ class admin_core_languages_manage_languages extends ipsCommand if( ! in_array( $r['word_pack'], $_packs[$r['word_app']] ) ) { $_packs[$r['word_app']][] = $r['word_pack']; - $_menus[$r['word_app']][$r['word_pack']] = $this->registry->output->buildJavascriptMenu( array( - array( "{$this->settings['base_url']}{$this->form_code}&word_pack={$r['word_app']}/{$r['word_pack']}&do=edit_word_pack&id={$id}", $this->lang->words['edit'], 'edit' ), - array( "{$this->settings['base_url']}{$this->form_code}&word_pack={$r['word_app']}/{$r['word_pack']}&do=add_word_entry&id={$id}&word_app={$r['word_app']}", "{$this->lang->words['l_addnew']}...", 'add' ), - array( "{$this->settings['base_url']}{$this->form_code}&word_pack={$r['word_app']}/{$r['word_pack']}&do=remove_word_pack&id={$id}&word_app={$r['word_app']}", "{$this->lang->words['l_remove_pack']}...", 'delete' ), - ) ); } //----------------------------------------- @@ -1515,7 +1664,7 @@ class admin_core_languages_manage_languages extends ipsCommand $default_tab = ( $app == $this->request['app'] ) ? 1 : 0; asort($_packs[$app]); - $this->registry->output->addTab( $data['app_title'], $this->html->languageAppPackList( $app, $_packs[$app], $_stats[$app], $_menus[$app] ), '', $default_tab ); + $this->addTab( $data['app_title'], $this->html->languageAppPackList( $app, $_packs[$app], $_stats[$app] ), '', $default_tab ); } } @@ -1523,14 +1672,14 @@ class admin_core_languages_manage_languages extends ipsCommand // And output //----------------------------------------- - $this->registry->output->html .= $this->html->languageWordPackList( $id, $this->registry->output->buildTabs(), $data['app_title'] ); + $this->registry->output->html .= $this->html->languageWordPackList( $id, $this->buildTabs(), $data['app_title'] ); } /** * Handles the language information form submit * * @param string $mode Either new or edit - * @return void + * @return @e void */ public function handleLanguageInformationForm( $mode='new' ) { @@ -1597,9 +1746,9 @@ class admin_core_languages_manage_languages extends ipsCommand // Create directory //----------------------------------------- - @mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, 0777 ); + @mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION ); @file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/index.html', '' ); - @chmod( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, 0777 ); + @chmod( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION ); //----------------------------------------- // Copy over language bits from default lang @@ -1665,7 +1814,7 @@ class admin_core_languages_manage_languages extends ipsCommand * Builds the language information form * * @param string $mode new or edit - * @return void + * @return @e void */ public function languageInformationForm( $mode='new' ) { @@ -1706,10 +1855,10 @@ class admin_core_languages_manage_languages extends ipsCommand // Set some defaults //----------------------------------------- - $data['lang_title'] = ( isset( $this->request['lang_title'] ) && $this->request['lang_title'] ) ? $this->request['lang_title'] : $data['lang_title']; - $data['lang_short'] = ( isset( $this->request['lang_short'] ) && $this->request['lang_short'] ) ? $this->request['lang_short'] : $data['lang_short']; - $data['lang_default'] = ( isset( $this->request['lang_default'] ) && $this->request['lang_default'] ) ? $this->request['lang_default'] : $data['lang_default']; - $data['lang_isrtl'] = ( isset( $this->request['lang_isrtl'] ) && $this->request['lang_isrtl'] ) ? $this->request['lang_isrtl'] : $data['lang_isrtl']; + $data['lang_title'] = !empty( $this->request['lang_title'] ) ? $this->request['lang_title'] : $data['lang_title']; + $data['lang_short'] = !empty( $this->request['lang_short'] ) ? $this->request['lang_short'] : $data['lang_short']; + $data['lang_default'] = !empty( $this->request['lang_default'] ) ? $this->request['lang_default'] : $data['lang_default']; + $data['lang_isrtl'] = !empty( $this->request['lang_isrtl'] ) ? $this->request['lang_isrtl'] : $data['lang_isrtl']; $data['lang_default'] = $this->registry->output->formYesNo( 'lang_default', $data['lang_default'] ); $data['lang_isrtl'] = $this->registry->output->formYesNo( 'lang_isrtl', $data['lang_isrtl'] ); @@ -1725,13 +1874,13 @@ class admin_core_languages_manage_languages extends ipsCommand /** * Lists currently installed languages * - * @return void + * @return @e void */ public function languagesList() { /* Do we have a valid translation session? */ $session = $this->DB->buildandFetch( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key='translate_session'" ) ); - $sessionData = ( strstr( $session['cs_value'], 'a:' ) ) ? unserialize( $session['cs_value'] ) : array(); + $sessionData = IPSLib::isSerialized($session['cs_value']) ? unserialize( $session['cs_value'] ) : array(); $hasTranslate = false; /* Check */ @@ -1765,58 +1914,48 @@ class admin_core_languages_manage_languages extends ipsCommand $this->registry->class_localization->local_data = localeconv(); $_menu = array(); - - $_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=edit_lang_info&id={$r['lang_id']}", $this->lang->words['edit'], 'edit' ); - + if( $r['lang_protected'] && ! IN_DEV ) { $_menu[] = array( "", $this->lang->words['lang_pack_protected'], 'edit' ); } else { - $_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=list_word_packs&id={$r['lang_id']}", $this->lang->words['language_list_translate'], 'info' ); + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$r['lang_id']}", $this->lang->words['language_list_translate'], 'info' ); /* If we don't have a current session... */ if ( ! $hasTranslate ) { - $_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=translateExtSplash&id={$r['lang_id']}", $this->lang->words['language_list_translate_ext'], 'info' ); - } - - if( ! $r['lang_default'] ) - { - $_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=remove_language&id={$r['lang_id']}", $this->lang->words['delete'], 'delete', 1 ); + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=translateExtSplash&id={$r['lang_id']}", $this->lang->words['language_list_translate_ext'], 'info' ); } } - $_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] ); - $_menu[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=recache_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_recache'] ); + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] ); - $_menu[] = array( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=export&id={$r['lang_id']}", $this->lang->words['l_xmlexportfull'] ); + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}", $this->lang->words['l_xmlexportfull'], 'export' ); if ( $r['lang_id'] ) { - $_menu[] = array( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=rebuildFromXml&id={$r['lang_id']}&type=public", $this->lang->words['rebuild_lang_from_xml'] ); + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=rebuildFromXml&id={$r['lang_id']}&type=public", $this->lang->words['rebuild_lang_from_xml'] ); } foreach( ipsRegistry::$applications as $app_dir => $app_data ) { - $_menu[] = array( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=export&id={$r['lang_id']}&app_dir={$app_dir}", $this->lang->words['l_xmlexport'] . $app_data['app_title'] ); + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}&app_dir={$app_dir}", $this->lang->words['l_xmlexport'] . $app_data['app_title'], 'export' ); } - $menu = $this->registry->output->buildJavascriptMenu( $_menu ); - //----------------------------------------- // Data for output //----------------------------------------- - $rows[] = array( - 'title' => $r['lang_title'], - 'local' => $r['lang_short'], - 'date' => $this->registry->class_localization->getDate( time(), 'long', 1 ) . '
' . $this->registry->class_localization->getDate( time(), 'short', 1 ), - 'money' => $this->registry->class_localization->formatMoney( '12345231.12', 0 ), - 'default' => ( $r['lang_default'] ) ? "{$this->lang->words[" : '', - 'menu' => $menu, - 'id' => $r['lang_id'], + $rows[] = array( 'title' => $r['lang_title'], + 'local' => $r['lang_short'], + 'date' => $this->registry->class_localization->getDate( time(), 'long', 1 ) . '
' . $this->registry->class_localization->getDate( time(), 'short', 1 ), + 'money' => $this->registry->class_localization->formatMoney( '12345231.12', 0 ), + 'default' => $r['lang_default'], + 'menu' => $_menu, + 'id' => $r['lang_id'], + 'protected'=> $r['lang_protected'], ); } @@ -1839,7 +1978,7 @@ class admin_core_languages_manage_languages extends ipsCommand * Updates the cached language files from the database * * @param integer ID of the language pack to export - * @return void + * @return @e void */ public function cacheToDisk( $lang_id ) { @@ -1871,7 +2010,7 @@ class admin_core_languages_manage_languages extends ipsCommand if( ! is_dir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' ) ) { - mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/', 0777 ); + mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/', IPS_FOLDER_PERMISSION ); } //----------------------------------------- @@ -1904,6 +2043,7 @@ class admin_core_languages_manage_languages extends ipsCommand foreach( $words as $word ) { + $word[1] = str_replace( "\\", "\\\\", $word[1] ); $word[1] = str_replace( '"', '\\"', $word[1] ); $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; } @@ -1915,6 +2055,7 @@ class admin_core_languages_manage_languages extends ipsCommand foreach( $words as $word ) { + $word[1] = str_replace( "\\", "\\\\", $word[1] ); $word[1] = str_replace( '"', '\\"', $word[1] ); $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; } @@ -1930,8 +2071,9 @@ class admin_core_languages_manage_languages extends ipsCommand foreach( $words as $word ) { + $word[1] = str_replace( "\\", "\\\\", $word[1] ); $word[1] = str_replace( '"', '\\"', $word[1] ); - + //----------------------------------------- // Protect swapped sprintf arguments // @link http://community.invisionpower.com/tracker/issue-22240-lang-strings-using-sprintf-argument-swapping/ @@ -1951,13 +2093,16 @@ class admin_core_languages_manage_languages extends ipsCommand $_dir = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/'; - @unlink( $_dir . $_file ); + if( is_file($_dir . $_file) ) + { + @unlink( $_dir . $_file ); + } if ( $fh = @fopen( $_dir . $_file, 'wb' ) ) { fwrite( $fh, $to_write, strlen( $to_write ) ); fclose( $fh ); - @chmod( $_dir . $_file, 0777 ); + @chmod( $_dir . $_file, IPS_FILE_PERMISSION ); } else { @@ -2015,7 +2160,7 @@ class admin_core_languages_manage_languages extends ipsCommand return; } - if ( ! file_exists( $this->request['file_location'] ) ) + if ( ! is_file( $this->request['file_location'] ) ) { $this->registry->output->global_message = $this->lang->words['l_noopen'] . $this->request['file_location']; $this->languagesList(); @@ -2045,7 +2190,7 @@ class admin_core_languages_manage_languages extends ipsCommand // Extract archive //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXMLArchive.php' ); + require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ $xmlarchive = new classXMLArchive(); //----------------------------------------- @@ -2121,7 +2266,7 @@ class admin_core_languages_manage_languages extends ipsCommand // Extract archive //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXMLArchive.php' ); + require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ $xmlarchive = new classXMLArchive(); //----------------------------------------- @@ -2176,7 +2321,7 @@ class admin_core_languages_manage_languages extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( $skip_charset ? 'utf-8' : IPS_DOC_CHAR_SET ); $xml->loadXML( $content ); @@ -2227,7 +2372,7 @@ class admin_core_languages_manage_languages extends ipsCommand if( @mkdir( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId ) ) { @file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $insertId . '/index.html', '' ); - @chmod( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId, 0777 ); + @chmod( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId, IPS_FOLDER_PERMISSION ); } //----------------------------------------- @@ -2308,6 +2453,8 @@ class admin_core_languages_manage_languages extends ipsCommand foreach( $lang_ids as $_lang_id ) { + $lang_entry = array(); + //----------------------------------------- // Build db array //----------------------------------------- @@ -2319,8 +2466,8 @@ class admin_core_languages_manage_languages extends ipsCommand 'word_key' => $lang['word_key'], 'word_default' => $lang['word_default'], 'word_custom' => $in_dev && !$ru ? '' : $lang['word_custom'], - 'word_js' => $lang['word_js'], - 'word_default_version' => ( $lang['word_default_version'] >= 30000 ) ? $lang['word_default_version'] : $LATESTVERSION['long'], + 'word_js' => intval($lang['word_js']), + 'word_default_version' => $lang['word_default_version'] ? $lang['word_default_version'] : $LATESTVERSION['long'], 'word_custom_version' => $lang['word_custom_version'], ); @@ -2389,7 +2536,10 @@ class admin_core_languages_manage_languages extends ipsCommand // Don't update default version //----------------------------------------- - unset( $db_array['word_default_version'] ); + // This causes no languages to show "out of date" on upgrade + // @link http://community.invisionpower.com/tracker/issue-31637-no-out-of-date-entries-for-language-string-updates + // This WAS added to fix a previously reported bug, however, so need to watch out for this + // unset( $db_array['word_default_version'] ); $counts['updates']++; $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" ); @@ -2513,7 +2663,7 @@ class admin_core_languages_manage_languages extends ipsCommand // Create the XML library //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->newXMLDocument(); $xml->addElement( 'languageexport' ); @@ -2553,16 +2703,35 @@ class admin_core_languages_manage_languages extends ipsCommand $content = array(); $_strings++; - $content = array( - 'word_app' => $r['word_app'], - 'word_pack' => $r['word_pack'], - 'word_key' => $r['word_key'], - 'word_default' => $r['word_default'], - 'word_custom' => $r['word_custom'], - 'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], - 'word_custom_version' => $r['word_custom_version'], - 'word_js' => $r['word_js'] - ); + if( $disk ) + { + $content = array( + 'word_app' => $r['word_app'], + 'word_pack' => $r['word_pack'], + 'word_key' => $r['word_key'], + 'word_default' => $r['word_default'], + //'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], + //'word_js' => $r['word_js'] + ); + + if( $r['word_js'] ) + { + $content['word_js'] = $r['word_js']; + } + } + else + { + $content = array( + 'word_app' => $r['word_app'], + 'word_pack' => $r['word_pack'], + 'word_key' => $r['word_key'], + 'word_default' => $r['word_default'], + 'word_custom' => $r['word_custom'], + 'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], + 'word_custom_version' => $r['word_custom_version'], + 'word_js' => $r['word_js'] + ); + } $xml->addElementAsRecord( 'languagegroup', 'lang', $content ); } @@ -2601,7 +2770,7 @@ class admin_core_languages_manage_languages extends ipsCommand // Create xml archive //----------------------------------------- - require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' ); + require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/ $xmlArchive = new classXMLArchive(); //----------------------------------------- @@ -2623,7 +2792,7 @@ class admin_core_languages_manage_languages extends ipsCommand * Builds the language db entries from cache * * @param boolean return as normal - * @return void + * @return @e void * @author Josh */ public function importFromCacheFiles( $returnAsNormal=TRUE ) @@ -2701,7 +2870,7 @@ class admin_core_languages_manage_languages extends ipsCommand fclose( $stdout ); } - require( $_dir . $f ); + require( $_dir . $f );/*noLibHook*/ //----------------------------------------- // Loop @@ -2724,7 +2893,7 @@ class admin_core_languages_manage_languages extends ipsCommand $this->DB->insert( 'core_sys_lang_words', $insert ); } - $msg[] = "Imported {$f} ({$inserted} added, {$updated} updated)..."; + $msg[] = sprintf( $this->lang->words['indev_lang_import'], $f, $inserted, $updated ); } else if( preg_match( '/(\.js)$/', $f ) AND $app == 'core' ) { @@ -2802,7 +2971,7 @@ class admin_core_languages_manage_languages extends ipsCommand if ( $returnAsNormal === TRUE ) { - $this->registry->output->global_message = implode( "
", $msg ); + $this->registry->output->setMessage( implode( "
", $msg ), true ); if ( ! $this->__daily ) { diff --git a/upload/admin/applications/core/modules_admin/languages/xml/index.html b/upload/admin/applications/core/modules_admin/languages/xml/index.html index f093152b..d644dd98 100644 --- a/upload/admin/applications/core/modules_admin/languages/xml/index.html +++ b/upload/admin/applications/core/modules_admin/languages/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/xml/menu.xml b/upload/admin/applications/core/modules_admin/languages/xml/menu.xml index b4705197..94158fd4 100644 --- a/upload/admin/applications/core/modules_admin/languages/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/languages/xml/menu.xml @@ -6,6 +6,7 @@ Языки системы + languages manage_languages 0 diff --git a/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml b/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml index 669bd2fa..8584058e 100644 --- a/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml @@ -2,6 +2,7 @@ Управление языками + core_languages lang_words diff --git a/upload/admin/applications/core/modules_admin/login/index.html b/upload/admin/applications/core/modules_admin/login/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/login/index.html +++ b/upload/admin/applications/core/modules_admin/login/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/login/manualResolver.php b/upload/admin/applications/core/modules_admin/login/manualResolver.php index 1815dc62..e6048ea4 100644 --- a/upload/admin/applications/core/modules_admin/login/manualResolver.php +++ b/upload/admin/applications/core/modules_admin/login/manualResolver.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * ACP Login/Logout Routines
- * Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
+ * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 17th August 2004 - * @version $Revision: 6990 $ + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -57,7 +57,7 @@ class admin_core_login_manualResolver extends ipsCommand /** * Initiate login handler * - * @return void + * @return @e void */ public function initHanLogin() { @@ -73,7 +73,7 @@ class admin_core_login_manualResolver extends ipsCommand * * @param object Registry reference * @param string Validation message - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry, $validationMessage='' ) { @@ -114,7 +114,7 @@ class admin_core_login_manualResolver extends ipsCommand /** * Check and verify the login was successful * - * @return void + * @return @e void */ public function loginComplete() { @@ -216,6 +216,7 @@ class admin_core_login_manualResolver extends ipsCommand $extra_query = str_replace( "/admin" , "" , $extra_query ); $extra_query = str_replace( '&' , '&', $extra_query ); $extra_query = preg_replace( "#&{1,}#" , "&", $extra_query ); + $extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query ); } //----------------------------------------- @@ -242,7 +243,7 @@ class admin_core_login_manualResolver extends ipsCommand 'session_url' => '', ) ); - $this->request[ 'adsess'] = $sess_id ; + $this->request['adsess'] = $sess_id; //----------------------------------------- // Redirect... @@ -252,14 +253,15 @@ class admin_core_login_manualResolver extends ipsCommand $this->_writeToLog( $this->request['username'], 'ok' ); - ipsRegistry::getClass('output')->redirect( $url, $this->lang->words['login_successful'] ); + ipsRegistry::getClass('output')->global_message = ''; + ipsRegistry::getClass('output')->silentRedirect( $url ); } } /** * Log the user out * - * @return void + * @return @e void */ public function loginOut() { @@ -280,7 +282,7 @@ class admin_core_login_manualResolver extends ipsCommand * Log the user out * * @param string Message to show on the form - * @return void + * @return @e void */ public function loginForm( $message='' ) { @@ -347,9 +349,9 @@ class admin_core_login_manualResolver extends ipsCommand $this->lang->words['gl_signinname'] = $this->lang->words['enter_username']; } - ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login']; - ipsRegistry::getClass('output')->html_main = str_replace( '<%CONTENT%>', ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data ), ipsRegistry::getClass('output')->global_template->global_main_wrapper_no_furniture() ); - ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main ); + ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login']; + ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data ); + ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main ); @header("Content-type: text/html"); print ipsRegistry::getClass('output')->html_main; @@ -361,7 +363,8 @@ class admin_core_login_manualResolver extends ipsCommand * * @param string Username * @param string ok/fail flag - * @return void + * @return @e void + * @note This is private so that a hacker couldn't get into ACP, upload a new hook that lets them clear the log, and then clear the login log */ private function _writeToLog( $username='', $flag='fail' ) { diff --git a/upload/admin/applications/core/modules_admin/logs/adminlogs.php b/upload/admin/applications/core/modules_admin/logs/adminlogs.php index a867c787..535741b4 100644 --- a/upload/admin/applications/core/modules_admin/logs/adminlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/adminlogs.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Admin logs
- * Last Updated: $LastChangedDate: 2010-06-15 21:25:19 -0400 (Tue, 15 Jun 2010) $
+ * Last Updated: $LastChangedDate: 2011-06-01 22:13:27 -0400 (Wed, 01 Jun 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6539 $ + * @version $Rev: 8938 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -26,18 +26,9 @@ if ( ! defined( 'IN_ACP' ) ) class admin_core_logs_adminlogs extends ipsCommand { - /** - * Generate some pretty colors for the logs - * - * @access protected - * @var array Different colors for different actions - */ - protected $colours = array(); - /** * Skin object * - * @access protected * @var object Skin templates */ protected $html; @@ -45,9 +36,8 @@ class admin_core_logs_adminlogs extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -79,22 +69,7 @@ class admin_core_logs_adminlogs extends ipsCommand $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] ); $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools§ion=logsSplash', $this->lang->words['nav_logssplash'] ); $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=adminlogs', $this->lang->words['alog_adminlogs'] ); - - //----------------------------------------- - // Add some colors from the paintbucket - //----------------------------------------- - - $this->colours = array( - "cat" => "green", - "forum" => "darkgreen", - "mem" => "red", - 'group' => "purple", - 'mod' => 'orange', - 'op' => 'darkred', - 'help' => 'darkorange', - 'modlog' => 'steelblue', - ); - + ///---------------------------------------- // What to do... //----------------------------------------- @@ -125,8 +100,7 @@ class admin_core_logs_adminlogs extends ipsCommand /** * View all logs for a given admin * - * @access protected - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _view() { @@ -134,7 +108,7 @@ class admin_core_logs_adminlogs extends ipsCommand // Basic init //----------------------------------------- - $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; ///---------------------------------------- // No mid or search string? @@ -147,17 +121,17 @@ class admin_core_logs_adminlogs extends ipsCommand return; } + $this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid']; + ///---------------------------------------- // mid? //----------------------------------------- if ( !$this->request['search_string'] ) { - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) ); + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'admin_logs', 'where' => "member_id=" . intval($this->request['mid']) ) ); - $row_count = $row['count']; - - $query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view"; + $query = "{$this->form_code}&mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&do=view"; $this->DB->build( array( 'select' => 'm.*', 'from' => array( 'admin_logs' => 'm' ), @@ -165,7 +139,7 @@ class admin_core_logs_adminlogs extends ipsCommand 'order' => 'm.ctime DESC', 'limit' => array( $start, 20 ), 'add_join' => array( - array( 'select' => 'mem.member_id, mem.members_display_name', + array( 'select' => 'mem.members_display_name', 'from' => array( 'members' => 'mem' ), 'where' => 'mem.member_id=m.member_id', 'type' => 'left' @@ -181,7 +155,7 @@ class admin_core_logs_adminlogs extends ipsCommand else { - $this->request[ 'search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) ); + $this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) ); if( !$this->DB->checkForField( $this->request['search_type'], 'admin_logs' ) ) { @@ -197,11 +171,9 @@ class admin_core_logs_adminlogs extends ipsCommand $dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'"; } - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) ); - - $row_count = $row['count']; - - $query = "&{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']); + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'admin_logs m', 'where' => $dbq ) ); + + $query = "{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']); $this->DB->build( array( 'select' => 'm.*', 'from' => array( 'admin_logs' => 'm' ), @@ -209,7 +181,7 @@ class admin_core_logs_adminlogs extends ipsCommand 'order' => 'm.ctime DESC', 'limit' => array( $start, 20 ), 'add_join' => array( - array( 'select' => 'mem.member_id, mem.members_display_name', + array( 'select' => 'mem.members_display_name', 'from' => array( 'members' => 'mem' ), 'where' => 'mem.member_id=m.member_id', 'type' => 'left' @@ -223,7 +195,7 @@ class admin_core_logs_adminlogs extends ipsCommand // Page links //----------------------------------------- - $links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count, + $links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'], 'itemsPerPage' => 20, 'currentStartValue' => $start, 'baseUrl' => $this->settings['base_url'] . $query, @@ -236,9 +208,17 @@ class admin_core_logs_adminlogs extends ipsCommand while ( $row = $this->DB->fetch() ) { - $row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' ); - $row['color'] = $this->colours[ $row['act'] ]; + if( !$row['member_id'] ) + { + $row['member_id'] = 'zero'; + } + + if( !$row['members_display_name'] ) + { + $row['members_display_name'] = $this->lang->words['noname_availabl']; + } + $row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' ); $rows[] = $row; } @@ -247,32 +227,31 @@ class admin_core_logs_adminlogs extends ipsCommand //----------------------------------------- $this->registry->output->html .= $this->html->adminlogsView( $rows, $links ); - } /** * Remove logs by an admin * - * @access protected - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _remove() { - if ( $this->request['mid'] == "" ) + if ( !$this->request['mid'] ) { $this->registry->output->showError( $this->lang->words['alog_whoselog'], 11114 ); } + $this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid']; + $this->DB->delete( 'admin_logs', "member_id=" . intval($this->request['mid']) ); - $this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" ); + $this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code ); } /** * List the current logs with links to view per-admin * - * @access protected - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _listCurrent() { @@ -284,24 +263,22 @@ class admin_core_logs_adminlogs extends ipsCommand //----------------------------------------- $this->DB->build( array( 'select' => 'm.*', - 'from' => array( 'admin_logs' => 'm' ), - 'order' => 'm.ctime DESC', - 'limit' => array( 5 ), - 'add_join' => array( - array( 'select' => 'mem.member_id, mem.members_display_name', - 'from' => array( 'members' => 'mem' ), - 'where' => 'mem.member_id=m.member_id', - 'type' => 'left' - ) + 'from' => array( 'admin_logs' => 'm' ), + 'order' => 'm.ctime DESC', + 'limit' => array( 5 ), + 'add_join' => array( + array( 'select' => 'mem.members_display_name', + 'from' => array( 'members' => 'mem' ), + 'where' => 'mem.member_id=m.member_id', + 'type' => 'left' ) + ) ) ); $this->DB->execute(); while ( $row = $this->DB->fetch() ) { $row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' ); - $row['color'] = $this->colours[ $row['act'] ]; - $rows[] = $row; } @@ -310,34 +287,34 @@ class admin_core_logs_adminlogs extends ipsCommand //----------------------------------------- $this->DB->build( array( - 'select' => 'member_id, count(member_id) as act_count', - 'from' => 'admin_logs', - 'group' => 'member_id', - 'order' => 'act_count DESC' - ) ); - + 'select' => 'count(l.member_id) as act_count, l.member_id', + 'from' => array( 'admin_logs' => 'l' ), + 'group' => 'l.member_id', + 'order' => 'act_count DESC', + 'add_join' => array( + array( + 'select' => 'm.members_display_name', + 'from' => array( 'members' => 'm' ), + 'where' => 'm.member_id=l.member_id', + 'type' => 'left', + ), + ), + ) ); $this->DB->execute(); - - $_members = array(); - $_store = array(); - while ( $r = $this->DB->fetch() ) - { - $_members[] = $r['member_id']; - $admins[ $r['member_id'] ] = $r; - } - - if ( !empty( $_members ) ) + + while ( $r = $this->DB->fetch() ) { - $this->DB->build( array( 'select' => 'member_id, members_display_name', - 'from' => 'members', - 'where' => 'member_id IN (' . implode( ',', $_members ) . ')', - ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) + if( !$r['member_id'] ) { - $admins[ $r['member_id'] ] = array_merge( $r, $admins[ $r['member_id'] ] ); + $r['member_id'] = 'zero'; } + + if( !$r['members_display_name'] ) + { + $r['members_display_name'] = $this->lang->words['noname_availabl']; + } + + $admins[ $r['member_id'] ] = $r; } //----------------------------------------- diff --git a/upload/admin/applications/core/modules_admin/logs/defaultSection.php b/upload/admin/applications/core/modules_admin/logs/defaultSection.php index 11bd6227..00e35710 100644 --- a/upload/admin/applications/core/modules_admin/logs/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/logs/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default logs section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'logs' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'adminlogs'; diff --git a/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php b/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php index f9e70ac2..52af9b14 100644 --- a/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Email error logs
- * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 5713 $ + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,17 +29,15 @@ class admin_core_logs_emailerrorlogs extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -103,10 +101,9 @@ class admin_core_logs_emailerrorlogs extends ipsCommand /** * Remove email logs * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _remove() + protected function _remove() { if ( $this->request['type'] == 'all' ) { @@ -147,10 +144,9 @@ class admin_core_logs_emailerrorlogs extends ipsCommand /** * List the current logs * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _listCurrent() + protected function _listCurrent() { $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; @@ -163,8 +159,6 @@ class admin_core_logs_emailerrorlogs extends ipsCommand if ( $this->request['type'] AND $this->request['type'] != "" ) { - $this->registry->output->html_help_title .= $this->lang->words['erlog_results']; - $string = IPSText::parseCleanValue( urldecode($this->request['string']) ); if ( $string == "" ) @@ -245,12 +239,11 @@ class admin_core_logs_emailerrorlogs extends ipsCommand /** * View an individual email * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _viewEmail() + protected function _viewEmail() { - if ( $this->request['id'] == "" ) + if ( !$this->request['id'] ) { $this->registry->output->showError( $this->lang->words['erlog_404'], 11117 ); } diff --git a/upload/admin/applications/core/modules_admin/logs/emaillogs.php b/upload/admin/applications/core/modules_admin/logs/emaillogs.php deleted file mode 100644 index 2020a1db..00000000 --- a/upload/admin/applications/core/modules_admin/logs/emaillogs.php +++ /dev/null @@ -1,428 +0,0 @@ - - * Invision Power Services - * IP.Board v3.1.4 - * Email logs - * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 27th January 2004 - * @version $Rev: 5713 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_logs_emaillogs extends ipsCommand -{ - /** - * Skin object - * - * @access private - * @var object Skin templates - */ - private $html; - - /** - * Main class entry point - * - * @access public - * @param object ipsRegistry reference - * @return void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - //----------------------------------------- - // Load skin - //----------------------------------------- - - $this->html = $this->registry->output->loadTemplate('cp_skin_emaillogs'); - - //----------------------------------------- - // Set up stuff - //----------------------------------------- - - $this->form_code = $this->html->form_code = 'module=logs&section=emaillogs'; - $this->form_code_js = $this->html->form_code_js = 'module=logs§ion=emaillogs'; - - //----------------------------------------- - // Load lang - //----------------------------------------- - - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); - - //----------------------------------------- - // Fix up navigation bar - //----------------------------------------- - - $this->registry->output->core_nav = array(); - $this->registry->output->ignoreCoreNav = true; - $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] ); - $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools§ion=logsSplash', $this->lang->words['nav_logssplash'] ); - $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=emaillogs', $this->lang->words['elog_emaillogs'] ); - - ///---------------------------------------- - // What to do... - //----------------------------------------- - - switch( $this->request['do'] ) - { - default: - case 'list': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emaillogs_view' ); - $this->_listCurrent(); - break; - - case 'remove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emaillogs_delete' ); - $this->_remove(); - break; - - case 'viewemail': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emaillogs_view' ); - $this->_viewEmail(); - break; - } - - /* Output */ - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * Remove email logs - * - * @access private - * @return void [Outputs to screen] - */ - private function _remove() - { - if ( $this->request['type'] == 'all' ) - { - $this->DB->delete( 'email_logs' ); - } - else - { - $ids = array(); - - foreach ( $this->request as $k => $v ) - { - if ( preg_match( "/^id_(\d+)$/", $k, $match ) ) - { - if ($this->request[ $match[0] ] ) - { - $ids[] = $match[1]; - } - } - } - - $ids = IPSLib::cleanIntArray( $ids ); - - //----------------------------------------- - - if ( count($ids) < 1 ) - { - $this->registry->output->showError( $this->lang->words['elog_noneselected'], 11119 ); - } - - $this->DB->delete( 'email_logs', "email_id IN (" . implode( ',', $ids ) . ")" ); - } - - $this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['elog_removed'] ); - - $this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" ); - } - - /** - * List the current logs - * - * @access private - * @return void [Outputs to screen] - */ - private function _listCurrent() - { - $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; - - //----------------------------------------- - // Check URL parameters - //----------------------------------------- - - $url_query = array(); - $db_query = array(); - - if ( $this->request['type'] AND $this->request['type'] != "" ) - { - $this->registry->output->html_help_title .= $this->lang->words['elog_results']; - - switch( $this->request['type'] ) - { - case 'fromid': - $url_query[] = 'type=fromid'; - $url_query[] = 'id=' . intval($this->request['id']); - $db_query[] = 'email.from_member_id=' . intval($this->request['id']); - break; - - case 'toid': - $url_query[] = 'type=toid'; - $url_query[] = 'id=' . intval($this->request['id']); - $db_query[] = 'email.to_member_id=' . intval($this->request['id']); - break; - - case 'subject': - $string = IPSText::parseCleanValue( urldecode($this->request['string']) ); - - if ( $string == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_notsearched'], 11120 ); - } - - $url_query[] = 'type=' . $this->request['type']; - $url_query[] = 'string=' . urlencode($string); - $db_query[] = $this->request['match'] == 'loose' ? "email.email_subject LIKE '%{$string}%'" : "email.email_subject='{$string}'"; - break; - - case 'content': - $string = IPSText::parseCleanValue( urldecode($this->request['string']) ); - - if ( $string == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_notsearched'], 11121 ); - } - - $url_query[] = 'type=' . $this->request['type']; - $url_query[] = 'string=' . urlencode($string); - $db_query[] = $this->request['match'] == 'loose' ? "email.email_content LIKE '%{$string}%'" : "email.email_content='{$string}'"; - break; - - case 'email_from': - $string = IPSText::parseCleanValue( urldecode($this->request['string']) ); - - if ( $string == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_notsearched'], 11122 ); - } - - $url_query[] = 'type=' . $this->request['type']; - $url_query[] = 'string=' . urlencode($string); - $db_query[] = $this->request['match'] == 'loose' ? "email.from_email_address LIKE '%{$string}%'" : "email.from_email_address='{$string}'"; - break; - - case 'email_to': - $string = IPSText::parseCleanValue( urldecode($this->request['string']) ); - - if ( $string == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_notsearched'], 11123 ); - } - - $url_query[] = 'type=' . $this->request['type']; - $url_query[] = 'string=' . urlencode($string); - $db_query[] = $this->request['match'] == 'loose' ? "email.to_email_address LIKE '%{$string}%'" : "email.to_email_address='{$string}'"; - break; - - case 'name_from': - $string = IPSText::parseCleanValue( urldecode($this->request['string']) ); - - if ( $string == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_notsearched'], 11124 ); - } - - if ( $this->request['match'] == 'loose' ) - { - $this->DB->build( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name LIKE '%{$string}%'" ) ); - $this->DB->execute(); - - if ( ! $this->DB->getTotalRows() ) - { - $this->registry->output->showError( $this->lang->words['elog_nomatches'], 111160 ); - } - - $ids = array(); - - while ( $r = $this->DB->fetch() ) - { - $ids[] = $r['member_id']; - } - - $db_query[] = 'email.from_member_id IN(' . implode( ',', $ids ) . ')'; - } - else - { - $r = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name='{$string}'" ) ); - - if ( ! $r['member_id'] ) - { - $this->registry->output->showError( $this->lang->words['elog_nomatches'], 11125 ); - } - - $db_query[] = 'email.from_member_id=' . $r['member_id']; - } - - $url_query[] = 'type=' . $this->request['type']; - $url_query[] = 'string=' . urlencode($string); - break; - - case 'name_to': - $string = urldecode($this->request['string']); - - if ( $string == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_notsearched'], 11126 ); - } - - if ( $this->request['match'] == 'loose' ) - { - $this->DB->build( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name LIKE '%{$string}%'" ) ); - $this->DB->execute(); - - if ( ! $this->DB->getTotalRows() ) - { - $this->registry->output->showError( $this->lang->words['elog_nomatches'], 11127 ); - } - - $ids = array(); - - while ( $r = $this->DB->fetch() ) - { - $ids[] = $r['member_id']; - } - - $db_query[] = 'email.to_member_id IN(' . implode( ',', $ids ) . ')'; - } - else - { - $r = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'where' => "members_display_name='{$string}'" ) ); - - if ( ! $r['member_id'] ) - { - $this->registry->output->showError( $this->lang->words['elog_nomatches'], 11128 ); - } - - $db_query[] = 'email.to_member_id=' . $r['member_id']; - } - - $url_query[] = 'type=' . $this->request['type']; - $url_query[] = 'string=' . urlencode($string); - break; - } - } - - if( $this->request['match'] ) - { - $url_query[] = 'match=' . $this->request['match']; - } - - //----------------------------------------- - // LIST 'EM - //----------------------------------------- - - $dbe = ""; - $url = ""; - - if ( count($db_query) > 0 ) - { - $dbe = implode(' AND ', $db_query ); - } - - if ( count($url_query) > 0 ) - { - $url = '&' . implode( '&', $url_query ); - } - - $count = $this->DB->buildAndFetch( array( 'select' => 'count(email.email_id) as cnt', - 'from' => 'email_logs email', - 'where' => $dbe ) ); - - $links = $this->registry->output->generatePagination( array( 'totalItems' => $count['cnt'], - 'itemsPerPage' => 25, - 'currentStartValue' => $start, - 'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}" . $url, - ) - ); - - $this->DB->build( array( 'select' => 'email.*', - 'from' => array( 'email_logs' => 'email' ), - 'where' => $dbe, - 'order' => 'email.email_date DESC', - 'limit' => array( $start, 25 ), - 'add_join' => array( - array( 'select' => 'm.member_id, m.members_display_name', - 'from' => array( 'members' => 'm' ), - 'where' => 'm.member_id=email.from_member_id', - 'type' => 'left' - ), - array( 'select' => 'mem.member_id as to_id, mem.members_display_name as to_name', - 'from' => array( 'members' => 'mem' ), - 'where' => 'mem.member_id=email.to_member_id', - 'type' => 'left' - ), - ) - ) ); - $this->DB->execute(); - - while ( $row = $this->DB->fetch() ) - { - $row['_date'] = $this->registry->class_localization->getDate( $row['email_date'], 'SHORT' ); - - $rows[] = $row; - } - - $this->registry->output->html .= $this->html->emaillogsWrapper( $rows, $links ); - } - - /** - * View a single email - * - * @access private - * @return void [Outputs to screen] - */ - private function _viewEmail() - { - if ( $this->request['id'] == "" ) - { - $this->registry->output->showError( $this->lang->words['elog_log_404'], 11129 ); - } - - $id = intval($this->request['id']); - - $row = $this->DB->buildAndFetch( array( 'select' => 'email.*', - 'from' => array( 'email_logs' => 'email' ), - 'where' => 'email.email_id=' . $id, - 'add_join' => array( - array( 'select' => 'm.member_id, m.members_display_name as name', - 'from' => array( 'members' => 'm' ), - 'where' => 'm.member_id=email.from_member_id', - 'type' => 'left' - ), - array( 'select' => 'mem.member_id as to_id, mem.members_display_name as to_name', - 'from' => array( 'members' => 'mem' ), - 'where' => 'mem.member_id=email.to_member_id', - 'type' => 'left' - ), - ) - ) ); - - if ( ! $row['email_id'] ) - { - $this->registry->output->showError( $this->lang->words['elog_log_404'], 11130 ); - } - - $row['_date'] = $this->registry->class_localization->getDate( $row['email_date'], 'LONG' ); - - $this->registry->output->html .= $this->html->emaillogsEmail( $row ); - - $this->registry->output->printPopupWindow(); - } -} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/errorlogs.php b/upload/admin/applications/core/modules_admin/logs/errorlogs.php index 2fdec191..78eade12 100644 --- a/upload/admin/applications/core/modules_admin/logs/errorlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/errorlogs.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Error logs
- * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 5713 $ + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,17 +29,15 @@ class admin_core_logs_errorlogs extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -98,10 +96,9 @@ class admin_core_logs_errorlogs extends ipsCommand /** * Remove email logs * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _remove() + protected function _remove() { if( $this->request['type'] == 'all' ) { @@ -142,10 +139,9 @@ class admin_core_logs_errorlogs extends ipsCommand /** * List the current logs * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _listCurrent() + protected function _listCurrent() { $start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0; diff --git a/upload/admin/applications/core/modules_admin/logs/index.html b/upload/admin/applications/core/modules_admin/logs/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/logs/index.html +++ b/upload/admin/applications/core/modules_admin/logs/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/logsSplash.php b/upload/admin/applications/core/modules_admin/logs/logsSplash.php new file mode 100644 index 00000000..509499fe --- /dev/null +++ b/upload/admin/applications/core/modules_admin/logs/logsSplash.php @@ -0,0 +1,74 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class admin_core_logs_logsSplash + * @brief Logs splash screen + * + */ +class admin_core_logs_logsSplash extends ipsCommand +{ + /** + * Skin object shortcut + * + * @var $html + */ + protected $html; + + /** + * String for the screen url bit + * + * @var $form_code + */ + public $form_code = ''; + + /** + * String for the JS url bit + * + * @var $form_code_js + */ + public $form_code_js = ''; + + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Load Template */ + $this->html = $this->registry->output->loadTemplate( 'cp_skin_adminlogs' ); + + /* Load Language */ + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); + + /* URL Bits */ + $this->form_code = $this->html->form_code = 'module=logs&section=splash'; + $this->form_code_js = $this->html->form_code_js = 'module=logs§ion=splash'; + + /* Get the splash screen */ + $this->registry->output->html .= $this->html->logSplashScreen(); + + /* Output */ + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/mobilelogs.php b/upload/admin/applications/core/modules_admin/logs/mobilelogs.php index f96db259..fb6ac5f5 100644 --- a/upload/admin/applications/core/modules_admin/logs/mobilelogs.php +++ b/upload/admin/applications/core/modules_admin/logs/mobilelogs.php @@ -3,18 +3,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Mobile Notification logs
- * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,17 +28,15 @@ class admin_core_logs_mobilelogs extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -94,8 +92,7 @@ class admin_core_logs_mobilelogs extends ipsCommand /** * Remove log * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _remove() { @@ -136,8 +133,7 @@ class admin_core_logs_mobilelogs extends ipsCommand /** * List the current logs * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _listCurrent() { diff --git a/upload/admin/applications/core/modules_admin/logs/modlogs.php b/upload/admin/applications/core/modules_admin/logs/modlogs.php index f54f477b..b2bdebb1 100644 --- a/upload/admin/applications/core/modules_admin/logs/modlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/modlogs.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Moderator logs
- * Last Updated: $LastChangedDate: 2010-09-24 21:21:39 -0400 (Fri, 24 Sep 2010) $
+ * Last Updated: $LastChangedDate: 2011-09-15 17:04:35 -0400 (Thu, 15 Sep 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6915 $ + * @version $Rev: 9495 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,7 +29,6 @@ class admin_core_logs_modlogs extends ipsCommand /** * Skin object * - * @access protected * @var object Skin templates */ protected $html; @@ -37,9 +36,8 @@ class admin_core_logs_modlogs extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -102,8 +100,7 @@ class admin_core_logs_modlogs extends ipsCommand /** * View all logs for a given moderator * - * @access protected - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _view() { @@ -111,7 +108,7 @@ class admin_core_logs_modlogs extends ipsCommand // Basic init //----------------------------------------- - $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; ///---------------------------------------- // No mid or search string? @@ -124,17 +121,17 @@ class admin_core_logs_modlogs extends ipsCommand return; } + $this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid']; + ///---------------------------------------- // mid? //----------------------------------------- if ( !$this->request['search_string'] ) { - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'moderator_logs', 'where' => "member_id=" . intval($this->request['mid']) ) ); + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(id) as count', 'from' => 'moderator_logs', 'where' => "member_id=" . intval($this->request['mid']) ) ); - $row_count = $row['count']; - - $query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view"; + $query = "{$this->form_code}&mid=" . ( $this->request['mid'] ? $this->request['mid'] : 'zero' ) . "&do=view"; $this->DB->build( array( 'select' => 'm.*', 'from' => array( 'moderator_logs' => 'm' ), @@ -156,6 +153,11 @@ class admin_core_logs_modlogs extends ipsCommand ) ); $this->DB->execute(); } + + ///---------------------------------------- + // search string? + //----------------------------------------- + else { $this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) ); @@ -174,29 +176,27 @@ class admin_core_logs_modlogs extends ipsCommand $dbq = "m." . $this->request['search_type'] . " LIKE '%" . $this->request['search_string'] . "%'"; } - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'moderator_logs m', 'where' => $dbq ) ); + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(m.member_id) as count', 'from' => 'moderator_logs m', 'where' => $dbq ) ); - $row_count = $row['count']; - - $query = "&{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=".urlencode($this->request['search_string']); + $query = "{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']); $this->DB->build( array( 'select' => 'm.*', - 'from' => array( 'moderator_logs' => 'm' ), - 'where' => $dbq, - 'order' => 'm.ctime DESC', - 'limit' => array( $start, 20 ), - 'add_join' => array( - array( 'select' => 'mem.members_display_name', - 'from' => array( 'members' => 'mem' ), - 'where' => 'mem.member_id=m.member_id', - 'type' => 'left', - ), - array( 'select' => 'f.id as forum_id, f.name', - 'from' => array( 'forums' => 'f' ), - 'where' => 'f.id=m.forum_id', - 'type' => 'left', - ), - ) + 'from' => array( 'moderator_logs' => 'm' ), + 'where' => $dbq, + 'order' => 'm.ctime DESC', + 'limit' => array( $start, 20 ), + 'add_join' => array( + array( 'select' => 'mem.members_display_name', + 'from' => array( 'members' => 'mem' ), + 'where' => 'mem.member_id=m.member_id', + 'type' => 'left', + ), + array( 'select' => 'f.id as forum_id, f.name', + 'from' => array( 'forums' => 'f' ), + 'where' => 'f.id=m.forum_id', + 'type' => 'left', + ), + ) ) ); $this->DB->execute(); } @@ -205,7 +205,7 @@ class admin_core_logs_modlogs extends ipsCommand // Page links //----------------------------------------- - $links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count, + $links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'], 'itemsPerPage' => 20, 'currentStartValue' => $start, 'baseUrl' => $this->settings['base_url'] . $query, @@ -218,6 +218,16 @@ class admin_core_logs_modlogs extends ipsCommand while ( $row = $this->DB->fetch() ) { + if( !$row['member_id'] ) + { + $row['member_id'] = 'zero'; + } + + if( !$row['members_display_name'] ) + { + $row['members_display_name'] = $this->lang->words['noname_availablm']; + } + $row['_time'] = $this->registry->class_localization->getDate( $row['ctime'], 'LONG' ); $row['topic'] = $row['topic_id'] ? $this->lang->words['mlog_topicid'] . $row['topic_id'] : ' '; $row['http_referer'] = preg_replace( "/s=(\w){32}/" , "", $row['http_referer'] ); @@ -235,28 +245,28 @@ class admin_core_logs_modlogs extends ipsCommand /** * Remove logs by a moderator * - * @access protected - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _remove() { - if ( $this->request['mid'] == "" ) + if ( !$this->request['mid'] ) { $this->registry->output->showError( $this->lang->words['mlog_noid'], 11131 ); } + $this->request['mid'] = $this->request['mid'] == 'zero' ? 0 : $this->request['mid']; + $this->DB->delete( 'moderator_logs', "member_id=" . intval($this->request['mid']) ); $this->registry->getClass('adminFunctions')->saveAdminLog( $this->lang->words['mlog_removed'] . $this->request['mid'] ); - $this->registry->output->silentRedirect( $this->settings['base_url'] . "&{$this->form_code}" ); + $this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code ); } /** * List the current logs with links to view per-admin * - * @access protected - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _listCurrent() { @@ -298,36 +308,36 @@ class admin_core_logs_modlogs extends ipsCommand //----------------------------------------- // All mods //----------------------------------------- - + $this->DB->build( array( - 'select' => 'member_id, count(member_id) as act_count', - 'from' => 'moderator_logs', - 'group' => 'member_id', - 'order' => 'act_count DESC' - ) ); - + 'select' => 'count(l.member_id) as act_count, l.member_id', + 'from' => array( 'moderator_logs' => 'l' ), + 'group' => 'l.member_id', + 'order' => 'act_count DESC', + 'add_join' => array( + array( + 'select' => 'm.members_display_name', + 'from' => array( 'members' => 'm' ), + 'where' => 'm.member_id=l.member_id', + 'type' => 'left', + ), + ), + ) ); $this->DB->execute(); - - $_members = array(); - $_store = array(); - while ( $r = $this->DB->fetch() ) - { - $_members[] = $r['member_id']; - $admins[ $r['member_id'] ] = $r; - } - - if ( !empty( $_members ) ) + + while ( $r = $this->DB->fetch() ) { - $this->DB->build( array( 'select' => 'member_id, members_display_name', - 'from' => 'members', - 'where' => 'member_id IN (' . implode( ',', $_members ) . ')', - ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) + if( !$r['member_id'] ) { - $admins[ $r['member_id'] ] = array_merge( $r, $admins[ $r['member_id'] ] ); + $r['member_id'] = 'zero'; } + + if( !$r['members_display_name'] ) + { + $r['members_display_name'] = $this->lang->words['noname_availablm']; + } + + $admins[ $r['member_id'] ] = $r; } //----------------------------------------- diff --git a/upload/admin/applications/core/modules_admin/logs/spamlogs.php b/upload/admin/applications/core/modules_admin/logs/spamlogs.php index 7c868a83..d117b410 100644 --- a/upload/admin/applications/core/modules_admin/logs/spamlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/spamlogs.php @@ -3,18 +3,18 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Admin logs
- * Last Updated: $LastChangedDate: 2010-09-30 21:47:05 -0400 (Thu, 30 Sep 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-12 22:28:10 -0400 (Thu, 12 May 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6929 $ + * @link http://hatynka.in + * @version $Rev: 8754 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,17 +28,15 @@ class admin_core_logs_spamlogs extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -94,8 +92,7 @@ class admin_core_logs_spamlogs extends ipsCommand /** * Remove log * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _remove() { @@ -136,8 +133,7 @@ class admin_core_logs_spamlogs extends ipsCommand /** * List the current logs * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _listCurrent() { diff --git a/upload/admin/applications/core/modules_admin/logs/spiderlogs.php b/upload/admin/applications/core/modules_admin/logs/spiderlogs.php index 48bcfdda..315afef6 100644 --- a/upload/admin/applications/core/modules_admin/logs/spiderlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/spiderlogs.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Search Engine Spider logs
- * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-11 22:11:30 -0400 (Wed, 11 May 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 5713 $ + * @version $Rev: 8734 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,25 +29,22 @@ class admin_core_logs_spiderlogs extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Spider map * - * @access private * @var array Spider keys to values */ - private $bot_map = array(); + protected $bot_map = array(); /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -119,10 +116,9 @@ class admin_core_logs_spiderlogs extends ipsCommand /** * View all logs for a given moderator * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _view() + protected function _view() { ///---------------------------------------- // Basic init @@ -157,10 +153,10 @@ class admin_core_logs_spiderlogs extends ipsCommand $query = "&{$this->form_code}&bid=" . $this->request['bid'] . "&do=view"; $this->DB->build( array( 'select' => '*', - 'from' => 'spider_logs', - 'where' => "bot='{$botty}'", - 'order' => 'entry_date DESC', - 'limit' => array( $start, 20 ) ) ); + 'from' => 'spider_logs', + 'where' => "bot='{$botty}'", + 'order' => 'entry_date DESC', + 'limit' => array( $start, 20 ) ) ); $this->DB->execute(); } else @@ -174,10 +170,10 @@ class admin_core_logs_spiderlogs extends ipsCommand $query = "&{$this->form_code}&do=view&search_string=" . urlencode($this->request['search_string']); $this->DB->build( array( 'select' => '*', - 'from' => 'spider_logs', - 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'", - 'order' => 'entry_date DESC', - 'limit' => array( $start, 20 ) ) ); + 'from' => 'spider_logs', + 'where' => "(query_string LIKE '%" . $this->request['search_string'] . "%') OR (request_addr LIKE '%" . $this->request['search_string'] . "%')", + 'order' => 'entry_date DESC', + 'limit' => array( $start, 20 ) ) ); $this->DB->execute(); } @@ -200,15 +196,22 @@ class admin_core_logs_spiderlogs extends ipsCommand { $extra = ""; - if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false ) + if( $row['query_string'] ) { - $extra = $this->lang->words['slog_lofi']; - - $query_string_html = $extra . ' ' . $row['query_string']; + if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false ) + { + $extra = $this->lang->words['slog_lofi']; + + $query_string_html = $extra . ' ' . $row['query_string']; + } + else + { + $query_string_html = "settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . ""; + } } else { - $query_string_html = "settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . ""; + $query_string_html = "" . IPSText::truncate($row['request_addr']) . ""; } $row['_bot_name'] = $this->bot_map[ mb_strtolower($row['bot']) ]; @@ -228,10 +231,9 @@ class admin_core_logs_spiderlogs extends ipsCommand /** * Remove logs by a moderator * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _remove() + protected function _remove() { if ( $this->request['bid'] == "" ) { @@ -252,10 +254,9 @@ class admin_core_logs_spiderlogs extends ipsCommand /** * List the current logs with links to view per-admin * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _listCurrent() + protected function _listCurrent() { $spiders = array(); @@ -264,9 +265,9 @@ class admin_core_logs_spiderlogs extends ipsCommand //----------------------------------------- $this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date', - 'from' => 'spider_logs', - 'group' => 'bot', - 'order' => 'entry_date DESC', + 'from' => 'spider_logs', + 'group' => 'bot', + 'order' => 'entry_date DESC', ) ); $this->DB->execute(); @@ -284,6 +285,5 @@ class admin_core_logs_spiderlogs extends ipsCommand //----------------------------------------- $this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders ); - } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/sqlerror.php b/upload/admin/applications/core/modules_admin/logs/sqlerror.php index e7566453..0f259e33 100644 --- a/upload/admin/applications/core/modules_admin/logs/sqlerror.php +++ b/upload/admin/applications/core/modules_admin/logs/sqlerror.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * SQL error logs
- * Last Updated: $LastChangedDate: 2010-06-16 02:25:19 +0100 (Wed, 16 Jun 2010) $
+ * Last Updated: $LastChangedDate: 2011-07-26 04:00:17 -0400 (Tue, 26 Jul 2011) $
  * 
* - * @author $Author: matt $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6539 $ + * @version $Rev: 9317 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -36,7 +36,7 @@ class admin_core_logs_sqlerror extends ipsCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -84,6 +84,11 @@ class admin_core_logs_sqlerror extends ipsCommand $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' ); $this->_remove(); break; + + case 'delete_all': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_delete' ); + $this->_remove( true ); + break; default: $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'sqlerrorlogs_view' ); @@ -99,7 +104,7 @@ class admin_core_logs_sqlerror extends ipsCommand /** * View an SQL log * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _view() { @@ -107,7 +112,7 @@ class admin_core_logs_sqlerror extends ipsCommand $file = trim( $this->request['file'] ); /* Check file name */ - if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! file_exists( IPS_CACHE_PATH . 'cache/' . $file ) ) + if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! is_file( IPS_CACHE_PATH . 'cache/' . $file ) ) { $this->registry->output->global_message = $this->lang->words['sqllog_nofile']; $this->_listCurrent(); @@ -122,61 +127,100 @@ class admin_core_logs_sqlerror extends ipsCommand $classFileManagement = new $classToLoad(); /* Get some tail! */ - $content = $classFileManagement->tailFile( IPS_CACHE_PATH . 'cache/' . $file, 300 ); + $content = $classFileManagement->tailFile( IPS_CACHE_PATH . 'cache/' . $file, 300 ); + $tailSize = IPSLib::strlenToBytes( strlen( $content ) ); /* Can't believe I typed that last comment */ - $this->registry->output->html .= $this->html->sqlLogsView( $file, $size, $content ); + $this->registry->output->html .= $this->html->sqlLogsView( $file, $size, htmlentities( $content ), $tailSize ); } /** * Remove logs by an admin * - * @return void [Outputs to screen] + * @param bool $doAll Whether to delete all logs or not + * @return @e void [Outputs to screen] */ - protected function _remove() + protected function _remove( $doAll=false ) { - /* INIT */ - $file = trim( $this->request['file'] ); + //----------------------------------------- + // Deleting all? + //----------------------------------------- - /* Check file name */ - if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! file_exists( IPS_CACHE_PATH . 'cache/' . $file ) ) + if( $doAll ) { - $this->registry->output->global_message = $this->lang->words['sqllog_nofile']; - $this->_listCurrent(); - return; + $count = 0; + + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file ) + { + if ( $file->isDot() OR ! $file->isFile() ) + { + continue; + } + + if ( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename() ) ) + { + $count++; + + @unlink( IPS_CACHE_PATH . 'cache/' . $file->getFilename() ); + } + } + } catch ( Exception $e ) {} + } + else + { + $file = trim( $this->request['file'] ); + $count = 1; + + //----------------------------------------- + // Verify filename + //----------------------------------------- + + if ( ! preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file ) OR ! is_file( IPS_CACHE_PATH . 'cache/' . $file ) ) + { + $this->registry->output->global_message = $this->lang->words['sqllog_nofile']; + $this->_listCurrent(); + return; + } + + @unlink( IPS_CACHE_PATH . 'cache/' . $file ); } - @unlink( IPS_CACHE_PATH . 'cache/' . $file ); + //----------------------------------------- + // Show list again + //----------------------------------------- - $this->registry->output->global_message = $this->lang->words['sqllog_removed']; + $this->registry->output->global_message = sprintf( $this->lang->words['sqllog_removed'], $count ); $this->_listCurrent(); } /** * List the current SQL logs * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ protected function _listCurrent() { - $rows = array(); + $rows = array(); + $latestError = ''; /* Got a latest? */ - if ( file_exists( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ) - { + if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ) + { $unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ); if ( $unix ) { - $mtime = gmdate( 'd-j-Y', $unix ); - $now = gmdate( 'd-j-Y', time() ); + $mtime = gmdate( 'dmY', $unix ); + $now = gmdate( 'dmY', time() ); if ( $mtime == $now ) { - $contents = file_get_contents( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ); + $contents = htmlentities( file_get_contents( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ); /* Display a message */ - $this->registry->output->global_message = sprintf( $this->lang->words['sqllog_latest'], $this->registry->class_localization->getDate( $unix, 'LONG' ), $contents ); + $latestError = sprintf( $this->lang->words['sqllog_latest'], $this->registry->class_localization->getDate( $unix, 'LONG' ), $contents ); } } } @@ -203,6 +247,6 @@ class admin_core_logs_sqlerror extends ipsCommand // And output //----------------------------------------- - $this->registry->output->html .= $this->html->sqllogsWrapper( $rows ); + $this->registry->output->html .= $this->html->sqllogsWrapper( $rows, $latestError ); } -} +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/warnlogs.php b/upload/admin/applications/core/modules_admin/logs/warnlogs.php index 7fbc1888..a0d9a4e6 100644 --- a/upload/admin/applications/core/modules_admin/logs/warnlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/warnlogs.php @@ -3,19 +3,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Warn logs
- * Last Updated: $LastChangedDate: 2010-05-19 21:06:53 -0400 (Wed, 19 May 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-12 17:45:20 -0400 (Thu, 12 May 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6326 $ + * @version $Rev: 8752 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,17 +29,15 @@ class admin_core_logs_warnlogs extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -112,16 +110,15 @@ class admin_core_logs_warnlogs extends ipsCommand /** * View all logs for a given moderator * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _view() + protected function _view() { ///---------------------------------------- // Basic init //----------------------------------------- - $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; ///---------------------------------------- // No mid or search string? @@ -140,11 +137,9 @@ class admin_core_logs_warnlogs extends ipsCommand if ( !$this->request['search_string'] ) { - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(wlog_id) as count', 'from' => 'warn_logs', 'where' => "wlog_mid=".intval($this->request['mid']) ) ); + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(wlog_id) as count', 'from' => 'warn_logs', 'where' => "wlog_mid=".intval($this->request['mid']) ) ); - $row_count = $row['count']; - - $query = "&{$this->form_code}&mid=" . $this->request['mid'] . "&do=view"; + $query = "{$this->form_code}&mid=" . $this->request['mid'] . "&do=view"; $this->DB->build( array( 'select' => 'l.*', 'from' => array( 'warn_logs' => 'l' ), @@ -179,11 +174,9 @@ class admin_core_logs_warnlogs extends ipsCommand $dbq = "l.wlog_contact_content LIKE '%" . $this->request['search_string'] . "%'"; } - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(l.wlog_id) as count', 'from' => 'warn_logs l', 'where' => $dbq ) ); + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(l.wlog_id) as count', 'from' => 'warn_logs l', 'where' => $dbq ) ); - $row_count = $row['count']; - - $query = "&{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']); + $query = "{$this->form_code}&do=view&search_type=" . $this->request['search_type'] . "&search_string=" . urlencode($this->request['search_string']); $this->DB->build( array( 'select' => 'l.*', 'from' => array( 'warn_logs' => 'l' ), @@ -210,7 +203,7 @@ class admin_core_logs_warnlogs extends ipsCommand // Page links //----------------------------------------- - $links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count, + $links = $this->registry->output->generatePagination( array( 'totalItems' => $row['count'], 'itemsPerPage' => 20, 'currentStartValue' => $start, 'baseUrl' => $this->settings['base_url'] . $query, @@ -240,30 +233,41 @@ class admin_core_logs_warnlogs extends ipsCommand // Mod Q //----------------------------------------- - $mod = preg_match( "#(.+?)#is" , $row['wlog_notes'], $mm ); - $mod = trim($mm[1]); - list($v, $u, $i) = explode( ',', $mod); - - $row['_mod'] = ( $i == 1 ) ? 'INDEF' : ( $v == "" ? 'None' : $v . ' ' . $days[$u] ); - - ///---------------------------------------- - // Susp - //----------------------------------------- - - $susp = preg_match( "#(.+?)#is" , $row['wlog_notes'], $sm ); - $susp = trim($sm[1]); - list($v, $u) = explode( ',', $susp ); - $row['_susp'] = $v == '' ? 'None' : $v . ' ' . $days[$u]; + if ( strstr( $row['wlog_notes'], '' ) ) + { + $mod = preg_match( "#(.+?)#is" , $row['wlog_notes'], $mm ); + $mod = trim($mm[1]); + list($v, $u, $i) = explode( ',', $mod); + + $row['_mod'] = ( $i == 1 ) ? $this->lang->words['wlog_indef'] : ( $v == "" ? $this->lang->words['wlog_none'] : $v . ' ' . $days[$u] ); + + ///---------------------------------------- + // Susp + //----------------------------------------- + + $susp = preg_match( "#(.+?)#is" , $row['wlog_notes'], $sm ); + $susp = trim($sm[1]); + list($v, $u) = explode( ',', $susp ); + $row['_susp'] = $v == '' ? $this->lang->words['wlog_none'] : $v . ' ' . $days[$u]; + + ///---------------------------------------- + // Posting Susp + //----------------------------------------- + + $post = preg_match( "#(.+?)#is" , $row['wlog_notes'], $pm ); + $post = trim($pm[1]); + list($v, $u, $i) = explode( ',', $post ); + + $row['_post'] = ( $i == 1 ) ? $this->lang->words['wlog_indef'] : ( $v == "" ? $this->lang->words['wlog_none'] : $v . ' ' . $days[$u] ); + } + else + { + $_wlog = unserialize( $row['wlog_notes'] ); - ///---------------------------------------- - // Posting Susp - //----------------------------------------- - - $post = preg_match( "#(.+?)#is" , $row['wlog_notes'], $pm ); - $post = trim($pm[1]); - list($v, $u, $i) = explode( ',', $post ); - - $row['_post'] = ( $i == 1 ) ? 'INDEF' : ( $v == "" ? 'None' : $v . ' ' . $days[$u] ); + $row['_mod'] = $_wlog['mod_indef'] ? $this->lang->words['wlog_indef'] : ( $_wlog['mod'] == 0 ? $this->lang->words['wlog_none'] : $_wlog['mod'] . ' ' . $days[ $_wlog['mod_unit'] ? $_wlog['mod_unit'] : 'd' ] ); + $row['_susp'] = $_wlog['ban'] ? $this->lang->words['wlog_indef'] : ( $_wlog['susp'] == 0 ? $this->lang->words['wlog_none'] : $_wlog['susp'] . ' ' . $days[ $_wlog['susp_unit'] ? $_wlog['susp_unit'] : 'd' ] ); + $row['_post'] = $_wlog['post_indef'] ? $this->lang->words['wlog_indef'] : ( $_wlog['post'] == 0 ? $this->lang->words['wlog_none'] : $_wlog['post'] . ' ' . $days[ $_wlog['post_unit'] ? $_wlog['post_unit'] : 'd' ] ); + } //----------------------------------------- @@ -280,10 +284,9 @@ class admin_core_logs_warnlogs extends ipsCommand /** * Remove logs by a moderator * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _remove() + protected function _remove() { if ( $this->request['mid'] == "" ) { @@ -300,10 +303,9 @@ class admin_core_logs_warnlogs extends ipsCommand /** * List the current logs with links to view per-admin * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _listCurrent() + protected function _listCurrent() { $rows = array(); $members = array(); @@ -337,7 +339,7 @@ class admin_core_logs_warnlogs extends ipsCommand $row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' ); $row['_type'] = ( $row['wlog_type'] == 'pos' ) ? '-' : '+'; $row['_type'] = ( $row['wlog_type'] == 'custom' ) ? 'C' : $row['_type']; - $row['_cont'] = ( $row['wlog_contact'] != 'none' ) ? "form_code}&do=viewcontact&id={$row['wlog_id']}\",400,400,\"{$this->lang->words['wlog_log']}\"); return false;'>{$this->lang->words[" : ' '; + $row['_cont'] = ( $row['wlog_contact'] != 'none' ) ? "form_code}&do=viewcontact&id={$row['wlog_id']}\",400,400,\"{$this->lang->words['wlog_log']}\"); return false;'>{$this->lang->words[" : ' '; $rows[] = $row; } @@ -345,36 +347,26 @@ class admin_core_logs_warnlogs extends ipsCommand //----------------------------------------- // All members //----------------------------------------- - + $this->DB->build( array( - 'select' => 'wlog_mid, count(wlog_mid) as act_count', - 'from' => 'warn_logs', - 'group' => 'wlog_mid', - 'order' => 'act_count DESC' - ) ); - + 'select' => 'count(l.wlog_mid) as act_count', + 'from' => array( 'warn_logs' => 'l' ), + 'group' => 'l.wlog_mid', + 'order' => 'act_count DESC', + 'add_join' => array( + array( + 'select' => 'm.member_id, m.members_display_name', + 'from' => array( 'members' => 'm' ), + 'where' => 'm.member_id=l.wlog_mid', + 'type' => 'left', + ), + ), + ) ); $this->DB->execute(); - - $_members = array(); - $_store = array(); - while ( $r = $this->DB->fetch() ) - { - $_members[] = $r['wlog_mid']; - $members[ $r['wlog_mid'] ] = $r; - } - - if ( !empty( $_members ) ) + + while ( $r = $this->DB->fetch() ) { - $this->DB->build( array( 'select' => 'member_id, members_display_name', - 'from' => 'members', - 'where' => 'member_id IN (' . implode( ',', $_members ) . ')', - ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $members[ $r['member_id'] ] = array_merge( $r, $members[ $r['member_id'] ] ); - } + $members[ $r['member_id'] ] = $r; } //----------------------------------------- @@ -383,17 +375,15 @@ class admin_core_logs_warnlogs extends ipsCommand $this->registry->output->html .= $this->html->warnlogsWrapper( $rows, $members ); } - - + /** * Popup window to view a note * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _viewNote() + protected function _viewNote() { - if ( $this->request['id'] == "" ) + if ( !$this->request['id'] ) { $this->registry->output->showError( $this->lang->words['wlog_nologs'], 11134 ); } @@ -422,10 +412,24 @@ class admin_core_logs_warnlogs extends ipsCommand $this->registry->output->showError( $this->lang->words['wlog_cantresolve'], 11135 ); } - $content = preg_match( "#(.+?)#is", $row['wlog_notes'], $cont ); + $cont = array(); + + if ( strstr( $row['wlog_notes'], '' ) ) + { + preg_match( "#(.+?)#is", $row['wlog_notes'], $cont ); + } + else + { + $_array = unserialize( $row['wlog_notes'] ); + + if ( is_array( $_array ) AND $_array['content'] ) + { + $cont[1] = $_array['content']; + } + } $row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' ); - $row['a_name'] = $row['a_name'] ? $row['a_name'] : 'Deleted Member (ID:' . $row['wlog_mid'] . ')'; + $row['a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['deleted_member_warnlog'], $row['wlog_mid'] ); IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parse_smilies = 1; @@ -445,12 +449,11 @@ class admin_core_logs_warnlogs extends ipsCommand /** * Popup window to view a contact * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _viewContact() + protected function _viewContact() { - if ( $this->request['id'] == "" ) + if ( !$this->request['id'] ) { $this->registry->output->showError( $this->lang->words['wlog_nologs'], 11136 ); } @@ -479,18 +482,26 @@ class admin_core_logs_warnlogs extends ipsCommand $this->registry->output->showError( $this->lang->words['wlog_nologs'], 11137 ); } - $subject = preg_match( "#(.+?)#is", $row['wlog_contact_content'], $subj ); - $content = preg_match( "#(.+?)#is", $row['wlog_contact_content'], $cont ); + if( strpos( $row['wlog_contact_content'], '' ) ) + { + $subject = preg_match( "#(.+?)#is", $row['wlog_contact_content'], $subj ); + $content = preg_match( "#(.+?)#is", $row['wlog_contact_content'], $cont ); + + $row['_subject'] = $subj[1]; + $row['_text'] = $cont[1]; + } + else + { + $row['_subject'] = $this->lang->words['subj_not_avail']; + $row['_text'] = $row['wlog_contact_content']; + } $row['_type'] = $row['wlog_contact'] == 'pm' ? $this->lang->words['wlog_pm'] : $this->lang->words['wlog_email']; - $row['_subject'] = $subj[1]; $row['_date'] = $this->registry->class_localization->getDate( $row['wlog_date'], 'LONG' ); $row['a_name'] = $row['a_name'] ? $row['a_name'] : sprintf( $this->lang->words['wlog_deleted'], $row['wlog_mid'] ); - $row['_text'] = $cont[1]; - IPSText::getTextClass( 'bbcode' )->parse_smilies = 1; - IPSText::getTextClass( 'bbcode' )->parse_html = 0; + IPSText::getTextClass( 'bbcode' )->parse_html = 1; IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn'; IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id']; @@ -503,5 +514,4 @@ class admin_core_logs_warnlogs extends ipsCommand $this->registry->output->printPopupWindow(); } - } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/xml/index.html b/upload/admin/applications/core/modules_admin/logs/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/logs/xml/index.html +++ b/upload/admin/applications/core/modules_admin/logs/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications_addon/ips/portal/modules_admin/portal/xml/menu.xml b/upload/admin/applications/core/modules_admin/logs/xml/menu.xml similarity index 64% rename from upload/admin/applications_addon/ips/portal/modules_admin/portal/xml/menu.xml rename to upload/admin/applications/core/modules_admin/logs/xml/menu.xml index 3613fdf2..58fb1b0a 100644 --- a/upload/admin/applications_addon/ips/portal/modules_admin/portal/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/logs/xml/menu.xml @@ -2,11 +2,12 @@ - Портал + Logs - Управление порталом - portal + Logs + splashlogs + logsSplash 0 diff --git a/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml b/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml index ac1ccbf8..f28dd0eb 100644 --- a/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml @@ -2,6 +2,7 @@ Журнал администраторских действий + core_adminlogs adminlogs_view @@ -15,6 +16,7 @@ Журнал модераторских действий + core_modlogs modlogs_view @@ -26,21 +28,9 @@ - - Журнал Email отправлений - - - emaillogs_view - Может просматривать журнал? - - - emaillogs_delete - Может удлаять записи? - - - Журнал ошибок Email + core_eelogs emailerrorlogs_view @@ -54,6 +44,7 @@ Журнал действий поисковых роботов + core_spiderlogs spiderlogs_view @@ -67,6 +58,7 @@ Журнал пользовательских предупреждений + core_warnlogs warnlogs_view @@ -80,6 +72,7 @@ Журнал ошибок системы + core_errorlogs errorlogs_view @@ -93,6 +86,7 @@ SQL Error Logs + core_selogs sqlerrorlogs_view diff --git a/upload/admin/applications/core/modules_admin/mycp/dashboard.php b/upload/admin/applications/core/modules_admin/mycp/dashboard.php index d9541fc1..6b12de6e 100644 --- a/upload/admin/applications/core/modules_admin/mycp/dashboard.php +++ b/upload/admin/applications/core/modules_admin/mycp/dashboard.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Dashboard
- * Last Updated: $Date: 2010-10-27 05:50:09 -0400 (Wed, 27 Oct 2010) $
+ * Last Updated: $Date: 2011-10-14 13:58:18 -0400 (Fri, 14 Oct 2011) $
  * 
* - * @author $Author: mmecham $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 5th January 2005 - * @version $Revision: 7049 $ + * @version $Revision: 9623 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -47,10 +47,10 @@ class admin_core_mycp_dashboard extends ipsCommand protected $form_code_js; /** - * Main class entry point + * Main function executed automatically by the controller * - * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @param object $registry Registry object + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -71,7 +71,40 @@ class admin_core_mycp_dashboard extends ipsCommand if the permission system automatically added permission for 'change my details' */ if( $this->registry->getClass('class_permissions')->editDetailsOnly ) { - ipsRegistry::getClass('output')->showError( 'no_permission', 1004 ); + /* If they just don't have access to the dashboard, let's show them something we do have access to */ + if ( !$this->request['app'] ) + { + foreach( ipsRegistry::$applications as $k => $data ) + { + if ( $this->registry->getClass('class_permissions')->checkForAppAccess( $k ) and ( $k != 'core' or !$this->registry->getClass('class_permissions')->editDetailsOnly ) ) + { + foreach( ipsRegistry::$modules[ $k ] as $module ) + { + if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( $k, $module['sys_module_key'] ) ) + { + $filepath = IPSLib::getAppDir( $k ) . '/modules_admin/' . $module['sys_module_key'] . '/defaultSection.php'; + if ( is_file( $filepath ) ) + { + $DEFAULT_SECTION = ''; + include( $filepath );/*noLibHook*/ + + if ( $this->registry->getClass('class_permissions')->checkForSectionAccess( $k, $module['sys_module_key'], $DEFAULT_SECTION ) ) + { + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . "app={$k}&module={$module['sys_module_key']}&section={$DEFAULT_SECTION}" ); + } + } + } + } + } + } + } + + /* If all else fails, take them to the change details page */ + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . "core&module=mycp&section=details" ); + } + else if( !$this->registry->getClass('class_permissions')->checkPermission( 'dashboard', 'core', 'mycp' ) ) + { + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . "core&module=mycp&section=details" ); } //----------------------------------------- @@ -85,11 +118,17 @@ class admin_core_mycp_dashboard extends ipsCommand // INIT //----------------------------------------- + define( 'IPS_VERSION_CHECK_URL' , 'http://myipb.in/latestversioncheck/ipb30x.php' ); + $content = array(); $thiscontent = ""; $latest_version = array(); $reg_end = ""; $unfinished_upgrade = 0; + $urls = array( 'news' => '', + 'keiths_bits' => '', + 'version_check' => IPS_VERSION_CHECK_URL, + 'blogs' => '' ); //----------------------------------------- // Get MySQL & PHP Version @@ -132,12 +171,14 @@ class admin_core_mycp_dashboard extends ipsCommand //----------------------------------------- ipsRegistry::$version = 'v'.$latest_version['upgrade_version_human']; - ipsRegistry::$vn_full = ( isset($latest_version['upgrade_notes']) AND $latest_version['upgrade_notes'] ) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full; + ipsRegistry::$vn_full = !empty($latest_version['upgrade_notes']) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full; //----------------------------------------- // Licensed? //----------------------------------------- + $urls['keiths_bits'] = IPS_BULLETINS_URL . '?v=' . ipsRegistry::$vn_full; + //----------------------------------------- // Notepad //----------------------------------------- @@ -217,12 +258,14 @@ class admin_core_mycp_dashboard extends ipsCommand $r['_click'] = sprintf("%0d", ($r['_click'] / 60) ) . $this->lang->words['cp_minutesago']; } - $r['session_location'] = $r['session_location'] ? "settings['base_url'] ) . $r['session_url'] . "'>{$r['session_location']}" : $this->lang->words['cp_index']; - - $acponline .= $this->html->acp_onlineadmin_row( IPSMember::buildDisplayData( $r ) ); + $r['session_location'] = $r['session_location'] ? $r['session_location'] : $this->lang->words['cp_index']; + + $r['seo_link'] = $this->registry->output->buildSEOUrl( $this->settings['board_url'] . '/index.php?showuser=' . $r['session_member_id'], 'none', $r['members_seo_name'], 'showuser' ); + + $admins_online[] = $r; } - $content['acp_online'] = $this->html->acp_onlineadmin_wrapper( $acponline ); + $content['acp_online'] = $this->html->acp_onlineadmin_wrapper( $admins_online ); //----------------------------------------- // Members awaiting admin validation? @@ -298,12 +341,38 @@ class admin_core_mycp_dashboard extends ipsCommand ksort( $groups ); $groups_html = implode( "\n", $groups ); + + //----------------------------------------- + // Info for the stats bar + //----------------------------------------- + + $stats = array( + 'performance' => false, + 'active_users' => 0, + 'server_load' => 0, + ); + + $record = $this->cache->getCache('performanceCache'); + + if( is_array($record) AND count($record) ) + { + $stats['performance'] = true; + } + + list( $load, $time ) = explode( '-', $this->caches['systemvars']['loadlimit'] ); + + $time = time() - ( $this->settings['au_cutoff'] * 60 ); + $online = $this->DB->buildAndFetch( array( 'select' => 'count(*) as rows', 'from' => 'sessions', 'where' => "running_time > {$time}" ) ); + + $stats['active_users'] = $online['rows']; + $stats['server_load'] = $load; //----------------------------------------- // Piece it together //----------------------------------------- - $this->registry->output->html .= $this->html->mainTemplate( $content, $forums, $groups_html, $urls, $this->getNotificationPanelEntries() ); + $urls['version_check'] = IPS_VERSION_CHECK_URL . '?' . base64_encode( ipsRegistry::$vn_full.'|^|'.$this->settings['board_url'] ); + $this->registry->output->html .= $this->html->mainTemplate( $content, $forums, $groups_html, $urls, $this->getNotificationPanelEntries(), $stats ); //----------------------------------------- // Left log all on? @@ -399,7 +468,7 @@ class admin_core_mycp_dashboard extends ipsCommand if ( count( $content ) ) { - $_html = $this->html->warning_box( $this->lang->words['cp_settingsneedup'], implode( $content, "
" ) . "
{$this->lang->words['cp_clickhere']} {$this->lang->words['cp_clickhere_info']}."); + $_html = $this->html->warning_box( $this->lang->words['cp_settingsneedup'], implode( $content, "
" ) . "
{$this->lang->words['cp_clickhere']} {$this->lang->words['cp_clickhere_info']}."); } if ( count( $modContent ) ) @@ -423,14 +492,21 @@ class admin_core_mycp_dashboard extends ipsCommand } $this->registry->output->html = str_replace( '', $_html, $this->registry->output->html ); - - if ( @file_exists( DOC_IPS_ROOT_PATH . '_dev_notes.txt' ) ) + + /* Got notes!? */ + if ( is_file( DOC_IPS_ROOT_PATH . '_dev_notes.txt' ) ) { - $_notes = @file_get_contents( DOC_IPS_ROOT_PATH . '_dev_notes.txt' ); - + /* file retains tabs, file_get_contents not! */ + $_notes = file( DOC_IPS_ROOT_PATH . '_dev_notes.txt' ); + if ( $_notes ) { - $_html = $this->registry->output->global_template->information_box( $this->lang->words['cp_devnotes'], nl2br($_notes) ) . "
"; + /* sanitize data and convert tabs! */ + //$_notes = array_map( 'htmlentities', $_notes ); + $_notes = implode( '', $_notes ); + $_notes = str_replace( "\t", '    ', $_notes ); + + $_html = $this->registry->output->global_template->warning_box( $this->lang->words['cp_devnotes'], nl2br($_notes) ) . "
"; $this->registry->output->html = str_replace( '', $_html, $this->registry->output->html ); } } @@ -447,9 +523,9 @@ class admin_core_mycp_dashboard extends ipsCommand $this->DB->build( array( 'select' => '*', 'from' => 'admin_login_logs', - 'where' => 'admin_time > 0', // This just helps mysql use the index properly, which is useful for sorting + 'where' => 'admin_success = 0 AND admin_time > 0', // This just helps mysql use the index properly, which is useful for sorting 'order' => 'admin_time DESC', - 'limit' => array( 0, 5 ) + 'limit' => array( 0, 4 ) ) ); $this->DB->execute(); @@ -457,11 +533,10 @@ class admin_core_mycp_dashboard extends ipsCommand while ( $rowb = $this->DB->fetch() ) { $rowb['_admin_time'] = $this->registry->class_localization->getDate( $rowb['admin_time'], 'long' ); - $rowb['_admin_img'] = $rowb['admin_success'] ? 'aff_tick.png' : 'aff_cross.png'; $logins .= $this->html->acp_last_logins_row( $rowb ); } - + $this->registry->output->html = str_replace( '', $this->html->acp_last_logins_wrapper( $logins ), $this->registry->output->html ); } @@ -484,18 +559,13 @@ class admin_core_mycp_dashboard extends ipsCommand $entries = array(); /* Look for notification classes */ - foreach( ipsRegistry::$applications as $r ) + foreach( IPSLib::getEnabledApplications() as $r ) { - if ( ! IPSLib::appIsInstalled( $r['app_directory'] ) ) - { - continue; - } - /* Notification Class */ $_file = IPSLib::getAppDir( $r['app_directory'] ) . '/extensions/dashboardNotifications.php'; /* Look for the file */ - if( file_exists( $_file ) ) + if( is_file( $_file ) ) { /* Get the file */ $_class = IPSLib::loadLibrary( $_file, 'dashboardNotifications__' . $r['app_directory'], $r['app_directory'] ); diff --git a/upload/admin/applications/core/modules_admin/mycp/defaultSection.php b/upload/admin/applications/core/modules_admin/mycp/defaultSection.php index 6c51b2f6..6cc44eec 100644 --- a/upload/admin/applications/core/modules_admin/mycp/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/mycp/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default mycp section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'mycp' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'dashboard'; diff --git a/upload/admin/applications/core/modules_admin/mycp/details.php b/upload/admin/applications/core/modules_admin/mycp/details.php index a1561e9c..cebd5277 100644 --- a/upload/admin/applications/core/modules_admin/mycp/details.php +++ b/upload/admin/applications/core/modules_admin/mycp/details.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Admin change email/password
- * Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
+ * Last Updated: $Date: 2011-05-31 16:58:52 -0400 (Tue, 31 May 2011) $
  * 
* - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 5th January 2005 - * @version $Revision: 6990 $ + * @version $Revision: 8932 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,13 +30,13 @@ class admin_core_mycp_details extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -86,7 +86,7 @@ class admin_core_mycp_details extends ipsCommand /** * Show the form so admin can reset email/pass * - * @return void + * @return @e void */ protected function _showForm() { @@ -96,13 +96,13 @@ class admin_core_mycp_details extends ipsCommand /** * Save new email and/or pass * - * @return void + * @return @e void */ protected function _saveForm() { if( !$this->request['email'] AND !$this->request['password'] ) { - $this->registry->output->global_message = $this->lang->words['change_nothing_update']; + $this->registry->output->global_error = $this->lang->words['change_nothing_update']; $this->_showForm(); return; } @@ -111,29 +111,37 @@ class admin_core_mycp_details extends ipsCommand { if( !$this->request['email_confirm'] ) { - $this->registry->output->global_message = $this->lang->words['change_both_fields']; + $this->registry->output->global_error = $this->lang->words['change_both_fields']; $this->_showForm(); return; } else if( $this->request['email'] != $this->request['email_confirm'] ) { - $this->registry->output->global_message = $this->lang->words['change_not_match']; + $this->registry->output->global_error = $this->lang->words['change_not_match']; $this->_showForm(); return; } $email = trim($this->request['email']); + + if( ! IPSText::checkEmailAddress( $email ) ) + { + $this->registry->output->global_error = $this->lang->words['bad_email_supplied']; + $this->_showForm(); + return; + } + $email_check = IPSMember::load( mb_strtolower($email) ); if ( $email_check['member_id'] ) { if ( $email_check['member_id'] == $this->memberData['member_id'] ) { - $this->registry->output->global_message = $this->lang->words['already_using_email']; + $this->registry->output->global_error = $this->lang->words['already_using_email']; } else { - $this->registry->output->global_message = $this->lang->words['change_email_already_used']; + $this->registry->output->global_error = $this->lang->words['change_email_already_used']; } $this->_showForm(); @@ -160,13 +168,13 @@ class admin_core_mycp_details extends ipsCommand { if( !$this->request['password_confirm'] ) { - $this->registry->output->global_message = $this->lang->words['change_both_fields']; + $this->registry->output->global_error = $this->lang->words['change_both_fields']; $this->_showForm(); return; } else if( $this->request['password'] != $this->request['password_confirm'] ) { - $this->registry->output->global_message = $this->lang->words['change_not_match_pw']; + $this->registry->output->global_error = $this->lang->words['change_not_match_pw']; $this->_showForm(); return; } diff --git a/upload/admin/applications/core/modules_admin/mycp/index.html b/upload/admin/applications/core/modules_admin/mycp/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/mycp/index.html +++ b/upload/admin/applications/core/modules_admin/mycp/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/mycp/xml/index.html b/upload/admin/applications/core/modules_admin/mycp/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/mycp/xml/index.html +++ b/upload/admin/applications/core/modules_admin/mycp/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml b/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml index e9bc81b0..33d19a2d 100644 --- a/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml @@ -6,8 +6,10 @@ Панель управления + dashboard dashboard + dashboard 0 @@ -17,6 +19,7 @@ Изменение своих данных + mydetails details diff --git a/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml b/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml new file mode 100644 index 00000000..8fef67e3 --- /dev/null +++ b/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml @@ -0,0 +1,13 @@ + + + + My Control Panel + core_mycp + + + dashboard + Can access the dashboard? + + + + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/badwords.php b/upload/admin/applications/core/modules_admin/posts/badwords.php index 026c81d0..9666c976 100644 --- a/upload/admin/applications/core/modules_admin/posts/badwords.php +++ b/upload/admin/applications/core/modules_admin/posts/badwords.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Bad Word Filters
- * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
+ * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
  * 
* - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 5713 $ + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,7 +28,6 @@ class admin_core_posts_badwords extends ipsCommand /** * HTML skin object * - * @access public * @var object */ public $html; @@ -36,9 +35,8 @@ class admin_core_posts_badwords extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -98,8 +96,7 @@ class admin_core_posts_badwords extends ipsCommand /** * Remove a badword filter * - * @access public - * @return void + * @return @e void */ public function badwordRemove() { @@ -117,14 +114,13 @@ class admin_core_posts_badwords extends ipsCommand /* Rebuild cache and bounce */ $this->badwordsRebuildCache(); $this->registry->output->global_message = $this->lang->words['bwl_filter_removed']; - $this->badwordsOvervew(); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code ); } /** * Handles the badword edit form * - * @access public - * @return void + * @return @e void */ public function handleBadwordEdit() { @@ -146,28 +142,24 @@ class admin_core_posts_badwords extends ipsCommand $this->request['match'] = $this->request['match'] ? 1 : 0; /* Swap Text */ - $this->request['after'] = isset( $this->request['after'] ) && $this->request['after'] ? $this->request['after'] : ""; - - $this->DB->force_data_type['type'] = 'string'; - $this->DB->force_data_type['swop'] = 'string'; + $this->DB->setDataType( array( 'type', 'swop' ), 'string' ); $this->DB->update( 'badwords', array( 'type' => trim( $this->request['before'] ), 'swop' => trim( $this->request['after'] ), 'm_exact' => $this->request['match'] - ), "wid={$id}" ); + ), "wid=" . $id ); /* Recache and bounce */ $this->badwordsRebuildCache(); $this->registry->output->global_message = $this->lang->words['bwl_filter_edited']; - $this->badwordsOvervew(); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code ); } /** * Edit Badword Form * - * @access public - * @return void + * @return @e void * @author Josh */ public function badwordEditForm() @@ -201,9 +193,8 @@ class admin_core_posts_badwords extends ipsCommand /** * Handle add bad word request * - * @access public - * @return void - **/ + * @return @e void + */ public function badwordAdd() { /* Check for before text */ @@ -214,13 +205,9 @@ class admin_core_posts_badwords extends ipsCommand /* Match */ $this->request['match'] = $this->request['match'] ? 1 : 0; - - /* Swap Text */ - $this->request['after'] = isset( $this->request['after'] ) && $this->request['after'] ? $this->request['after'] : ""; - + /* Insert filter */ - $this->DB->force_data_type['type'] = 'string'; - $this->DB->force_data_type['swop'] = 'string'; + $this->DB->setDataType( array( 'type', 'swop' ), 'string' ); $this->DB->insert( 'badwords', array( 'type' => trim( $this->request['before'] ), @@ -234,14 +221,13 @@ class admin_core_posts_badwords extends ipsCommand /* Bounce */ $this->registry->output->global_message = $this->lang->words['bwl_filter_new']; - $this->badwordsOvervew(); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code ); } /** * Badword Overview Screen * - * @access public - * @return void + * @return @e void */ public function badwordsOvervew() { @@ -267,7 +253,6 @@ class admin_core_posts_badwords extends ipsCommand $rows[] = $r; } - } /* Output */ @@ -278,8 +263,7 @@ class admin_core_posts_badwords extends ipsCommand /** * Import badwords from an xml file * - * @access public - * @return void + * @return @e void */ public function badwordsImport() { @@ -298,7 +282,7 @@ class admin_core_posts_badwords extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->loadXML( $content ); @@ -353,8 +337,7 @@ class admin_core_posts_badwords extends ipsCommand /** * Exports badwords to an xml file * - * @access public - * @return void + * @return @e void */ public function badwordsExport() { @@ -362,7 +345,7 @@ class admin_core_posts_badwords extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -388,8 +371,7 @@ class admin_core_posts_badwords extends ipsCommand /** * Rebuild badword cache * - * @access public - * @return void + * @return @e void */ public function badwordsRebuildCache() { @@ -411,12 +393,11 @@ class admin_core_posts_badwords extends ipsCommand /** * Custom sort operation * - * @access private * @param string A * @param string B * @return integer */ - private function _thisUsort($a, $b) + protected function _thisUsort($a, $b) { if ( IPSText::mbstrlen($a['type']) == IPSText::mbstrlen($b['type']) ) { diff --git a/upload/admin/applications/core/modules_admin/posts/bbcode.php b/upload/admin/applications/core/modules_admin/posts/bbcode.php index e840f51c..7d02ec07 100644 --- a/upload/admin/applications/core/modules_admin/posts/bbcode.php +++ b/upload/admin/applications/core/modules_admin/posts/bbcode.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * BBCode Management
- * Last Updated: $LastChangedDate: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
+ * Last Updated: $LastChangedDate: 2011-08-23 18:01:24 -0400 (Tue, 23 Aug 2011) $
  * 
* * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6925 $ + * @version $Rev: 9407 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,17 +28,15 @@ class admin_core_posts_bbcode extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -132,15 +130,14 @@ class admin_core_posts_bbcode extends ipsCommand /** * Export all bbcode XML file * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeExportAll() + protected function _bbcodeExportAll() { /* Loop through apps */ $msg = array(); - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -185,7 +182,7 @@ class admin_core_posts_bbcode extends ipsCommand } } - $this->registry->output->global_message = "Completed" . implode( "
", $msg ); + $this->registry->output->setMessage( "Completed" . implode( "
", $msg ), 1 ); $this->_bbcodeStart(); } @@ -193,10 +190,9 @@ class admin_core_posts_bbcode extends ipsCommand /** * Import a bbcode XML file * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeImportAll() + protected function _bbcodeImportAll() { /* Loop through apps */ $msg = array(); @@ -205,7 +201,7 @@ class admin_core_posts_bbcode extends ipsCommand { $file = IPSLib::getAppDir( $appDir ) . '/xml/' . $appDir . '_bbcode.xml'; - if ( file_exists( $file ) ) + if ( is_file( $file ) ) { $content = @file_get_contents( $file ); @@ -226,7 +222,7 @@ class admin_core_posts_bbcode extends ipsCommand } } - $this->registry->output->global_message = implode( "
", $msg ); + $this->registry->output->setMessage( implode( "
", $msg ), 1 ); $this->_bbcodeStart(); } @@ -234,10 +230,9 @@ class admin_core_posts_bbcode extends ipsCommand /** * Import a bbcode XML file * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeImport() + protected function _bbcodeImport() { $content = $this->registry->getClass('adminFunctions')->importXml(); @@ -247,7 +242,7 @@ class admin_core_posts_bbcode extends ipsCommand if ( ! $content ) { - $this->registry->output->global_message = $this->lang->words['upload_failed']; + $this->registry->output->global_error = $this->lang->words['upload_failed']; $this->_bbcodeStart(); return; } @@ -264,7 +259,6 @@ class admin_core_posts_bbcode extends ipsCommand * Perform the BBcode import * Abstracted here so the installer can use it (and potentially other apps) * - * @access public * @param string Raw XML code * @return array [ 'inserted' => int, 'updated' => int ] */ @@ -274,7 +268,7 @@ class admin_core_posts_bbcode extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->loadXML( $content ); @@ -388,16 +382,15 @@ class admin_core_posts_bbcode extends ipsCommand /** * Export a bbcode XML file * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeExport() + protected function _bbcodeExport() { //----------------------------------------- // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -436,10 +429,9 @@ class admin_core_posts_bbcode extends ipsCommand /** * Delete a bbcode * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeDelete() + protected function _bbcodeDelete() { if ( ! $this->request['id'] ) { @@ -458,11 +450,10 @@ class admin_core_posts_bbcode extends ipsCommand /** * Test a bbcode * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] * @todo [Future] Also show the resulting HTML alongside the formatted content */ - private function _bbcodeTest() + protected function _bbcodeTest() { $t = IPSText::stripslashes(htmlspecialchars($_POST['bbtest'])); @@ -472,7 +463,6 @@ class admin_core_posts_bbcode extends ipsCommand IPSText::getTextClass('bbcode')->parse_bbcode = 1; IPSText::getTextClass('bbcode')->parse_smilies = 0; - IPSText::getTextClass('bbcode')->parse_wordwrap = 0; IPSText::getTextClass('bbcode')->parsing_section = 'global'; //----------------------------------------- @@ -495,7 +485,7 @@ class admin_core_posts_bbcode extends ipsCommand $this->settings['base_url'] = $_current; - $this->registry->output->global_message = $this->lang->words['bbcode_test'] . $t; + $this->registry->output->setMessage( $this->lang->words['bbcode_test'] . $t, true ); $this->_bbcodeStart(); } @@ -503,11 +493,10 @@ class admin_core_posts_bbcode extends ipsCommand /** * Save a bbcode [add|edit] * - * @access private * @param string [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeSave($type='add') + protected function _bbcodeSave($type='add') { if ( $type == 'edit' ) { @@ -665,7 +654,6 @@ class admin_core_posts_bbcode extends ipsCommand 'bbcode_optional_option' => intval( $this->request['bbcode_optional_option'] ), 'bbcode_aliases' => $this->request['bbcode_aliases'], 'bbcode_image' => $this->request['bbcode_image'], - 'bbcode_strip_search' => intval( $this->request['bbcode_strip_search'] ), 'bbcode_app' => $this->request['bbcode_app'], 'bbcode_protected' => intval( $this->request['bbcode_protected'] ), 'bbcode_custom_regex' => str_replace( "\", '\\', IPSText::stripslashes( $_POST['bbcode_custom_regex'] ) ), @@ -714,11 +702,10 @@ class admin_core_posts_bbcode extends ipsCommand /** * Add/Edit bbcode form * - * @access private * @param string [add|edit] - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeForm($type='add') + protected function _bbcodeForm($type='add') { $this->registry->output->nav[] = array( '', $this->lang->words['add_edit'] ); @@ -752,21 +739,21 @@ class admin_core_posts_bbcode extends ipsCommand // Grab the 'sections' //----------------------------------------- - $sections = array(); + $sections = array(); foreach( ipsRegistry::$applications as $_app_dir => $app_data ) { $_file = IPSLib::getAppDir( $_app_dir ) . '/extensions/editorSections.php'; - if( file_exists($_file) ) + if( is_file($_file) ) { - $BBCODE = array(); + $BBCODE = array(); - include( $_file ); + include( $_file );/*maybeLibHook*/ if( is_array($BBCODE) AND count($BBCODE) ) { - $sections = array_merge( $sections, $BBCODE ); + $sections = array_merge( $sections, $BBCODE ); } } } @@ -777,10 +764,9 @@ class admin_core_posts_bbcode extends ipsCommand /** * Bbcode splash page * - * @access private - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _bbcodeStart() + protected function _bbcodeStart() { //----------------------------------------- // Show the codes mahn! @@ -820,8 +806,7 @@ class admin_core_posts_bbcode extends ipsCommand /** * Rebuild bbcode cache * - * @access public - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function bbcodeRebuildCache() { @@ -832,10 +817,9 @@ class admin_core_posts_bbcode extends ipsCommand while ( $r = $this->DB->fetch() ) { - $cache[] = $r; + $cache[ $r['bbcode_tag'] ] = $r; } $this->cache->setCache( 'bbcode', $cache, array( 'array' => 1 ) ); } - } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/defaultSection.php b/upload/admin/applications/core/modules_admin/posts/defaultSection.php index 9e05fed6..e2501327 100644 --- a/upload/admin/applications/core/modules_admin/posts/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/posts/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default posts section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'posts' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'emoticons'; diff --git a/upload/admin/applications/core/modules_admin/posts/emoticons.php b/upload/admin/applications/core/modules_admin/posts/emoticons.php index b8217e27..9d785651 100644 --- a/upload/admin/applications/core/modules_admin/posts/emoticons.php +++ b/upload/admin/applications/core/modules_admin/posts/emoticons.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * Emoticon Management
- * Last Updated: $LastChangedDate: 2010-09-13 17:28:12 -0400 (Mon, 13 Sep 2010) $
+ * Last Updated: $LastChangedDate: 2011-09-20 21:18:18 -0400 (Tue, 20 Sep 2011) $
  * 
* - * @author $Author: terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6863 $ + * @version $Rev: 9520 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,17 +28,17 @@ class admin_core_posts_emoticons extends ipsCommand /** * Allowed file types * - * @access public * @var array */ public $allowed_files = array( 'png', 'jpeg', 'jpg', 'gif' ); + protected $setCache = array(); + /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -116,6 +116,9 @@ class admin_core_posts_emoticons extends ipsCommand $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); $this->emoticonsOverview(); break; + case 'reorder': + $this->_reorder(); + break; } /* Output */ @@ -123,14 +126,84 @@ class admin_core_posts_emoticons extends ipsCommand $this->registry->output->sendOutput(); } + /** + * Reorder hooks + * + * @return @e void [Outputs to screen] + */ + protected function _reorder() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); + $ajax = new $classToLoad(); + $set = trim( $this->request['id'] ); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if ( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) + { + $ajax->returnString( $this->lang->words['postform_badmd5'] ); + exit(); + } + + //----------------------------------------- + // Save new position + //----------------------------------------- + + $position = 1; + + if ( is_array( $this->request['emoticons'] ) AND count( $this->request['emoticons'] ) ) + { + /* Reset all emoticons to 0 temporarily */ + $this->DB->update( 'emoticons', array( 'emo_position' => 0 ), 'emo_set=\'' . $this->DB->addSlashes( $set ) . "'" ); + + foreach( $this->request['emoticons'] as $this_id ) + { + $this->DB->update( 'emoticons', array( 'emo_position' => $position ), 'id=' . $this_id ); + + $position++; + } + } + + $this->emoticonsRebuildCache(); + + $ajax->returnString( 'OK' ); + exit(); + } + /** * Import an emoticon pack * - * @access public - * @return void + * @return @e void */ public function emoticonsPackImport() { + /* Make sure all emoticon directories are writable */ + $this->DB->build( array( 'select' => $this->DB->buildDistinct('emo_set') . ' as folder', 'from' => 'emoticons' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_folders[] = $r['folder']; + } + + if( count($_folders) ) + { + foreach( $_folders as $folder ) + { + if( !IPSLib::isWritable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ) ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['emodir_not_write'], PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ); + return $this->emoticonsPackSplash(); + } + } + } + /* Get the xml file */ $content = $this->registry->adminFunctions->importXml( 'ipb_emoticons.xml' ); @@ -142,10 +215,10 @@ class admin_core_posts_emoticons extends ipsCommand } /* Setup XML */ - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); - require_once( IPS_KERNEL_PATH.'classXMLArchive.php' ); + require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ $xmlarchive = new classXMLArchive(); /* Read the archive */ @@ -180,7 +253,7 @@ class admin_core_posts_emoticons extends ipsCommand $emo_set_dir = trim( $this->request['emo_set'] ); /* New emoticon set directory */ - $this->request['new_emo_set'] = preg_replace( "/[^a-zA-Z0-9\-_]/", "", $this->request['new_emo_set'] ); + $this->request['new_emo_set'] = preg_replace( '/[^a-zA-Z0-9\-_]/', "", $this->request['new_emo_set'] ); /* Create the new set */ if ( $this->request['new_emo_set'] ) @@ -188,17 +261,17 @@ class admin_core_posts_emoticons extends ipsCommand $emo_set_dir = trim( $this->request['new_emo_set'] ); /* Check to see if the directory already exists */ - if ( file_exists( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $emo_set_dir ) ) + if ( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir ) ) { $this->registry->output->global_message = sprintf( $this->lang->words['emo_already'], $emo_set_dir ); return $this->emoticonsPackSplash(); } /* Create the directory */ - if ( @mkdir( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $emo_set_dir, 0777 ) ) + if ( @mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir, IPS_FOLDER_PERMISSION ) ) { - @chmod( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $emo_set_dir, 0777 ); - @file_put_contents( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $emo_set_dir . '/index.html', '' ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir, IPS_FOLDER_PERMISSION ); + @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir . '/index.html', '' ); } else { @@ -213,7 +286,7 @@ class admin_core_posts_emoticons extends ipsCommand if ( $this->request['overwrite'] != 1 ) { - $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='".$emo_set_dir."'" ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='" . $emo_set_dir . "'" ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) @@ -240,7 +313,7 @@ class admin_core_posts_emoticons extends ipsCommand } /* Get the extension */ - $file_extension = preg_replace( "#^.*\.(.+?)$#si", "\\1", mb_strtolower( $image ) ); + $file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", mb_strtolower( $image ) ); /* Make sure it's allowed */ if ( ! in_array( $file_extension, $this->allowed_files ) ) @@ -249,12 +322,12 @@ class admin_core_posts_emoticons extends ipsCommand } /* Remove any existing emoticon */ - @unlink( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $emo_set_dir . '/' . $image ); + @unlink( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir . '/' . $image ); $this->DB->delete( 'emoticons', "typed='$typed' and image='$image' and emo_set='$emo_set_dir'" ); /* Create the image in the file system */ - if( $FH = fopen( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' .$emo_set_dir . '/' . $image, 'wb' ) ) + if( $FH = fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' .$emo_set_dir . '/' . $image, 'wb' ) ) { if ( fwrite( $FH, $emoticons[ $image ] ) ) { @@ -268,7 +341,7 @@ class admin_core_posts_emoticons extends ipsCommand /* Add the emoticon to all the other directories */ try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' ) as $file ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' ) as $file ) { if( ! $file->isDot() && $file->isDir() ) { @@ -277,11 +350,11 @@ class admin_core_posts_emoticons extends ipsCommand continue; } - if ( ! file_exists( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $file->getFilename() . '/' . $image ) ) + if ( ! is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $file->getFilename() . '/' . $image ) ) { - $this->DB->buildAndFetch( array( 'delete' => 'emoticons', 'where' => "typed='$typed' and image='$image' and emo_set='{$file->getFilename()}'" ) ); + $this->DB->delete( 'emoticons', "typed='$typed' and image='$image' and emo_set='{$file->getFilename()}'" ); - if ( $FH = @fopen( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $file->getFilename() . '/' . $image, 'wb' ) ) + if ( $FH = @fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $file->getFilename() . '/' . $image, 'wb' ) ) { if ( fwrite( $FH, $emoticons[ $image ] ) ) { @@ -307,16 +380,15 @@ class admin_core_posts_emoticons extends ipsCommand /** * Export the specified emoticon directory * - * @access public - * @return void + * @return @e void */ public function emoticonsPackExport() { /* Setup XML */ - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); - require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' ); + require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/ $xmlarchive = new classXMLArchive(); /* Check the emoticon set */ @@ -345,13 +417,13 @@ class admin_core_posts_emoticons extends ipsCommand try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $this->request['emo_set'] ) as $file ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['emo_set'] ) as $file ) { if( ! $file->isDot() ) { if ( $emo_db[ $file->getFilename() ] != "" ) { - $files_to_add[] = DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $this->request['emo_set'] . '/' . $file->getFilename(); + $files_to_add[] = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['emo_set'] . '/' . $file->getFilename(); } } } @@ -392,13 +464,12 @@ class admin_core_posts_emoticons extends ipsCommand /** * Builds the emoticon import/export pack splash screen * - * @access public - * @return void + * @return @e void */ public function emoticonsPackSplash() { /* Check for the emoticon directory */ - if( ! is_dir( DOC_IPS_ROOT_PATH . 'public/style_emoticons' ) ) + if( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) ) { $this->registry->output->showError( $this->lang->words['emo_nolocate'], 2110 ); @@ -423,7 +494,7 @@ class admin_core_posts_emoticons extends ipsCommand try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_emoticons' ) as $file ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) { if( $file->isDir() && ! $file->isDot() ) { @@ -446,8 +517,7 @@ class admin_core_posts_emoticons extends ipsCommand /** * Remove the specified emoticon * - * @access public - * @return void + * @return @e void */ public function emoticonsRemove() { @@ -493,13 +563,17 @@ class admin_core_posts_emoticons extends ipsCommand /** * Add emoticons to the default directory * - * @access public - * @return void + * @return @e void */ public function emoticonsAdd() { + $image = str_replace( '---', '.', trim( $this->request['emo_image'] ) ); + $set = trim( $this->request['id'] ); + $typed = $this->_getNameFromImg( $image, $set ); + $position = $this->_getNextPosition( $set ); + /* Check the id */ - if( $this->request['id'] == "" ) + if ( empty( $set ) ) { $this->registry->output->global_message = $this->lang->words['emo_nogid']; $this->emoticonsOverview(); @@ -514,82 +588,65 @@ class admin_core_posts_emoticons extends ipsCommand return; } - /* Loop through the request and look for emoticons */ - foreach( $this->request as $key => $value ) + if ( ! $image OR ! $typed ) { - if( preg_match( "/^emo_type_(\d+)$/", $key, $match ) ) - { - if( isset( $this->request[ $match[0] ] ) ) - { - /* Get the emoticon info */ - $typed = str_replace( '"', "", $this->request[ $match[0] ] ); - $click = $this->request[ 'emo_click_'.$match[1] ]; - $add = $this->request[ 'emo_add_'.$match[1] ]; - $image = $this->request[ 'emo_image_'.$match[1] ]; - $set = trim( $this->request['id'] ); - $typed = str_replace( '\', "", $typed ); - - /* Check the add all flag */ - if( $this->request['addall'] ) - { - $add = 1; - } - - /* Add this emoticon if we have have the required info */ - if( $add and $typed and $image ) - { - /* Insert the emo record */ - $this->DB->insert( 'emoticons', array( 'clickable' => intval( $click ), 'typed' => $typed, 'image' => $image, 'emo_set' => $set ) ); - - /* Emoticon list */ - $emodirs = array( 0 => ''); - - /* Loop through all the emoticons */ - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_emoticons' ) as $file ) - { - if( ! $file->isDot() && $file->isDir() ) - { - if( $file->getFilename() == 'default' ) - { - $emodirs[0] = $file->getFilename(); - } - else - { - $emodirs[] = $file->getFilename(); - } - } - } - } catch ( Exception $e ) {} - - /* Add this emoticon to the other sets */ - foreach( $emodirs as $directory ) - { - if( $directory == $set ) - { - continue; - } - - $this->DB->insert( 'emoticons', array( 'clickable' => intval( $click ), 'typed' => $typed, 'image' => $image, 'emo_set' => $directory ) ); - } - } - } - } + $this->registry->output->global_message = $this->lang->words['emo_nogid']; + $this->emoticonsOverview(); + return; } + /* Insert the emo record */ + $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $set, 'emo_position' => $position ) ); + + /* Emoticon list */ + $emodirs = array( 0 => ''); + + /* Loop through all the emoticons */ + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) + { + if ( ! $file->isDot() && $file->isDir() && strpos( $file->getFilename(), '.' ) != 0 ) + { + if( $file->getFilename() == 'default' ) + { + $emodirs[0] = $file->getFilename(); + } + else + { + $emodirs[] = $file->getFilename(); + } + } + } + } catch ( Exception $e ) {} + + /* Add this emoticon to the other sets */ + foreach( $emodirs as $directory ) + { + if ( $directory == $set ) + { + continue; + } + + if ( empty( $directory ) ) + { + continue; + } + + $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $directory, 'emo_position' => $position ) ); + } + /* Rebuild the cache and bounce */ $this->emoticonsRebuildCache(); $this->registry->output->global_message = $this->lang->words['emo_updated']; - $this->emoticonsManageDirectory(); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code . '&do=emo_manage&id=' . $this->request['id'] ); } /** * Handles the upload emoticon form * - * @access public - * @return void + * @return @e void */ public function emoticonsUpload() { @@ -634,7 +691,7 @@ class admin_core_posts_emoticons extends ipsCommand try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'public/style_emoticons' ) as $file ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) { if( ! $file->isDot() && $file->isDir() ) { @@ -681,7 +738,7 @@ class admin_core_posts_emoticons extends ipsCommand // Make sure it's not a NAUGHTY file //----------------------------------------- - $file_extension = preg_replace( "#^.*\.(.+?)$#si", "\\1", mb_strtolower( $_FILES[ $field ]['name'] ) ); + $file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", mb_strtolower( $_FILES[ $field ]['name'] ) ); if ( ! in_array( $file_extension, $this->allowed_files ) ) { @@ -694,7 +751,7 @@ class admin_core_posts_emoticons extends ipsCommand // Copy the upload to the uploads directory //----------------------------------------- - if ( ! @move_uploaded_file( $_FILES[ $field ]['tmp_name'], DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $first_dir . "/" . $FILE_NAME) ) + if ( ! @move_uploaded_file( $_FILES[ $field ]['tmp_name'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME) ) { $this->registry->output->global_message = "The upload failed, sorry!"; $this->emoticonsOverview(); @@ -702,7 +759,7 @@ class admin_core_posts_emoticons extends ipsCommand } else { - @chmod( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $first_dir . "/" . $FILE_NAME, 0777 ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); //----------------------------------------- // Copy to other folders @@ -712,7 +769,7 @@ class admin_core_posts_emoticons extends ipsCommand { foreach ( $directories as $newdir ) { - if ( file_exists( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) { if ( $overwrite != 1 OR $newdir == 'default' ) { @@ -720,9 +777,9 @@ class admin_core_posts_emoticons extends ipsCommand } } - if ( @copy( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $first_dir . "/" . $FILE_NAME, DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + if ( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) { - @chmod( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $newdir . "/" . $FILE_NAME, 0777 ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); } } } @@ -732,14 +789,14 @@ class admin_core_posts_emoticons extends ipsCommand { foreach ( $emodirs as $newdir ) { - if ( file_exists( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) { continue; } - if( @copy( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $first_dir . "/" .$FILE_NAME, DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + if( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" .$FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) { - @chmod( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $newdir . "/" . $FILE_NAME, 0777 ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); } } } @@ -763,8 +820,7 @@ class admin_core_posts_emoticons extends ipsCommand /** * Removes an emoticon set * - * @access public - * @return void + * @return @e void */ public function emoticonsSetRemove() { @@ -784,7 +840,9 @@ class admin_core_posts_emoticons extends ipsCommand } /* Remove the directory */ - $this->registry->adminFunctions->removeDirectory( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $this->request['id'] ); + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); + $fileManagement = new $classToLoad(); + $fileManagement->removeDirectory( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['id'] ); /* Remove the database entry */ $this->DB->delete( 'emoticons', "emo_set='{$this->request['id']}'" ); @@ -800,14 +858,13 @@ class admin_core_posts_emoticons extends ipsCommand /** * Add/Edit an emoticon folder name * - * @access public * @param string Type (add or edit) - * @return void + * @return @e void */ public function emoticonsSetAlter( $type='add' ) { /* Get the name */ - $name = preg_replace( "/[^a-zA-Z0-9\-_]/", "", $this->request['emoset'] ); + $name = preg_replace( '/[^a-zA-Z0-9\-_]/', "", $this->request['emoset'] ); /* Check th ename */ if( $name == "" ) @@ -824,7 +881,7 @@ class admin_core_posts_emoticons extends ipsCommand } /* Check to see if the directory already exists */ - if( file_exists( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name ) ) + if( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) { $this->registry->output->global_message = sprintf( $this->lang->words['emo_already'], $name ); return $this->emoticonsOverview(); @@ -833,20 +890,20 @@ class admin_core_posts_emoticons extends ipsCommand if( $type == 'add' ) { /* Create the directory */ - if( @mkdir( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name, 0777 ) ) + if( @mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name, IPS_FOLDER_PERMISSION ) ) { - @chmod( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name, 0777 ); - @file_put_contents( DOC_IPS_ROOT_PATH . 'public/style_emoticons/' . $name . '/index.html', '' ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name, IPS_FOLDER_PERMISSION ); + @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/index.html', '' ); /* Copy default emoticons */ try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . '/public/style_emoticons/default/' ) as $file ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/default/' ) as $file ) { if( ! $file->isDot() ) { - @copy( DOC_IPS_ROOT_PATH . '/public/style_emoticons/default/' . $file->getFilename(), DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name . '/' . $file->getFilename() ); - @chmod( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name . '/' . $file->getFilename(), 0777 ); + @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/default/' . $file->getFilename(), DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/' . $file->getFilename() ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/' . $file->getFilename(), IPS_FILE_PERMISSION ); } } } catch ( Exception $e ) {} @@ -892,10 +949,10 @@ class admin_core_posts_emoticons extends ipsCommand } /* Rename the directory */ - if ( @rename( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $this->request['id'], DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name ) ) + if ( @rename( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['id'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) { /* Check to see if the rename worked */ - if ( file_exists( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $name ) ) + if ( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) { /* Update all the emoticons */ $this->DB->update( 'emoticons', array( 'emo_set' => $name ), "emo_set='{$this->request['id']}'" ); @@ -934,8 +991,7 @@ class admin_core_posts_emoticons extends ipsCommand /** * Process edit emoticons forum * - * @access public - * @return void + * @return @e void */ public function emoticonsEdit() { @@ -950,7 +1006,7 @@ class admin_core_posts_emoticons extends ipsCommand foreach( $this->request as $key => $value ) { /* Check to see if its an emoticon */ - if ( preg_match( "/^emo_id_(\d+)$/", $key, $match ) ) + if ( preg_match( '/^emo_id_(\d+)$/', $key, $match ) ) { if ( $match[0] ) { @@ -999,8 +1055,7 @@ class admin_core_posts_emoticons extends ipsCommand /** * Manage emoticons * - * @access public - * @return void + * @return @e void */ public function emoticonsManageDirectory() { @@ -1008,24 +1063,9 @@ class admin_core_posts_emoticons extends ipsCommand $this->request['id'] = trim( $this->request['id'] ); /* Get emoticons for this group */ - $emo_db = array(); + $emo_db = $this->_getEmoSet( $this->request['id'] ); $emo_file = array(); - $this->DB->build( array( - 'select' => '*', - 'from' => 'emoticons', - 'where' => "emo_set='{$this->request['id']}'", - 'order' => 'clickable DESC, image ASC' - ) ); - $this->DB->execute(); - - /* Loop through the emoticons */ - while( $r = $this->DB->fetch() ) - { - $emo_db[ $r['image'] ] = $r; - } - - /* Get emoticons from the directory */ $emo_file = array(); $emo_rfile = $this->_emoticonGetGolderContents( $this->request['id'] ); @@ -1034,10 +1074,6 @@ class admin_core_posts_emoticons extends ipsCommand { $emo_file[ $ef ] = $ef; } - - /* Number of emoticons to show per row */ - $per_row = 5; - $td_width = 100 / $per_row; /* Loop through the database emoticons */ $poss_names = array(); @@ -1046,23 +1082,10 @@ class admin_core_posts_emoticons extends ipsCommand foreach( $emo_db as $image => $data ) { /* Remove this from the file list, it's already added */ - unset( $emo_file[ $image ] ); - - /* Clickable? */ - if ( $data['clickable'] ) - { - $data['_click'] = 'checked="checked"'; - $data['_class'] = 'tablerow1'; - } - else - { - $data['_click'] = ''; - $data['_class'] = 'tablerow2'; - } + unset( $emo_file[ $data['image'] ] ); /* Add image to array */ - $data['image'] = $image; - + $data['image'] = $data['image']; /* Addd array to output */ $db_rows[] = $data; @@ -1082,9 +1105,9 @@ class admin_core_posts_emoticons extends ipsCommand $_fdata = array(); /* Suggest an emoticon name */ - $_fdata['poss_name'] = ':'.preg_replace( "/(.*)(\..+?)$/", "\\1", $image ).':'; + $_fdata['poss_name'] = ':'.preg_replace( '/(.*)(\..+?)$/', "\\1", $image ).':'; - if ( isset($poss_names[ $_fdata['poss_name'] ]) AND $poss_names[ $_fdata['poss_name'] ] ) + if ( ! empty($poss_names[ $_fdata['poss_name'] ]) ) { $_fdata['poss_name'] = preg_replace( "/:$/", "2:", $_fdata['poss_name'] ); } @@ -1100,19 +1123,18 @@ class admin_core_posts_emoticons extends ipsCommand /* Output */ $this->registry->output->extra_nav[] = array( '', $this->lang->words['emo_manage_set'].$this->request['id'] ); - $this->registry->output->html .= $this->html->emoticonsDirectoryManagement( $db_rows, $file_rows, $td_width, $per_row ); + $this->registry->output->html .= $this->html->emoticonsDirectoryManagement( $db_rows, $file_rows); } /** * Builds the emoticons overview screen * - * @access public - * @return void + * @return @e void */ public function emoticonsOverview() { /* Check for the emoticon directory */ - if ( ! is_dir( DOC_IPS_ROOT_PATH . '/public/style_emoticons' ) ) + if ( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) ) { $this->registry->output->showError( $this->lang->words['emo_nolocate'], 2111 ); @@ -1136,11 +1158,11 @@ class admin_core_posts_emoticons extends ipsCommand try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . '/public/style_emoticons' ) as $_emoticon ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $_emoticon ) { if ( $_emoticon->isDir() AND ! $_emoticon->isDot() AND $_emoticon->getFilename() != '.svn' ) { - if ( is_dir( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $_emoticon ) ) + if ( is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $_emoticon ) ) { if( $_emoticon->getFilename() == 'default' ) { @@ -1188,7 +1210,7 @@ class admin_core_posts_emoticons extends ipsCommand } } - if ( is_writeable( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $dir ) ) + if ( is_writeable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $dir ) ) { if( $dir == 'default' ) { @@ -1199,13 +1221,13 @@ class admin_core_posts_emoticons extends ipsCommand $checked_def = ""; } - $data['icon'] = 'icon_can_write.gif'; + $data['icon'] = 'writable.png'; $data['title'] = $this->lang->words['emo_writeable']; $data['checkbox'] = ""; } else { - $data['icon'] = 'icon_cannot_write.gif'; + $data['icon'] = 'unwritable.png'; $data['title'] = $this->lang->words['emo_writeable_not']; $data['checkbox'] = "-"; } @@ -1222,14 +1244,13 @@ class admin_core_posts_emoticons extends ipsCommand /** * Rebuilds the emoticon cache * - * @access public - * @return void + * @return @e void */ public function emoticonsRebuildCache() { $cache = array(); - $this->DB->build( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons' ) ); + $this->DB->build( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons', 'order' => 'emo_position asc' ) ); $c = $this->DB->execute(); while ( $r = $this->DB->fetch( $c ) ) @@ -1237,20 +1258,83 @@ class admin_core_posts_emoticons extends ipsCommand $cache[] = $r; } - usort( $cache, array( $this, '_thisUsort' ) ); - ipsRegistry::cache()->setCache( 'emoticons', $cache, array( 'array' => 1 ) ); } + /** + * Fetch next position + * @param string Emo set ID (default) + * + */ + protected function _getNextPosition( $set ) + { + $res = $this->DB->buildAndFetch( array( 'select' => 'MAX(emo_position) as max', + 'from' => 'emoticons', + 'where' => "emo_set='" . $this->DB->addSlashes( $set ) . "'" ) ); + + return intval( $res['max'] ) + 1; + } + + /** + * Fetch possible name + * @param string Image name (smile.gif) + * @param string Emo set ID (default) + * + */ + protected function _getNameFromImg( $img, $set ) + { + $emos = $this->_getEmoSet( $set ); + $name = ':' . preg_replace( '/(.*)(\..+?)$/', "\\1", $img ).':'; + + /* Ensure we're not doubling up */ + foreach( $emos as $im => $data ) + { + if ( $name == $data['typed'] ) + { + $name = preg_replace( "/:$/", "2:", $name ); + break; + } + } + + return $name; + } + + /** + * Get all emos in a set + * @param string Emo set ID (default) + */ + protected function _getEmoSet( $set ) + { + if ( ! is_array( $this->setCache[ $set ] ) OR ! count( $this->setCache[ $set ] ) ) + { + $this->setCache[ $set ] = array(); + + $this->DB->build( array( 'select' => '*', + 'from' => 'emoticons', + 'where' => "emo_set='" . $this->DB->addSlashes( $set ) . "'", + 'order' => 'emo_position ASC' ) ); + $this->DB->execute(); + + /* Loop through the emoticons */ + while( $r = $this->DB->fetch() ) + { + $this->setCache[ $set ][ $r['emo_position'] . '.' . rand(0, 10000 ) ] = $r; + } + + ksort( $this->setCache[ $set ] ); + } + + return $this->setCache[ $set ]; + } + /** * Custom sort operation * - * @access private * @param string A * @param string B * @return integer */ - private static function _thisUsort($a, $b) + protected static function _thisUsort($a, $b) { if ( strlen($a['typed']) == strlen($b['typed']) ) { @@ -1263,22 +1347,21 @@ class admin_core_posts_emoticons extends ipsCommand /** * Gets all the emoticons from the specified directory * - * @access private * @param string $folder Emoticon folder to pull emoticons from * @return array - **/ - private function _emoticonGetGolderContents( $folder='default' ) + */ + protected function _emoticonGetGolderContents( $folder='default' ) { $files = array(); /* Loop through the emoticon directory */ try { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . '/public/style_emoticons/' . $folder ) as $_emo ) + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ) as $_emo ) { if( $_emo->isFile() && ! $_emo->isDot() ) { - if ( preg_match( "/\.(?:gif|jpg|jpeg|png|swf)$/i", $_emo->getFilename() ) ) + if ( preg_match( '/\.(?:gif|jpg|jpeg|png|swf)$/i', $_emo->getFilename() ) ) { $files[] = $_emo->getFilename(); } diff --git a/upload/admin/applications/core/modules_admin/posts/index.html b/upload/admin/applications/core/modules_admin/posts/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/posts/index.html +++ b/upload/admin/applications/core/modules_admin/posts/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/media.php b/upload/admin/applications/core/modules_admin/posts/media.php index 2e27c71d..bcfd0412 100644 --- a/upload/admin/applications/core/modules_admin/posts/media.php +++ b/upload/admin/applications/core/modules_admin/posts/media.php @@ -2,19 +2,19 @@ /** *
  * Invision Power Services
- * IP.Board v3.1.4
+ * IP.Board v3.2.3
  * BBCode Media Tag Management
- * Last Updated: $LastChangedDate: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
+ * Last Updated: $LastChangedDate: 2011-08-04 06:15:18 -0400 (Thu, 04 Aug 2011) $
  * 
* - * @author $Author: ips_terabyte $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 6990 $ + * @version $Rev: 9361 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,13 +30,13 @@ class admin_core_posts_media extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -121,9 +121,9 @@ class admin_core_posts_media extends ipsCommand /** * Reorder media tags * - * @return void + * @return @e void */ - private function _moveMediaTag() + protected function _moveMediaTag() { //----------------------------------------- // INIT @@ -165,9 +165,9 @@ class admin_core_posts_media extends ipsCommand /** * Import a mediaTag XML file * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _mediaTagImport() + protected function _mediaTagImport() { $content = $this->registry->getClass('adminFunctions')->importXml( 'mediatag.xml' ); @@ -193,7 +193,7 @@ class admin_core_posts_media extends ipsCommand * Abstracted import routine for installer * * @param string XML file content - * @return void + * @return @e void */ public function doMediaImport( $content ) { @@ -201,7 +201,7 @@ class admin_core_posts_media extends ipsCommand // Get xml mah-do-dah //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->loadXML( $content ); @@ -257,15 +257,15 @@ class admin_core_posts_media extends ipsCommand /** * Export a mediaTag XML file * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _mediaTagExport() + protected function _mediaTagExport() { //----------------------------------------- // Get xml mah-do-dah //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -300,9 +300,9 @@ class admin_core_posts_media extends ipsCommand /** * Delete a custom media tag * - * @return void + * @return @e void */ - private function _mediaTagDelete() + protected function _mediaTagDelete() { /* ID */ $id = intval( $this->request['id'] ); @@ -321,9 +321,9 @@ class admin_core_posts_media extends ipsCommand * Save changes to a custom media tag * * @param string [$type='add'] - * @return void + * @return @e void */ - private function _mediaTagSave( $type='add' ) + protected function _mediaTagSave( $type='add' ) { /* INI */ $errors = array(); @@ -367,7 +367,8 @@ class admin_core_posts_media extends ipsCommand $this->recacheMediaTag(); /* All done */ - $this->registry->output->doneScreen( sprintf( $this->lang->words['m_tag_added'], $data['mediatag_name']), $this->lang->words['m_manager'], "{$this->form_code}&do=overview", 'redirect' ); + $this->registry->output->global_message = sprintf( $this->lang->words['m_tag_added'], $data['mediatag_name'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=overview" ); } else { @@ -380,7 +381,8 @@ class admin_core_posts_media extends ipsCommand $this->recacheMediaTag(); /* Done and done */ - $this->registry->output->doneScreen( sprintf( $this->lang->words['m_tag_updated'], $data['mediatag_name']), $this->lang->words['m_manager'], "{$this->form_code}&do=overview", 'redirect' ); + $this->registry->output->global_message = sprintf( $this->lang->words['m_tag_updated'], $data['mediatag_name'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=overview" ); } } @@ -390,9 +392,9 @@ class admin_core_posts_media extends ipsCommand * * @param string [$type='add'] * @param array [Optional] array of errors - * @return void + * @return @e void */ - private function _mediaTagForm( $type='add', $errors=array() ) + protected function _mediaTagForm( $type='add', $errors=array() ) { /* Check form type */ if( $type == 'add' ) @@ -411,9 +413,9 @@ class admin_core_posts_media extends ipsCommand $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'bbcode_mediatag', 'where' => "mediatag_id={$id}" ) ); /* Set Defaults */ - $data['mediatag_name'] = ( isset( $this->request['mediatag_name'] ) && $this->request['mediatag_name'] ) ? $this->request['mediatag_name'] : $data['mediatag_name']; - $data['mediatag_match'] = ( isset( $this->request['mediatag_match'] ) && $this->request['mediatag_match'] ) ? IPSText::textToForm( $this->request['mediatag_match'] ) : IPSText::textToForm( $data['mediatag_match'] ); - $data['mediatag_replace'] = ( isset( $this->request['mediatag_replace'] ) && $this->request['mediatag_replace'] ) ? IPSText::textToForm( $this->request['mediatag_replace'] ) : IPSText::textToForm( $data['mediatag_replace'] ); + $data['mediatag_name'] = !empty( $this->request['mediatag_name'] ) ? $this->request['mediatag_name'] : $data['mediatag_name']; + $data['mediatag_match'] = !empty( $this->request['mediatag_match'] ) ? IPSText::textToForm( $this->request['mediatag_match'] ) : IPSText::textToForm( $data['mediatag_match'] ); + $data['mediatag_replace'] = !empty( $this->request['mediatag_replace'] ) ? IPSText::textToForm( $this->request['mediatag_replace'] ) : IPSText::textToForm( $data['mediatag_replace'] ); } /* Setup Form */ @@ -423,9 +425,9 @@ class admin_core_posts_media extends ipsCommand /** * List all the the current media tag types * - * @return void + * @return @e void */ - private function _mediaTagIndex() + protected function _mediaTagIndex() { /* Query Bookmarks */ $this->DB->build( array( @@ -450,7 +452,7 @@ class admin_core_posts_media extends ipsCommand /** * Recache the mediatag config * - * @return void + * @return @e void */ public function recacheMediaTag() { @@ -463,7 +465,7 @@ class admin_core_posts_media extends ipsCommand while( $r = $this->DB->fetch() ) { $media_config[$r['mediatag_name']] = array( - 'match' => preg_replace( "#{[0-9]}#", "(.*?)", str_replace( '.', '\.', str_replace( '?', '\?', $r['mediatag_match'] ) ) ), + 'match' => preg_replace( "#{[0-9]}#", "(.*?)", str_replace( '.', '\.', str_replace( '?', '?', $r['mediatag_match'] ) ) ), 'replace' => $r['mediatag_replace'], ); } diff --git a/upload/admin/applications/core/modules_admin/posts/xml/index.html b/upload/admin/applications/core/modules_admin/posts/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/posts/xml/index.html +++ b/upload/admin/applications/core/modules_admin/posts/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/xml/menu.xml b/upload/admin/applications/core/modules_admin/posts/xml/menu.xml index 97a8a600..fc17a667 100644 --- a/upload/admin/applications/core/modules_admin/posts/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/posts/xml/menu.xml @@ -6,16 +6,10 @@ Управление смайликами + emoticons emoticons do=overview - - 0 - - - Импорт / Экспорт - emoticons - do=emo_packsplash - + emoticons_manage 0 @@ -25,16 +19,23 @@ Управление BB-кодами + bbcode bbcode do=overview - + bbcode_manage 0 + +
+ + Manage Media Tag + Медиа BB-коды + mediatag media do=overview - + media_manage 0 @@ -44,9 +45,10 @@ Управление нецензурными словами + badwords badwords do=overview - + badword_manage 0 diff --git a/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml b/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml index a2a9c4c2..3f91347d 100644 --- a/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml @@ -2,6 +2,7 @@ Управление нецензурными словами + core_badwords badword_manage @@ -15,6 +16,7 @@ Смайлики + core_emoticons emoticons_manage @@ -36,6 +38,7 @@ BB-коды + core_bbcode bbcode_manage @@ -49,6 +52,7 @@ Управление Media тегами + core_media media_manage diff --git a/upload/admin/applications/core/modules_admin/report/defaultSection.php b/upload/admin/applications/core/modules_admin/report/defaultSection.php index a9d8d636..df15f7b2 100644 --- a/upload/admin/applications/core/modules_admin/report/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/report/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default reports section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'report' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'reports'; \ No newline at end of file +$DEFAULT_SECTION = 'reports'; diff --git a/upload/admin/applications/core/modules_admin/report/index.html b/upload/admin/applications/core/modules_admin/report/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/report/index.html +++ b/upload/admin/applications/core/modules_admin/report/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/report/reports.php b/upload/admin/applications/core/modules_admin/report/reports.php index 5ef00b34..bf2395bf 100644 --- a/upload/admin/applications/core/modules_admin/report/reports.php +++ b/upload/admin/applications/core/modules_admin/report/reports.php @@ -1,20 +1,15 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Management for reported content - * Last Updated: $LastChangedDate: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $ - * - * - * @author $Author: ips_terabyte $ + * @file reports.php Management for reported content + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: bfarber $ * @author Based on original "Report Center" by Luke Scott - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6990 $ + * @since - + * $LastChangedDate: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $ + * @version v3.2.3 + * $Revision: 9487 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -23,20 +18,39 @@ if ( ! defined( 'IN_ACP' ) ) exit(); } +/** + * + * @class admin_core_report_reports + * @brief Management for reported content + */ class admin_core_report_reports extends ipsCommand { /** - * Skin object + * Skin object shortcut * - * @var object Skin templates + * @var $html */ - private $html; + public $html; /** - * Main class entry point + * String for the screen url bit * - * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @var $form_code + */ + public $form_code = ''; + + /** + * String for the JS url bit + * + * @var $form_code_js + */ + public $form_code_js = ''; + + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -149,25 +163,24 @@ class admin_core_report_reports extends ipsCommand } /** - * Displays the overview page with version info, blog, stats, etc... + * Displays the overview page with statistics, graphs, etc... * - * @return void + * @return @e void */ - private function _mainScreen() + public function _mainScreen() { - $this->DB->build( array( 'select' => 'id', 'from' => 'rc_reports' ) ); - $this->DB->execute(); - $num_reports = $this->DB->getTotalRows(); + /* Get some data */ + $_tmp = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_reports' ) ); + $num_reports = intval($_tmp['total']); - $this->DB->build( array( 'select' => 'id', 'from' => 'rc_comments' ) ); - $this->DB->execute(); - $num_comments = $this->DB->getTotalRows(); + $_tmp = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'rc_comments' ) ); + $num_comments = intval($_tmp['total']); $this->DB->build( array( 'select' => 'onoff', 'from' => 'rc_classes' ) ); $this->DB->execute(); - $plug_on = 0; - $plug_total = 0; + $plug_on = 0; + $plug_total = 0; while( $plugs = $this->DB->fetch() ) { @@ -179,7 +192,7 @@ class admin_core_report_reports extends ipsCommand $plug_total++; } - $this->registry->output->html .= $this->html->overview_main_template( array( + $this->registry->output->html .= $this->html->overview_main_template( array( 'reports_total' => $num_reports, 'comments_total' => $num_comments, 'active_plugins' => $plug_on, @@ -191,9 +204,9 @@ class admin_core_report_reports extends ipsCommand /** * This function is used when you disable/enable a report plugin * - * @return void + * @return @e void */ - private function _togglePlugin() + public function _togglePlugin() { $plugin_id = intval($this->request['plugin_id']); @@ -225,11 +238,11 @@ class admin_core_report_reports extends ipsCommand /** * Basics for creating a plugin (with only file name, title, and description) * - * @return void + * @return @e void */ - private function _createPlugin() + public function _createPlugin() { - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=plugin" , $this->lang->words['r_plugmanager'] ); + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=plugin" , $this->lang->words['r_plugmanager'] ); if( $_POST['finish'] == 1 ) { @@ -245,7 +258,7 @@ class admin_core_report_reports extends ipsCommand { $this->registry->output->global_message = $this->lang->words['r_incchar']; } - elseif( ! file_exists( IPSLib::getAppDir( $this->request['appPlugin'] ) . '/extensions/reportPlugins/' . $this->request['plugi_file'] . '.php' ) ) + elseif( ! is_file( IPSLib::getAppDir( $this->request['appPlugin'] ) . '/extensions/reportPlugins/' . $this->request['plugi_file'] . '.php' ) ) { $this->registry->output->global_message = $this->lang->words['r_404file']; } @@ -276,7 +289,8 @@ class admin_core_report_reports extends ipsCommand // Redirect to edit the plugin for more //----------------------------------------- - $this->registry->output->doneScreen( $this->lang->words['r_plugincreate'], $this->lang->words['r_finishplugin'], "{$this->form_code}&do=edit_plugin&com_id=" . $plugin_id, 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_plugincreate']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=edit_plugin&com_id=" . $plugin_id ); } } @@ -290,9 +304,9 @@ class admin_core_report_reports extends ipsCommand /** * Here we are editing a plugin's settings * - * @return void + * @return @e void */ - private function _editPlugin() + public function _editPlugin() { $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=plugin" , $this->lang->words['r_plugmanager'] ); @@ -384,21 +398,24 @@ class admin_core_report_reports extends ipsCommand if( $plug_data['lockd'] == 0 || IN_DEV == 1 ) { - $build_plugin['lockd'] = $this->request['plugi_lockd']; + $build_plugin['lockd'] = intval($this->request['plugi_lockd']); } if( ! $this->registry->output->global_message ) - { - $this->DB->update( 'rc_classes', $build_plugin, "com_id={$plug_id}" ); + { + $this->DB->update( 'rc_classes', $build_plugin, "com_id={$plug_id}" ); - $this->registry->output->doneScreen($this->lang->words['r_plugupdated'], $this->lang->words['r_plugmanager'], "{$this->form_code}&do=plugin", 'redirect' ); + $this->cache->rebuildCache( 'report_plugins', 'global' ); + + $this->registry->output->global_message = $this->lang->words['r_plugupdated']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=plugin" ); } else { $plug_data = $build_plugin; } } - + //----------------------------------------- // Break up group perms into an array //----------------------------------------- @@ -425,9 +442,9 @@ class admin_core_report_reports extends ipsCommand /** * Lock/unlock a plugin * - * @return void + * @return @e void */ - private function _changePlugin() + public function _changePlugin() { $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=plugin" , $this->lang->words['r_plugmanager'] ); @@ -503,7 +520,7 @@ class admin_core_report_reports extends ipsCommand 'author_url' => $this->request['plugi_author_url'], 'my_class' => $this->request['plugi_file'], 'pversion' => 'v' . strval($this->request['plugi_version']), - 'lockd' => $this->request['plugi_lockd'] + 'lockd' => intval($this->request['plugi_lockd']) ); //----------------------------------------- @@ -526,7 +543,8 @@ class admin_core_report_reports extends ipsCommand // Plugin was changed, need settings now //----------------------------------------- - $this->registry->output->doneScreen($this->lang->words['r_plugupdated'], $this->lang->words['r_finishplugin'], "{$this->form_code}&do=edit_plugin&com_id=" . $plug_id, 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_plugupdated']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=edit_plugin&com_id=" . $plug_id ); } else { @@ -534,7 +552,8 @@ class admin_core_report_reports extends ipsCommand // File was not changed, no need to edit.. //----------------------------------------- - $this->registry->output->doneScreen($this->lang->words['r_plugupdated'], $this->lang->words['r_plugmanager'], "{$this->form_code}&do=plugin", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_plugupdated']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=plugin" ); } } else @@ -553,9 +572,9 @@ class admin_core_report_reports extends ipsCommand /** * This is when we want to remove a plugin, possibly cuz it's crap * - * @return void + * @return @e void */ - private function _removePlugin() + public function _removePlugin() { $com_id = intval( $this->request['com_id'] ); @@ -597,15 +616,16 @@ class admin_core_report_reports extends ipsCommand $this->DB->delete( 'rc_classes', "com_id={$com_id}" ); - $this->registry->output->doneScreen( $this->lang->words['r_deleteplug'], $this->lang->words['r_plugmanager'], "{$this->form_code}&do=plugin", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_deleteplug']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=plugin" ); } /** * This is where you view all the plugins in a list with options * - * @return void + * @return @e void */ - private function _showPluginIndex() + public function _showPluginIndex() { $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=plugin" , $this->lang->words['r_plugmanager'] ); @@ -619,15 +639,15 @@ class admin_core_report_reports extends ipsCommand $plugin_rows .= $this->html->report_plugin_row( $row ); } - $this->registry->output->html = $this->html->report_plugin_overview( $plugin_rows ); + $this->registry->output->html .= $this->html->report_plugin_overview( $plugin_rows ); } /** * This is when you delete a status/severity image * - * @return void + * @return @e void */ - private function _removeImage() + public function _removeImage() { $img_id = intval( $this->request['id'] ); @@ -640,15 +660,16 @@ class admin_core_report_reports extends ipsCommand $this->DB->delete( 'rc_status_sev', "id={$img_id}" ); - $this->registry->output->doneScreen( $this->lang->words['r_imgdel'], $this->lang->words['r_statsever'], "{$this->form_code}&do=status", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_imgdel']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=status" ); } /** * This is when I want to add a severity/status image * - * @return void + * @return @e void */ - private function _addImage() + public function _addImage() { $stat_id = intval( $this->request['id'] ); @@ -688,7 +709,8 @@ class admin_core_report_reports extends ipsCommand $this->DB->insert( 'rc_status_sev', $build_image, "id='{$img_id}'" ); - $this->registry->output->doneScreen($this->lang->words['r_imgsaved'], $this->lang->words['r_statsever'], "{$this->form_code}&do=status", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_imgsaved']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=status" ); } } @@ -719,9 +741,9 @@ class admin_core_report_reports extends ipsCommand /** * This is for setting, in status index, which is New, Complete, and Active * - * @return void + * @return @e void */ - private function _setStatus() + public function _setStatus() { $stat_id = intval( $this->request['id'] ); @@ -776,7 +798,7 @@ class admin_core_report_reports extends ipsCommand // We can have as many active as we want //----------------------------------------- - $this->DB->update( 'rc_status', array( 'is_active' => ( ! $row['is_active'] ) ), "status={$stat_id}" ); + $this->DB->update( 'rc_status', array( 'is_active' => intval( !$row['is_active'] ) ), "status={$stat_id}" ); } else { @@ -793,9 +815,9 @@ class admin_core_report_reports extends ipsCommand /** * This is the magic behind removing a status and the images behind it * - * @return void + * @return @e void */ - private function _removeStatus() + public function _removeStatus() { $stat_id = intval( $this->request['id'] ); @@ -840,15 +862,16 @@ class admin_core_report_reports extends ipsCommand $this->DB->delete( 'rc_status', "status='{$stat_id}'" ); $this->DB->delete( 'rc_status_sev', "status='{$stat_id}'" ); - $this->registry->output->doneScreen($this->lang->words['r_statdel'], $this->lang->words['r_statsever'], "{$this->form_code}&do=status", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_statdel']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=status" ); } /** * Here is where you create a status (before the added images) * - * @return void + * @return @e void */ - private function _createStatus() + public function _createStatus() { if( $_POST['finish'] == 1 ) { @@ -881,7 +904,8 @@ class admin_core_report_reports extends ipsCommand $this->DB->insert( 'rc_status', $build_status ); - $this->registry->output->doneScreen( $this->lang->words['r_statcreated'], $this->lang->words['r_statsever'], "{$this->form_code}&do=status", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_statcreated']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=status" ); } } @@ -891,9 +915,9 @@ class admin_core_report_reports extends ipsCommand /** * This is when I want to edit a status * - * @return void + * @return @e void */ - private function _editStatus() + public function _editStatus() { $stat_id = intval( $this->request['id'] ); @@ -932,7 +956,8 @@ class admin_core_report_reports extends ipsCommand $this->DB->update( 'rc_status', $build_status, "status='{$stat_id}'" ); - $this->registry->output->doneScreen( $this->lang->words['r_statsaved'], $this->lang->words['r_statsever'], "{$this->form_code}&do=status", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_statsaved']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=status" ); } } @@ -955,9 +980,9 @@ class admin_core_report_reports extends ipsCommand /** * This is where you edit an image under a status * - * @return void + * @return @e void */ - private function _editImage() + public function _editImage() { $img_id = intval( $this->request['id'] ); @@ -997,7 +1022,8 @@ class admin_core_report_reports extends ipsCommand $this->DB->update( 'rc_status_sev', $build_image, "id='{$img_id}'" ); - $this->registry->output->doneScreen($this->lang->words['r_imgsaved'], $this->lang->words['r_statsever'], "{$this->form_code}&do=status", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['r_imgsaved']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . "&do=status" ); } } @@ -1026,9 +1052,9 @@ class admin_core_report_reports extends ipsCommand /** * When we want to move the status up or down (not sideways...) * - * @return void + * @return @e void */ - private function _moveStatus() + public function _moveStatus() { //----------------------------------------- // INIT @@ -1070,11 +1096,13 @@ class admin_core_report_reports extends ipsCommand /** * Shows the status/severity index with all the special stuff * - * @return void + * @return @e void */ - private function _showStatusIndex() + public function _showStatusIndex() { - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=status" , $this->lang->words['r_statsever'] ); + /* Init vars */ + $statusRows = array(); + $imagesCache = array(); //----------------------------------------- // Get the default board skin... @@ -1089,15 +1117,9 @@ class admin_core_report_reports extends ipsCommand $this->DB->build( array( 'select' => '*', 'from' => 'rc_status_sev', 'order' => 'status ASC, points ASC' ) ); $this->DB->execute(); - //----------------------------------------- - // Store the status images in an array... - //----------------------------------------- - - $status_image_cache = array(); - while( $srow = $this->DB->fetch() ) { - $status_image_cache[ $srow['status'] ] .= str_replace( '<#IMG_DIR#>', $skin['set_image_dir'], $this->html->report_status_image( $srow ) ); + $imagesCache[ $srow['status'] ] .= str_replace( '<#IMG_DIR#>', $skin['set_image_dir'], $this->html->report_status_image( $srow ) ); } //----------------------------------------- @@ -1106,8 +1128,6 @@ class admin_core_report_reports extends ipsCommand $this->DB->build( array( 'select' => '*', 'from' => 'rc_status', 'order' => 'rorder ASC' ) ); $this->DB->execute(); - - $total_statuses = $this->DB->getTotalRows(); while( $row = $this->DB->fetch() ) { @@ -1123,19 +1143,22 @@ class admin_core_report_reports extends ipsCommand // Finish row with image cache... //----------------------------------------- - $row['status_images'] = $status_image_cache[ $row['status'] ]; - $status_rows .= $this->html->report_status_row( $row ); + $row['status_images'] = $imagesCache[ $row['status'] ]; + + $statusRows[] = $row; } - - $this->registry->output->html = $this->html->report_status_overview( $status_rows ); + + /* Output */ + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=status" , $this->lang->words['r_statsever'] ); + $this->registry->output->html .= $this->html->report_status_overview( $statusRows ); } /** * Shows report stats in the last 24 hours using chart class * - * @return void + * @return @e void */ - private function _reportsChart() + public function _reportsChart() { //----------------------------------------- // Let's build our data for the chart @@ -1174,11 +1197,11 @@ class admin_core_report_reports extends ipsCommand // Let's draw our pie chart now //----------------------------------------- - require_once( IPS_KERNEL_PATH . '/classGraph.php' ); + require_once( IPS_KERNEL_PATH . '/classGraph.php' );/*noLibHook*/ $graph = new classGraph(); $graph->options['title'] = $this->lang->words['r_last24']; - $graph->options['width'] = 400; - $graph->options['height'] = 250; + $graph->options['width'] = 500; + $graph->options['height'] = 300; $graph->options['style3D'] = 1; if( count($chart_data) ) @@ -1199,50 +1222,23 @@ class admin_core_report_reports extends ipsCommand /** * Shows bar graph of top five moderators. Show's what's been done * - * @return void + * @return @e void */ - private function _moderatorsChart() + public function _moderatorsChart() { //----------------------------------------- // Build data for the bar chart //----------------------------------------- - $this->DB->build( array( - 'select' => 'rep.id', - 'from' => array( 'rc_reports' => 'reps' ), - 'where' => 'stat.is_complete=1', - 'add_join' => array( - array( - 'from' => array( 'rc_reports_index' => 'rep' ), - 'where' => 'reps.rid=rep.id', - ), - array( - 'from' => array( 'rc_status' => 'stat' ), - 'where' => 'stat.status=rep.status', - ), - ) - ) ); - $this->DB->execute(); - - $total_complete_reports = $this->DB->getTotalRows(); - $this->DB->build( array( 'select' => 'mem.members_display_name as name, COUNT(*) as num_reports', 'from' => array( 'rc_reports_index' => 'rep' ), - 'where' => "stat.is_complete=1", + 'where' => "rep.updated_by > 0", 'group' => 'rep.updated_by', 'order' => 'num_reports DESC', 'limit' => array( 5 ), 'add_join' => array( - array( - 'from' => array( 'rc_reports' => 'reps' ), - 'where' => 'rep.id=reps.rid' - ), - array( - 'from' => array( 'rc_status' => 'stat' ), - 'where' => 'stat.status=rep.status' - ), array( 'from' => array( 'members' => 'mem' ), 'where' => 'mem.member_id=rep.updated_by' @@ -1265,11 +1261,11 @@ class admin_core_report_reports extends ipsCommand // Let's draw our pie chart now //----------------------------------------- - require_once( IPS_KERNEL_PATH . '/classGraph.php' ); + require_once( IPS_KERNEL_PATH . '/classGraph.php' );/*noLibHook*/ $graph = new classGraph(); $graph->options['title'] = $this->lang->words['r_top5']; - $graph->options['width'] = 400; - $graph->options['height'] = 250; + $graph->options['width'] = 500; + $graph->options['height'] = 300; $graph->options['style3D'] = 1; if( count($chart_data) ) @@ -1286,5 +1282,4 @@ class admin_core_report_reports extends ipsCommand $graph->options['charttype'] = 'Pie'; $graph->display(); } - } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/report/xml/index.html b/upload/admin/applications/core/modules_admin/report/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/report/xml/index.html +++ b/upload/admin/applications/core/modules_admin/report/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/report/xml/menu.xml b/upload/admin/applications/core/modules_admin/report/xml/menu.xml index b737c955..48585ad0 100644 --- a/upload/admin/applications/core/modules_admin/report/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/report/xml/menu.xml @@ -6,6 +6,7 @@ Обзор + reports_overview reports do=show_main @@ -18,9 +19,10 @@ Плагины системы жалоб + reports_plugin reports do=plugin - + plugins_manage 0 @@ -30,9 +32,10 @@ Статусы жалоб + reports_ssl reports do=status - + sands_manage 0 diff --git a/upload/admin/applications/core/modules_admin/report/xml/permissions.xml b/upload/admin/applications/core/modules_admin/report/xml/permissions.xml index 29f0a135..858a555c 100644 --- a/upload/admin/applications/core/modules_admin/report/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/report/xml/permissions.xml @@ -2,6 +2,7 @@ Плагины системы жалоб + core_reports plugins_manage @@ -15,6 +16,7 @@ Управление статусами жалоб + core_statsev sands_manage @@ -28,6 +30,7 @@ Статистика системы жалоб + core_rcstats stats_access diff --git a/upload/admin/applications/core/modules_admin/settings/defaultSection.php b/upload/admin/applications/core/modules_admin/settings/defaultSection.php new file mode 100644 index 00000000..d58791ee --- /dev/null +++ b/upload/admin/applications/core/modules_admin/settings/defaultSection.php @@ -0,0 +1,14 @@ + You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/settings.php b/upload/admin/applications/core/modules_admin/settings/settings.php similarity index 88% rename from upload/admin/applications/core/modules_admin/tools/settings.php rename to upload/admin/applications/core/modules_admin/settings/settings.php index e73af8f5..7dda983b 100644 --- a/upload/admin/applications/core/modules_admin/tools/settings.php +++ b/upload/admin/applications/core/modules_admin/settings/settings.php @@ -1,18 +1,18 @@ registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); - $this->html = $this->registry->output->loadTemplate('cp_skin_tools'); + $this->html = $this->registry->output->loadTemplate('cp_skin_settings'); - $this->form_code = $this->html->form_code = 'module=tools&section=settings'; - $this->form_code_js = $this->html->form_code_js = 'module=tools§ion=settings'; + $this->form_code = $this->html->form_code = 'module=settings&section=settings&'; + $this->form_code_js = $this->html->form_code_js = 'module=settings§ion=settings&'; $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_manage' ); + /* What to do? */ switch( $this->request['do'] ) { case 'settinggroup_resync': @@ -192,15 +200,14 @@ class admin_core_tools_settings extends ipsCommand case 'settingsExportApps': $messages = $this->exportAllApps(); - $this->registry->output->global_message = implode( "
", $messages ); - + $this->registry->output->setMessage( implode( "
", $messages ), 1 ); $this->_settingsOverview(); break; case 'settingsImportApps': $messages = $this->importAllApps(); - $this->registry->output->global_message = implode( "
", $messages ); + $this->registry->output->setMessage( implode( "
", $messages ), 1 ); $this->_settingsOverview(); break; default: @@ -220,7 +227,7 @@ class admin_core_tools_settings extends ipsCommand /** * Reorder the settings * - * @return void + * @return @e void */ public function reorder() { @@ -264,9 +271,9 @@ class admin_core_tools_settings extends ipsCommand /** * Setting group export * - * @return void + * @return @e void */ - private function _exportSettingsGroup() + protected function _exportSettingsGroup() { //----------------------------------------- // INIT @@ -290,7 +297,7 @@ class admin_core_tools_settings extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -361,7 +368,7 @@ class admin_core_tools_settings extends ipsCommand /** * Find setting group (don't rely on IDs) * - * @return void + * @return @e void */ public function _findSettingGroup() { @@ -391,7 +398,7 @@ class admin_core_tools_settings extends ipsCommand * @param boolean In development mode? * @param boolean Return (ignore the var name) * @param array Array of known setting values - * @return void + * @return @e void */ public function importAllSettings( $in_dev=0, $no_return=0, $known=array() ) { @@ -440,14 +447,14 @@ class admin_core_tools_settings extends ipsCommand return; } - if ( ! file_exists( $this->request['file_location'] ) ) + if ( ! is_file( $this->request['file_location'] ) ) { $this->registry->output->global_message = sprintf( $this->lang->words['s_noopen'], $this->request['file_location'] ); $this->_settingsOverview(); return; } - if ( preg_match( "#\.gz$#", $this->request['file_location'] ) ) + if ( preg_match( '#\.gz$#', $this->request['file_location'] ) ) { if ( $FH = @gzopen( $this->request['file_location'], 'rb' ) ) { @@ -475,7 +482,7 @@ class admin_core_tools_settings extends ipsCommand //----------------------------------------- $tmp_name = $_FILES['FILE_UPLOAD']['name']; - $tmp_name = preg_replace( "#\.gz$#", "", $tmp_name ); + $tmp_name = preg_replace( '#\.gz$#', "", $tmp_name ); $content = ipsRegistry::getClass('adminFunctions')->importXml( $tmp_name ); } @@ -505,9 +512,9 @@ class admin_core_tools_settings extends ipsCommand /** * Delete a setting group * - * @return void + * @return @e void */ - private function _deleteSettingGroup() + protected function _deleteSettingGroup() { if ( $this->request['id'] ) { @@ -536,9 +543,9 @@ class admin_core_tools_settings extends ipsCommand /** * Resynchronize settings in a group * - * @return void + * @return @e void */ - private function _resynchSettingGroup() + protected function _resynchSettingGroup() { //----------------------------------------- // INIT @@ -569,9 +576,9 @@ class admin_core_tools_settings extends ipsCommand * Does the resync * * @param integer Group id - * @return void + * @return @e void */ - private function _resynchGroup( $id ) + protected function _resynchGroup( $id ) { if ( $id ) { @@ -587,9 +594,9 @@ class admin_core_tools_settings extends ipsCommand * Form to add/edit a setting group * * @param string [add|edit] - * @return void + * @return @e void */ - private function _settingGroupForm( $type='add' ) + protected function _settingGroupForm( $type='add' ) { //----------------------------------------- // INIT @@ -657,9 +664,9 @@ class admin_core_tools_settings extends ipsCommand * Save a setting group * * @param string [add|edit] - * @return void + * @return @e void */ - private function _settingGroupSave($type='add') + protected function _settingGroupSave($type='add') { //----------------------------------------- // INIT @@ -722,9 +729,9 @@ class admin_core_tools_settings extends ipsCommand * Form to add/edit a setting * * @param string [add|edit] - * @return void + * @return @e void */ - private function _settingForm( $type='add' ) + protected function _settingForm( $type='add' ) { if ( $type == 'add' ) { @@ -825,7 +832,7 @@ class admin_core_tools_settings extends ipsCommand * View all settings (form) in a group * This is public so that portal can access it * - * @return void + * @return @e void */ public function _viewSettings() { @@ -925,7 +932,7 @@ class admin_core_tools_settings extends ipsCommand while( $r = $this->DB->fetch() ) { $r['conf_start_group'] = ""; - $r['conf_description'] .= '
' . $this->lang->words['conf_desc_search'] . "" . $r['conf_title_title'] . ""; + $r['conf_description'] .= '
' . $this->lang->words['conf_desc_search'] . "" . $r['conf_title_title'] . ""; $conf_entry[ $r['conf_id'] ] = $r; } @@ -993,7 +1000,12 @@ class admin_core_tools_settings extends ipsCommand } else if( $tab ) { - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab={$tab}", ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab={$tab}", $this->setting_groups[$conf_group]['conf_title_tab'] ? $this->setting_groups[$conf_group]['conf_title_tab'] : ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=setting_view&conf_group={$conf_group}", $title ); + } + else + { + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab=System", $this->setting_groups[$conf_group]['conf_title_tab'] ? $this->setting_groups[$conf_group]['conf_title_tab'] : ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=setting_view&conf_group={$conf_group}", $title ); } @@ -1006,13 +1018,20 @@ class admin_core_tools_settings extends ipsCommand * Process an individual setting for display * * @param array Setting record - * @return void + * @return @e void */ - private function _processSettingEntry($r) + protected function _processSettingEntry($r) { - $tempSkinUrl = $this->settings['skin_app_url']; - $this->settings[ 'skin_app_url'] = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/applications/core/skin_cp/' ; - + /* Init editor class */ + if ( !is_object($this->editor) ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + } + + /* Init vars */ + $tempSkinUrl = $this->settings['skin_app_url']; + $this->settings['skin_app_url'] = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/applications/core/skin_cp/' ; $form_element = ""; $form_type = 'normal'; $dropdown = array(); @@ -1033,7 +1052,7 @@ class admin_core_tools_settings extends ipsCommand if ( $r['conf_value'] != "" and ( $r['conf_value'] != $r['conf_default'] ) ) { - $revert_button = "form_code}&do=setting_revert&id={$r['conf_id']}&conf_group={$r['conf_group']}&search=" . $this->request['search'] . "' title='{$this->lang->words['s_revertback']}'>X"; + $revert_button = "
  • form_code}&do=setting_revert&id={$r['conf_id']}&conf_group={$r['conf_group']}&search=" . $this->request['search'] . "' title='{$this->lang->words['s_revertback']}'>{$this->lang->words['revert']}
  • "; } //----------------------------------------------- @@ -1042,11 +1061,13 @@ class admin_core_tools_settings extends ipsCommand if ( $r['conf_evalphp'] ) { - $show = 1; + + $r['conf_evalphp'] = str_replace( '\', '\\', $r['conf_evalphp'] ); + $show = 1; eval( $r['conf_evalphp'] ); } - + if( ! $show && ! IN_DEV ) { return ''; @@ -1059,26 +1080,13 @@ class admin_core_tools_settings extends ipsCommand break; case 'textarea': - $form_element = $this->registry->output->formTextarea( $key, $value, 45 ); + $form_element = $this->registry->output->formTextarea( $key, str_replace( "&#092;", "\", IPSText::textToForm($value) ), 45 ); break; case 'editor': - IPSText::getTextClass('bbcode')->parse_html = 1; - IPSText::getTextClass('bbcode')->parse_nl2br = 1; - IPSText::getTextClass('bbcode')->parse_smilies = 1; - IPSText::getTextClass('bbcode')->parse_bbcode = 1; - IPSText::getTextClass('bbcode')->parsing_section = 'global'; - - if ( IPSText::getTextClass('editor')->method == 'rte' ) - { - $value = IPSText::getTextClass('bbcode')->convertForRTE( IPSText::getTextClass('bbcode')->preDbParse( $value ) ); - } - else - { - $value = IPSText::getTextClass('bbcode')->preEditParse( $value ); - } - - $form_element = IPSText::getTextClass('editor')->showEditor( $value, $key ); + $this->editor->setContent( $value ); + + $form_element = $this->editor->show( $key, array( 'minimize' => 1 ) ); $form_type = 'rte'; break; @@ -1102,7 +1110,7 @@ class admin_core_tools_settings extends ipsCommand // (Not a building with books) //----------------------------------------- - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/class_forums.php', 'class_forums', 'forums' ); + require_once( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/class_forums.php' );/*noLibHook*/ $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/admin_forum_functions.php', 'admin_forum_functions', 'forums' ); $aff = new $classToLoad( $this->registry ); @@ -1159,10 +1167,10 @@ class admin_core_tools_settings extends ipsCommand break; } - - $delete = " form_code}&do=setting_delete&id={$r['conf_id']}\");' title='key: {$r['conf_key']}'>{$this->lang->words["; - $edit = "form_code}&do=setting_showedit&id={$r['conf_id']}' title='id: {$r['conf_id']}'>{$this->lang->words["; - + + $delete = "
  • form_code}&do=setting_delete&id={$r['conf_id']}\");' title='key: {$r['conf_key']}'>{$this->lang->words['delete']}
  • "; + $edit = "
  • form_code}&do=setting_showedit&id={$r['conf_id']}' title='id: {$r['conf_id']}'>{$this->lang->words['edit']}
  • "; + if ( $r['conf_protected'] and ! IN_DEV ) { $delete = ""; @@ -1194,7 +1202,7 @@ class admin_core_tools_settings extends ipsCommand } } - $r['conf_title'] = preg_replace( "/(".$this->request['search'].")/i", "\\1", $r['conf_title'] ); + $r['conf_title'] = preg_replace( "/(". str_replace( '/', '\\/', $this->request['search'] ) .")/i", "\\1", $r['conf_title'] ); if( count($matches[0]) ) { @@ -1234,7 +1242,7 @@ class admin_core_tools_settings extends ipsCommand } } - $r['conf_description'] = preg_replace( "/(".$this->request['search'].")/i", "\\1", $r['conf_description'] ); + $r['conf_description'] = preg_replace( "/(". str_replace( '/', '\\/', $this->request['search'] ) .")/i", "\\1", $r['conf_description'] ); if( count($_replacements) ) { @@ -1247,7 +1255,7 @@ class admin_core_tools_settings extends ipsCommand $html .= $start . $this->html->settings_view_row( $r, $edit, $delete, $form_element, $revert_button, $form_type ); - $this->key_array[] = preg_replace( "/\[\]$/", "", $key ); + $this->key_array[] = preg_replace( '/\[\]$/', "", $key ); $this->settings[ 'skin_app_url'] = $tempSkinUrl ; @@ -1258,9 +1266,9 @@ class admin_core_tools_settings extends ipsCommand * View setting groups * * @param string Application to default to - * @return void + * @return @e void */ - private function _settingsOverview( $start_app='' ) + protected function _settingsOverview( $start_app='' ) { $content = ""; $title = ""; @@ -1286,27 +1294,21 @@ class admin_core_tools_settings extends ipsCommand $settings[ $r['conf_title_tab'] ][] = $r; } - $this->registry->output->html .= $this->html->settings_titles_wrapper( $this->html->settings_titles_top_searchbox(), $settings, $start_app ); + $this->registry->output->html .= $this->html->settings_titles_wrapper( $settings, $start_app ); } /** * Update setting values/ordering * * @param boolean Return afterwards? - * @return void + * @return @e void */ - private function _updateSettings( $donothing="" ) + protected function _updateSettings( $donothing="" ) { - //----------------------------------------- - // INIT - //----------------------------------------- - + /* Init vars */ $bounceback = str_replace( '&', '&', $this->request['bounceback'] ); - //----------------------------------------- - // Check - //----------------------------------------- - + /* Check for something to save... */ if ( ! $this->request['id'] and ! $this->request['search'] AND !$this->request['settings_save'] ) { $this->registry->output->global_message = $this->lang->words['s_noid']; @@ -1314,10 +1316,7 @@ class admin_core_tools_settings extends ipsCommand return; } - //-------------------------------------------- - // check... - //-------------------------------------------- - + /* ...and check for fields */ $fields = explode( ",", trim($this->request['settings_save']) ); if ( ! count($fields ) ) @@ -1327,6 +1326,13 @@ class admin_core_tools_settings extends ipsCommand return; } + /* Init editor class */ + if ( !is_object($this->editor) ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + } + //-------------------------------------------- // Get info from DB //-------------------------------------------- @@ -1360,7 +1366,9 @@ class admin_core_tools_settings extends ipsCommand if ( $data['conf_evalphp'] ) { - $save = 1; + $r['conf_evalphp'] = str_replace( '\', '\\', $r['conf_evalphp'] ); + $save = 1; + eval( $data['conf_evalphp'] ); /* Was value set? */ @@ -1381,19 +1389,19 @@ class admin_core_tools_settings extends ipsCommand //$_POST[ $key ] = IPSText::getTextClass('bbcode')->preDbParse( IPSText::getTextClass('editor')->processRawPost( $key ) ); - if( trim($_POST[ $key ]) == '
    ' OR trim($_POST[ $key ]) == '
    ' ) + if( trim($value) == '
    ' OR trim($value) == '
    ' ) { - $_POST[ $key ] = ''; + $value = ''; } else { - $_POST[ $key ] = IPSText::getTextClass('editor')->processRawPost( $key ); + $value = $this->editor->process( $value ); } } - $_POST[ $key ] = str_replace( "\r", "", $_POST[ $key ] ); + $value = str_replace( "\r", "", $value ); - if ( $_POST[ $key ] != $data['conf_default'] ) + if ( $value != $data['conf_default'] ) { $this->DB->update( 'core_sys_conf_settings', array( 'conf_value' => $value ), 'conf_id=' . $data['conf_id'] ); } @@ -1402,7 +1410,7 @@ class admin_core_tools_settings extends ipsCommand $this->DB->update( 'core_sys_conf_settings', array( 'conf_value' => '' ), 'conf_id=' . $data['conf_id'] ); } } - + $this->request['conf_group'] = $this->request['id']; $this->registry->output->global_message = $this->lang->words['s_updated']; @@ -1415,7 +1423,7 @@ class admin_core_tools_settings extends ipsCommand if ( $bounceback ) { - $this->registry->output->silentRedirect( $bounceback ); + $this->registry->output->silentRedirectWithMessage( $bounceback ); } //----------------------------------------- @@ -1432,9 +1440,9 @@ class admin_core_tools_settings extends ipsCommand * Save the settings form * * @param string [add|edit] - * @return void + * @return @e void */ - private function _settingSave($type='add') + protected function _settingSave($type='add') { if ( $type == 'edit' ) { @@ -1485,7 +1493,7 @@ class admin_core_tools_settings extends ipsCommand // Is the key already in use? //----------------------------------------- - if( $this->settings[ $array['conf_key'] ] ) + if ( $this->settings[ $array['conf_key'] ] ) { $this->registry->output->global_message = $this->lang->words['s_keyinuse_already']; $this->_settingForm(); @@ -1523,9 +1531,9 @@ class admin_core_tools_settings extends ipsCommand /** * Revert a setting to the default value * - * @return void + * @return @e void */ - private function _revertSettings() + protected function _revertSettings() { $this->request[ 'id'] = intval($this->request['id'] ); @@ -1554,9 +1562,9 @@ class admin_core_tools_settings extends ipsCommand /** * Delete a setting * - * @return void + * @return @e void */ - private function _deleteSettings() + protected function _deleteSettings() { if ( ! $this->request['id'] ) { @@ -1593,7 +1601,7 @@ class admin_core_tools_settings extends ipsCommand /** * Rebuild settings cache * - * @return void + * @return @e void */ public function settingsRebuildCache() { @@ -1621,9 +1629,9 @@ class admin_core_tools_settings extends ipsCommand * Grab all setting groups and store in an internal array * * @param boolean Pull all settings, not just visible ones - * @return void + * @return @e void */ - private function _settingsGetGroups( $ignoreInDev=false ) + protected function _settingsGetGroups( $ignoreInDev=false ) { $this->setting_groups = array(); @@ -1648,9 +1656,9 @@ class admin_core_tools_settings extends ipsCommand /** * Make sure all titles have keywords set * - * @return void + * @return @e void */ - private function _settingsTitlesCheck() + protected function _settingsTitlesCheck() { //----------------------------------------- // Get 'em @@ -1663,7 +1671,7 @@ class admin_core_tools_settings extends ipsCommand { if ( ! $row['conf_title_keyword'] ) { - $new_keyword = mb_strtolower( preg_replace( "#[^\d\w]#", "", $row['conf_title_title'] ) ); + $new_keyword = mb_strtolower( preg_replace( '#[^\d\w]#', "", $row['conf_title_title'] ) ); $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_keyword' => $new_keyword ), 'conf_title_id='.$row['conf_title_id'] ); } } @@ -1685,7 +1693,7 @@ class admin_core_tools_settings extends ipsCommand { $file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml'; - if ( file_exists( $file ) ) + if ( is_file( $file ) ) { $contents = file_get_contents( $file ); @@ -1714,7 +1722,7 @@ class admin_core_tools_settings extends ipsCommand * @param array Array of any known settings and their values * @return array array( 'insertedCount' => x, 'updatedCount' => x, 'updatedKeys' => array(..), 'insertedKeys' => array() ) */ - private function _importXML( $content, $app='core', $knownSettings=array() ) + protected function _importXML( $content, $app='core', $knownSettings=array() ) { //----------------------------------------- // INIT @@ -1752,7 +1760,7 @@ class admin_core_tools_settings extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->loadXML( $content ); @@ -1954,28 +1962,28 @@ class admin_core_tools_settings extends ipsCommand { @unlink( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ); - if ( ! file_exists( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) + if ( ! is_dir( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) { - $errors[] = "Ошибка: " . IPSLib::getAppDir( $app_dir ) . "/xml/ не существует"; + $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . "/xml/ does not exist"; continue; } else if ( ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) { if ( ! @chmod( IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml', 0755 ) ) ) { - $errors[] = "Ошибка: " . IPSLib::getAppDir( $app_dir ) . "/xml/ нет прав на запись"; + $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . "/xml/ is not writeable"; continue; } } - else if ( file_exists( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) AND ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) ) + else if ( is_file( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) AND ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) ) { - $errors[] = "Ошибка: " . IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . "_settings.xml нет прав на запись"; + $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . "_settings.xml is not writeable"; continue; } $this->_exportXML( $app_dir ); - $messages[] = "Настройки приложения " . $app_data['app_title'] . " экспортированы в директорию приложения"; + $messages[] = $app_data['app_title'] . " Settings written into the application's XML directory"; /* In dev time stamp? */ if ( IN_DEV ) @@ -1996,7 +2004,7 @@ class admin_core_tools_settings extends ipsCommand * @param string Application directory * @return boolean */ - private function _exportXML( $app_dir='core' ) + protected function _exportXML( $app_dir='core' ) { //----------------------------------------- // Get setting groups @@ -2008,7 +2016,7 @@ class admin_core_tools_settings extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); @@ -2086,14 +2094,14 @@ class admin_core_tools_settings extends ipsCommand /** * Load and parse settings delete list (IN_DEV) * - * @return void + * @return @e void */ - private function _loadDeleteList() + protected function _loadDeleteList() { if ( IN_DEV ) { /* Check for group settings */ - if ( file_exists( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ) ) + if ( is_file( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ) ) { $notTheseGroups = file( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ); @@ -2123,7 +2131,7 @@ class admin_core_tools_settings extends ipsCommand } /* Check for single settings */ - if ( file_exists( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ) ) + if ( is_file( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ) ) { $notTheseSettings = file( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ); diff --git a/upload/admin/applications/core/modules_admin/settings/xml/index.html b/upload/admin/applications/core/modules_admin/settings/xml/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/modules_admin/settings/xml/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/settings/xml/menu.xml b/upload/admin/applications/core/modules_admin/settings/xml/menu.xml new file mode 100644 index 00000000..9018c226 --- /dev/null +++ b/upload/admin/applications/core/modules_admin/settings/xml/menu.xml @@ -0,0 +1,18 @@ + + + + + System Settings + + + System Settings + settings + settings + do=settingsview + settings_manage + 0 + + + + + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml b/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml new file mode 100644 index 00000000..3ace6faf --- /dev/null +++ b/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml @@ -0,0 +1,25 @@ + + + + Manage Settings + core_settings + + + settings_manage + Can edit/add settings and setting groups? + + + settings_delete + Can delete settings and setting groups? + + + performance_toggle + Can toggle performance mode? + + + licensekey_manage + Can manage license key? + + + + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/sql/defaultSection.php b/upload/admin/applications/core/modules_admin/sql/defaultSection.php index b3beb0f4..0d609686 100644 --- a/upload/admin/applications/core/modules_admin/sql/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/sql/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default sql section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'sql' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'toolbox'; diff --git a/upload/admin/applications/core/modules_admin/sql/index.html b/upload/admin/applications/core/modules_admin/sql/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/sql/index.html +++ b/upload/admin/applications/core/modules_admin/sql/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/sql/mysql.php b/upload/admin/applications/core/modules_admin/sql/mysql.php index 589aad03..7eb45ddf 100644 --- a/upload/admin/applications/core/modules_admin/sql/mysql.php +++ b/upload/admin/applications/core/modules_admin/sql/mysql.php @@ -3,18 +3,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * mySQL Admin
    - * Last Updated: $Date: 2010-09-27 18:18:35 -0400 (Mon, 27 Sep 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6917 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -31,7 +31,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * SQL version * - * @access public * @var string */ public $sql_version = ""; @@ -39,7 +38,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * True SQL version * - * @access public * @var string */ public $true_version = ""; @@ -47,7 +45,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * GZIP Header contents for backup * - * @access public * @var string */ public $str_gzip_header = "\x1f\x8b\x08\x00\x00\x00\x00\x00"; @@ -55,7 +52,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Flag that's set if there's problems * - * @access public * @var boolean */ public $db_has_issues = false; @@ -63,7 +59,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * HTML object * - * @access public * @var object */ public $html; @@ -71,7 +66,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Form code * - * @access public * @var string */ public $form_code = ""; @@ -79,7 +73,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Form code js * - * @access public * @var string */ public $form_code_js = ""; @@ -87,15 +80,14 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { /* Load HTML and Lang */ $this->html = $this->registry->output->loadTemplate( 'cp_skin_sql' ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_sql' ) ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_sql' ), 'core' ); /* URLs */ $this->form_code = $this->html->form_code = 'module=sql&section=toolbox'; @@ -166,8 +158,7 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Run selected tool on selected tables * - * @access public - * @return void + * @return @e void */ public function sqlRunTool() { @@ -240,8 +231,7 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Safe backup splash screen * - * @access public - * @return void + * @return @e void */ public function sqlSafeBackupSplash() { @@ -253,9 +243,8 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Runs the database backup * - * @access public * @param string $tbl_name Specify a table to backup, leave blank to backup all - * @return void + * @return @e void */ public function sqlDoSafeBackup($tbl_name="") { @@ -299,13 +288,13 @@ class admin_core_sql_toolbox_module extends ipsCommand { { @ob_start(); @ob_implicit_flush(0); - header("Content-Type: text/x-delimtext; name=\"{$filename}.sql.gz\""); - header("Content-disposition: attachment; filename={$filename}.sql.gz"); + header( "Content-Type: text/x-delimtext; name=\"{$filename}.sql.gz\"; charset=" . IPS_DOC_CHAR_SET ); + header( "Content-disposition: attachment; filename={$filename}.sql.gz" ); } else { - header("Content-Type: text/x-delimtext; name=\"{$filename}.sql\""); - header("Content-disposition: attachment; filename={$filename}.sql"); + header( "Content-Type: text/x-delimtext; name=\"{$filename}.sql\"; charset=" . IPS_DOC_CHAR_SET ); + header( "Content-disposition: attachment; filename={$filename}.sql" ); } /* Get tables to work on */ @@ -344,9 +333,7 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Displays the form for backing up an sql database * - * @access public - * @return void - * @author Josh + * @return @e void */ public function sqlBackupForm() { @@ -370,9 +357,8 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Run a mysql query and display results * - * @access public * @param string $sql The query to run - * @return void + * @return @e void */ public function sqlViewResults( $sql ) { @@ -390,7 +376,7 @@ class admin_core_sql_toolbox_module extends ipsCommand { ); /* Figure out the title */ - if ( isset( $map[ $this->request['do'] ] ) AND $map[ $this->request['do'] ] != "" ) + if ( !empty( $map[ $this->request['do'] ] ) ) { $tbl_title = $map[ $this->request['do'] ]; $man_query = 0; @@ -559,7 +545,14 @@ class admin_core_sql_toolbox_module extends ipsCommand { } } - $row[] = nl2br( htmlspecialchars( wordwrap( $r[ $fields[$i]->name ] , 50, "\n", 1 ) ) ); + if( ! $this->request['notruncate'] OR strlen($r[ $fields[$i]->name ]) < 201 ) + { + $row[] = nl2br( htmlspecialchars( wordwrap( $r[ $fields[$i]->name ] , 50, "\n", 1 ) ) ); + } + else + { + $row[] = htmlspecialchars( $r[ $fields[$i]->name ] ); + } } /* Add to output array */ @@ -591,21 +584,13 @@ class admin_core_sql_toolbox_module extends ipsCommand { * SHOW ALL TABLES AND STUFF! * 5 hours ago this seemed like a damned good idea. * - * @access public - * @return void + * @return @e void */ public function sqlListIndex() { /* INIT */ $form_array = array(); - $extra = ""; - - /* Check version */ - if ( $this->sql_version < 3232 ) - { - $extra = $this->lang->words['my_tooold']; - } - + /* Get a list of tables */ $this->DB->query( "SHOW TABLE STATUS FROM `{$this->settings['sql_database']}`" ); @@ -622,22 +607,20 @@ class admin_core_sql_toolbox_module extends ipsCommand { /* Add to output array */ $rows[] = array( - 'table' => $r['Name'], - 'rows' => $r['Rows'], - 'query' => urlencode( "SELECT * FROM {$r['Name']}" ) + 'table' => $r['Name'], + 'rows' => $r['Rows'], + 'query' => urlencode( "SELECT * FROM {$r['Name']}" ) ); } /* Output */ - $this->registry->output->html .= $this->html->sqlListTables( $rows ); + $this->registry->output->html .= $this->html->sqlListTables( $rows ); } /** * View table schematic * - * @access public - * @return void - * @author Josh + * @return @e void */ public function sqlViewTable() { @@ -664,7 +647,7 @@ class admin_core_sql_toolbox_module extends ipsCommand { } /* Add Nav */ - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=runsql&query=" . urlencode( "SELECT * FROM $table" ), $table ); + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=viewschematic&table=" . $table, $table ); /* Output */ $this->registry->output->html .= $this->html->sqlViewTable( $table, $rows, $indexes ); @@ -673,12 +656,10 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Internal handler to return content from table * - * @access public * @param string Table * @param boolean Whether to show create table or not * @param boolean Whether to skip non-essential tables - * @return void - * @author Josh + * @return @e void */ public function sqlGetTableSQL($tbl, $create_tbl, $skip=0) { @@ -771,7 +752,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Strip tick marks from field names * - * @access public * @param string $data String to strip tick marks from * @return string */ @@ -783,7 +763,6 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Add slashes to single quotes to stop sql breaks * - * @access public * @param string $data String to add slashes too * @return string */ @@ -800,10 +779,9 @@ class admin_core_sql_toolbox_module extends ipsCommand { /** * Gzip * - * @access public * @param string $val * @return string - **/ + */ public function sqlGzipFourChars( $val ) { for ($i = 0; $i < 4; $i ++) diff --git a/upload/admin/applications/core/modules_admin/sql/toolbox.php b/upload/admin/applications/core/modules_admin/sql/toolbox.php index d73d7dbd..59bc1928 100644 --- a/upload/admin/applications/core/modules_admin/sql/toolbox.php +++ b/upload/admin/applications/core/modules_admin/sql/toolbox.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * SQL Admin
    - * Last Updated: $Date: 2010-10-19 08:45:58 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-03-11 06:59:39 -0500 (Fri, 11 Mar 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6994 $ + * @link http://hatynka.in + * @version $Rev: 8031 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -32,7 +32,7 @@ class admin_core_sql_toolbox extends ipsCommand public function doExecute( ipsRegistry $registry ) { /* Require the right driver file */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/sql/' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '.php', 'admin_core_sql_toolbox_module' ); + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/sql/' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '.php', 'admin_core_sql_toolbox_module' );/*noLibHook*/ $dbdriver = new $classToLoad(); $dbdriver->makeRegistryShortcuts( $registry ); $dbdriver->doExecute( $registry ); diff --git a/upload/admin/applications/core/modules_admin/sql/xml/index.html b/upload/admin/applications/core/modules_admin/sql/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/sql/xml/index.html +++ b/upload/admin/applications/core/modules_admin/sql/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/sql/xml/menu.xml b/upload/admin/applications/core/modules_admin/sql/xml/menu.xml index 8256e7db..0d69889b 100644 --- a/upload/admin/applications/core/modules_admin/sql/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/sql/xml/menu.xml @@ -6,6 +6,7 @@ Инструменты для управления SQL + sql_toolbox toolbox do=overview @@ -18,6 +19,7 @@ Резервная копия базы данных + sql_backup toolbox do=backup @@ -30,6 +32,7 @@ Информация о состоянии сервера + sql_ri toolbox do=runtime @@ -42,6 +45,7 @@ Значения системных настроек + sql_vars toolbox do=system @@ -54,6 +58,7 @@ Выполняющиеся процессы + sql_processes toolbox do=processes diff --git a/upload/admin/applications/core/modules_admin/system/charts.php b/upload/admin/applications/core/modules_admin/system/charts.php new file mode 100644 index 00000000..34bb24a2 --- /dev/null +++ b/upload/admin/applications/core/modules_admin/system/charts.php @@ -0,0 +1,139 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class admin_core_system_charts + * @brief Admin dashboard chart(s) + * + */ +class admin_core_system_charts extends ipsCommand +{ + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Language */ + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_system' ), 'core' ); + + switch( $this->request['do'] ) + { + case 'reg': + default: + $this->showRegistrationChart(); + break; + } + } + + /** + * Show chart of registrations over x days + * + * @return @e void [Outputs to screen] + */ + public function showRegistrationChart() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $days = intval( $this->request['days'] ); + + if( !$days ) + { + $days = 7; + } + + $cutoff = time() - ( $days * 86400 ); + $_check = time(); + $registrations = array(); + $labels = array(); + $_ttl = 0; + + while( $_check > $cutoff ) + { + $_day = strftime( '%b %d', $_check ); + $_key = strftime( '%Y-%m-%d', $_check ); + + $labels[ $_key ] = $_day; + $registrations[ $_key ] = 0; + + $_check -= 86400; + } + + //----------------------------------------- + // Get the data + //----------------------------------------- + + $this->DB->build( array( 'select' => 'member_id, joined', 'from' => 'members', 'where' => 'joined > ' . $cutoff ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + //$_day = strftime( '%b %d', $r['joined'] ); + $_key = strftime( '%Y-%m-%d', $r['joined'] ); + + if( isset($registrations[ $_key ]) ) + { + $registrations[ $_key ] += 1; + $_ttl++; + } + } + + ksort( $labels ); + ksort( $registrations ); + + //----------------------------------------- + // Output chart + //----------------------------------------- + + require_once( IPS_KERNEL_PATH . '/classGraph.php' );/*noLibHook*/ + $graph = new classGraph(); + $graph->options['title'] = ''; + $graph->options['font'] = DOC_IPS_ROOT_PATH . '/public/style_captcha/captcha_fonts/times.ttf'; + $graph->options['width'] = 1024; + $graph->options['height'] = 400; + $graph->options['style3D'] = 1; + $graph->options['showlegend'] = 0; + //$graph->options['xaxisskip'] = 5; + $graph->options['showgridlinesx'] = 0; + + if( $_ttl ) + { + //ksort($labels); + //ksort($registrations); + + $graph->addLabels( array_values($labels) ); + $graph->addSeries( 'test', array_values($registrations) ); + } + else + { + $graph->options['title'] = sprintf( $this->lang->words['no_reg_x_days'], $days ); + $graph->addLabels( array( 0 ) ); + $graph->addSeries( 'test', array( 0 ) ); + } + + $graph->options['charttype'] = 'Line'; + $graph->display(); + exit; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/system/defaultSection.php b/upload/admin/applications/core/modules_admin/system/defaultSection.php index c80d2948..786164a4 100644 --- a/upload/admin/applications/core/modules_admin/system/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/system/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default system section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'system' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'taskmanager'; diff --git a/upload/admin/applications/core/modules_admin/system/index.html b/upload/admin/applications/core/modules_admin/system/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/system/index.html +++ b/upload/admin/applications/core/modules_admin/system/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/system/loginlog.php b/upload/admin/applications/core/modules_admin/system/loginlog.php index 90be1773..843c716d 100644 --- a/upload/admin/applications/core/modules_admin/system/loginlog.php +++ b/upload/admin/applications/core/modules_admin/system/loginlog.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Admin Login Logs
    - * Last Updated: $LastChangedDate: 2010-10-08 08:06:02 -0400 (Fri, 08 Oct 2010) $
    + * Last Updated: $LastChangedDate: 2011-09-01 08:16:37 -0400 (Thu, 01 Sep 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6955 $ + * @link http://hatynka.in + * @version $Rev: 9439 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -27,9 +27,8 @@ class admin_core_system_loginlog extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -72,8 +71,7 @@ class admin_core_system_loginlog extends ipsCommand /** * View Details of a Log in Attempt * - * @access public - * @return void + * @return @e void */ public function loginLogDetails() { @@ -102,7 +100,6 @@ class admin_core_system_loginlog extends ipsCommand $log['_admin_time'] = $this->registry->class_localization->getDate( $log['admin_time'], 'LONG' ); $log['_admin_post_details'] = unserialize( $log['admin_post_details'] ); - $log['_admin_img'] = $log['admin_success'] ? 'aff_tick.png' : 'aff_cross.png'; //----------------------------------------- // Show... @@ -115,8 +112,7 @@ class admin_core_system_loginlog extends ipsCommand /** * View admin login logs * - * @access public - * @return void + * @return @e void */ public function loginLogsView() { @@ -150,7 +146,6 @@ class admin_core_system_loginlog extends ipsCommand while( $row = $this->DB->fetch() ) { $row['_admin_time'] = $this->registry->class_localization->getDate( $row['admin_time'], 'ACP' ); - $row['_admin_img'] = $row['admin_success'] ? 'aff_tick.png' : 'aff_cross.png'; $logins .= $this->html->acp_last_logins_row( $row ); } diff --git a/upload/admin/applications/core/modules_admin/system/security.php b/upload/admin/applications/core/modules_admin/system/security.php index 52d39f23..7f23d1b8 100644 --- a/upload/admin/applications/core/modules_admin/system/security.php +++ b/upload/admin/applications/core/modules_admin/system/security.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Security center tools
    - * Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
    + * Last Updated: $Date: 2011-06-22 11:54:21 -0400 (Wed, 22 Jun 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 2.2 IIRC - * @version $Revision: 6990 $ + * @version $Revision: 9077 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -30,13 +30,13 @@ class admin_core_system_security extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -105,7 +105,7 @@ class admin_core_system_security extends ipsCommand /** * Virus checker * - * @return void + * @return @e void */ public function listAdmins() { @@ -184,7 +184,7 @@ class admin_core_system_security extends ipsCommand /** * Virus checker * - * @return void + * @return @e void */ public function virusCheck() { @@ -290,7 +290,7 @@ class admin_core_system_security extends ipsCommand /** * Security Overview Screen * - * @return void + * @return @e void */ public function securityOverview() { @@ -341,7 +341,7 @@ class admin_core_system_security extends ipsCommand /* Get .htaccess settings */ if( strpos( strtolower( PHP_OS ), 'win' ) !== 0 ) { - if ( ! file_exists( IPS_ROOT_PATH . '/.htaccess' ) ) + if ( ! is_file( IPS_ROOT_PATH . '/.htaccess' ) ) { $content['ok'] .= $this->html->security_item_ok( $this->lang->words['s_htaccess'], sprintf( $this->lang->words['s_htaccess_bad'], CP_DIRECTORY ), @@ -359,7 +359,7 @@ class admin_core_system_security extends ipsCommand } /* Other htaccess protection */ - if ( ! file_exists( IPS_CACHE_PATH . 'cache/.htaccess' ) ) + if ( ! is_file( IPS_CACHE_PATH . 'cache/.htaccess' ) ) { $content['ok'] .= $this->html->security_item_ok( $this->lang->words['s_phpcgi'], $this->lang->words['s_phpcgi_bad'], @@ -422,7 +422,7 @@ class admin_core_system_security extends ipsCommand /** * ACP HTACCESS: Step two * - * @return void + * @return @e void * @author Josh */ public function acpHtaccessDo() @@ -456,7 +456,7 @@ class admin_core_system_security extends ipsCommand . "AuthType Basic\n" . "AuthName \"IP.Board CP\"\n" . "AuthUserFile " . IPS_ROOT_PATH . ".htpasswd\n" - . "Require valid-user\n"; + . "Require valid-user\n";/*noLibHook*/ $htaccess_pw = $name . ":" . crypt( $pass, base64_encode( $pass ) ); @@ -483,7 +483,7 @@ class admin_core_system_security extends ipsCommand /** * ACP HTACCESS: Step One * - * @return void + * @return @e void */ public function acpHtaccessForm() { @@ -494,7 +494,7 @@ class admin_core_system_security extends ipsCommand /** * Rename ACP directory * - * @return void + * @return @e void */ public function doAcpRename() { @@ -506,7 +506,7 @@ class admin_core_system_security extends ipsCommand /** * Change conf global * - * @return void + * @return @e void */ public function doConfGlobal() { @@ -535,7 +535,7 @@ class admin_core_system_security extends ipsCommand /** * Add htaccess to non IPB dirs * - * @return void + * @return @e void */ public function doHtaccess() { @@ -543,14 +543,12 @@ class admin_core_system_security extends ipsCommand $name = '.htaccess'; $msg = array(); $dirs = array( DOC_IPS_ROOT_PATH . 'cache/', - DOC_IPS_ROOT_PATH . 'public/style_avatars', - DOC_IPS_ROOT_PATH . 'public/style_captcha', - DOC_IPS_ROOT_PATH . 'public/style_css', - DOC_IPS_ROOT_PATH . 'public/style_emoticons', - DOC_IPS_ROOT_PATH . 'public/style_extra', - DOC_IPS_ROOT_PATH . 'public/style_images', - DOC_IPS_ROOT_PATH . 'public/resources', - DOC_IPS_ROOT_PATH . 'hooks', + DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_captcha', + DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css', + DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons', + DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_extra', + DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_images', + rtrim( IPS_HOOKS_PATH, '/' ), DOC_IPS_ROOT_PATH . 'uploads' ); $towrite = << - * Invision Power Services - * IP.Board v3.1.4 - * Task Manager - * Last Updated: $LastChangedDate: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $ - * - * - * @author $Author: ips_terabyte $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6995 $ + * @file taskmanager.php Task manager + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ + * $LastChangedDate: 2011-08-26 11:38:16 -0400 (Fri, 26 Aug 2011) $ + * @version v3.2.3 + * $Revision: 9420 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -22,20 +16,39 @@ if ( ! defined( 'IN_ACP' ) ) exit(); } +/** + * + * @class admin_core_system_taskmanager + * @brief Task manager + */ class admin_core_system_taskmanager extends ipsCommand { /** - * Skin object + * Skin object shortcut * - * @var object Skin templates - */ - private $html; + * @var $html + */ + public $html; + + /** + * String for the screen url bit + * + * @var $form_code + */ + public $form_code = ''; + + /** + * String for the JS url bit + * + * @var $form_code_js + */ + public $form_code_js = ''; /** - * Main class entry point + * Main function executed automatically by the controller * - * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @param object $registry Registry object + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -138,10 +151,9 @@ class admin_core_system_taskmanager extends ipsCommand } /** - * Perform the task import + * Perform the tasks import * - * @param string Raw XML code - * @return void + * @return @e void */ public function taskImport() { @@ -162,7 +174,7 @@ class admin_core_system_taskmanager extends ipsCommand // Get xml class //----------------------------------------- - require_once( IPS_KERNEL_PATH . 'classXML.php' ); + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->loadXML( $content ); @@ -218,9 +230,9 @@ class admin_core_system_taskmanager extends ipsCommand } /** - * Remove a task log + * Remove logs for a specific task or all * - * @return void + * @return @e void */ public function taskLogsDelete() { @@ -248,7 +260,7 @@ class admin_core_system_taskmanager extends ipsCommand /** * Show task logs * - * @return void + * @return @e void */ public function taskLogsShow() { @@ -295,7 +307,7 @@ class admin_core_system_taskmanager extends ipsCommand /** * Builds the task log overview screen * - * @return void + * @return @e void */ public function taskLogsOverview() { @@ -350,16 +362,15 @@ class admin_core_system_taskmanager extends ipsCommand /** * Delete a task * - * @param string $type Either add or edit - * @return void + * @return @e void */ - public function taskDelete( $type='add' ) + public function taskDelete() { /* INIT */ $task_id = intval( $this->request['task_id'] ); /* Check to see if this is a valid task */ - $task = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_id=$task_id" ) ); + $task = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_id={$task_id}" ) ); if ( $task['task_safemode'] and ! IN_DEV ) { @@ -369,7 +380,7 @@ class admin_core_system_taskmanager extends ipsCommand } /* Delete this task */ - $this->DB->delete( 'task_manager', 'task_id='.$task_id ); + $this->DB->delete( 'task_manager', 'task_id='.$task['task_id'] ); /* Save next date and bounce */ $this->func_taskmanager->saveNextRunStamp(); @@ -381,14 +392,12 @@ class admin_core_system_taskmanager extends ipsCommand /** * Unlock a task * - * @return void + * @return @e void */ public function taskManagerUnlockTask() { - /* INIT */ - $task_id = intval( $this->request['task_id'] ); - - $this->func_taskmanager->unlockTask( $task_id ); + /* Unlock */ + $this->func_taskmanager->unlockTask( intval($this->request['task_id']) ); /* Bounce */ $this->registry->output->global_message = $this->lang->words['t_locknomore']; @@ -399,7 +408,7 @@ class admin_core_system_taskmanager extends ipsCommand /** * Runs the selected task * - * @return void + * @return @e void */ public function taskManagerRunTask() { @@ -449,7 +458,7 @@ class admin_core_system_taskmanager extends ipsCommand $this->func_taskmanager->saveNextRunStamp(); /* Run the task file */ - if( file_exists( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'] ) ) + if( is_file( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'] ) ) { $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'], 'task_item', $this_task['task_application'] ); $myobj = new $classToLoad( $this->registry, $this->func_taskmanager, $this_task ); @@ -468,14 +477,13 @@ class admin_core_system_taskmanager extends ipsCommand $this->taskManagerOverview(); return; } - - } + } /** * Save the add/edit task form * - * @param string $type Either add or edit - * @return void + * @param string $type Either add or edit data + * @return @e void */ public function taskManagerSave( $type='add' ) { @@ -577,8 +585,8 @@ class admin_core_system_taskmanager extends ipsCommand /** * Builds the add/edit task form * - * @param string $type Either add or edit - * @return void + * @param string $type Either add or edit + * @return @e void */ public function taskManagerForm( $type='add' ) { @@ -651,26 +659,26 @@ class admin_core_system_taskmanager extends ipsCommand $dropdown['_mday'][] = array( $i, $i ); } - $dropdown['_wday'][] = array( '0', $this->lang->words['t_sunday'] ); - $dropdown['_wday'][] = array( '1', $this->lang->words['t_monday'] ); - $dropdown['_wday'][] = array( '2', $this->lang->words['t_tuesday'] ); - $dropdown['_wday'][] = array( '3', $this->lang->words['t_wednesday'] ); - $dropdown['_wday'][] = array( '4', $this->lang->words['t_thursday'] ); - $dropdown['_wday'][] = array( '5', $this->lang->words['t_friday'] ); - $dropdown['_wday'][] = array( '6', $this->lang->words['t_saturday'] ); + $dropdown['_wday'][] = array( '0', $this->lang->words['t_sunday'] ); + $dropdown['_wday'][] = array( '1', $this->lang->words['t_monday'] ); + $dropdown['_wday'][] = array( '2', $this->lang->words['t_tuesday'] ); + $dropdown['_wday'][] = array( '3', $this->lang->words['t_wednesday'] ); + $dropdown['_wday'][] = array( '4', $this->lang->words['t_thursday'] ); + $dropdown['_wday'][] = array( '5', $this->lang->words['t_friday'] ); + $dropdown['_wday'][] = array( '6', $this->lang->words['t_saturday'] ); /* Form Elements */ - $form['task_title'] = $this->registry->output->formInput( 'task_title' , $this->request['task_title'] ? $this->request['task_title'] : $task['task_title'] ); - $form['task_description'] = $this->registry->output->formInput( 'task_description', $this->request['task_description'] ? $this->request['task_description'] : $task['task_description'] ); + $form['task_title'] = $this->registry->output->formInput( 'task_title' , $this->request['task_title'] ? $this->request['task_title'] : $task['task_title'] ); + $form['task_description'] = $this->registry->output->formInput( 'task_description', $this->request['task_description'] ? $this->request['task_description'] : $task['task_description'] ); $form['task_file'] = $this->registry->output->formSimpleInput( 'task_file' , $this->request['task_file'] ? $this->request['task_file'] : $task['task_file'] , '20' ); - $form['task_minute'] = $this->registry->output->formDropdown( 'task_minute' , $dropdown['_minute'] , $this->request['task_minute'] ? $this->request['task_minute'] : $task['task_minute'] , '', 'onchange="updatepreview()"' ); - $form['task_hour'] = $this->registry->output->formDropdown( 'task_hour' , $dropdown['_hour'] , $this->request['task_hour'] ? $this->request['task_hour'] : $task['task_hour'] , '', 'onchange="updatepreview()"' ); - $form['task_week_day'] = $this->registry->output->formDropdown( 'task_week_day' , $dropdown['_wday'] , $this->request['task_week_day'] ? $this->request['task_week_day'] : $task['task_week_day'] , '', 'onchange="updatepreview()"' ); - $form['task_month_day'] = $this->registry->output->formDropdown( 'task_month_day' , $dropdown['_mday'] , $this->request['task_month_day'] ? $this->request['task_month_day'] : $task['task_month_day'], '', 'onchange="updatepreview()"' ); + $form['task_minute'] = $this->registry->output->formDropdown( 'task_minute' , $dropdown['_minute'] , $this->request['task_minute'] ? $this->request['task_minute'] : $task['task_minute'] , '', 'onchange="updatepreview()"' ); + $form['task_hour'] = $this->registry->output->formDropdown( 'task_hour' , $dropdown['_hour'] , $this->request['task_hour'] ? $this->request['task_hour'] : $task['task_hour'] , '', 'onchange="updatepreview()"' ); + $form['task_week_day'] = $this->registry->output->formDropdown( 'task_week_day' , $dropdown['_wday'] , $this->request['task_week_day'] ? $this->request['task_week_day'] : $task['task_week_day'] , '', 'onchange="updatepreview()"' ); + $form['task_month_day'] = $this->registry->output->formDropdown( 'task_month_day' , $dropdown['_mday'] , $this->request['task_month_day'] ? $this->request['task_month_day'] : $task['task_month_day'], '', 'onchange="updatepreview()"' ); $form['task_log'] = $this->registry->output->formYesNo( 'task_log' , $this->request['task_log'] ? $this->request['task_log'] : $task['task_log'] ); $form['task_enabled'] = $this->registry->output->formYesNo( 'task_enabled' , $this->request['task_enabled'] ? $this->request['task_enabled'] : $task['task_enabled'] ); - $form['task_application'] = $this->registry->output->formDropdown( 'task_application', $apps, $this->request['task_application'] ? $this->request['task_application'] : $task['task_application'] ); - $form['task_key'] = $this->registry->output->formInput( 'task_key' , $this->request['task_key'] ? $this->request['task_key'] : $task['task_key'] ); + $form['task_application'] = $this->registry->output->formDropdown( 'task_application', $apps, $this->request['task_application'] ? $this->request['task_application'] : $task['task_application'] ); + $form['task_key'] = $this->registry->output->formInput( 'task_key' , $this->request['task_key'] ? $this->request['task_key'] : $task['task_key'] ); if ( IN_DEV ) { @@ -692,7 +700,7 @@ class admin_core_system_taskmanager extends ipsCommand /** * Builds the task mananger overview screen * - * @return void + * @return @e void */ public function taskManagerOverview() { @@ -751,11 +759,11 @@ class admin_core_system_taskmanager extends ipsCommand /** * Imports tasks from XML * - * @param string $file Filename to import tasks from - * @param bool $no_return Set to return true/false, instead of displaying results - * @return void + * @param string $file Filename to import tasks from + * @param boolean $no_return Set to return true/false, instead of displaying results + * @return @e mixed True if $no_return is enabled, otherwise void */ - public function tasksImportFromXML( $file='', $no_return=0 ) + public function tasksImportFromXML( $file='', $no_return=false ) { /* INIT */ $file = ( $file ) ? $file : IPS_PUBLIC_PATH . 'resources/tasks.xml'; @@ -764,15 +772,17 @@ class admin_core_system_taskmanager extends ipsCommand $tasks = array(); /* Check to see if the file exists */ - if ( ! file_exists( $file ) ) + if ( ! is_file( $file ) ) { $this->registry->output->global_message = sprintf( $this->lang->words['t_import404'], $file ); $this->taskManagerOverview(); return; } + $content = @file_get_contents( $file ); + /* Grab current tasks */ - $this->DB->build( array( 'select' => '*', 'from' => 'task_manager' ) ); + $this->DB->build( array( 'select' => '*', 'from' => 'task_manager' ) ); $this->DB->execute(); while( $row = $this->DB->fetch() ) @@ -780,81 +790,37 @@ class admin_core_system_taskmanager extends ipsCommand $tasks[ $row['task_key'] ] = $row; } - /* XML Class */ - require_once( IPS_KERNEL_PATH.'class_xml.php' ); - $xml = new class_xml(); + /* Get the XML class */ + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + $xml->loadXML( $content ); + + /* Loop through the tasks */ + foreach( $xml->fetchElements('row') as $record ) + { + $entry = $xml->fetchElementsFromRecord( $record ); + $_key = $entry['task_key']; + + $entry['task_cronkey'] = $tasks[ $_key ]['task_cronkey'] ? $tasks[ $_key ]['task_cronkey'] : md5( uniqid( microtime() ) ); + $entry['task_next_run'] = $tasks[ $_key ]['task_next_run'] ? $tasks[ $_key ]['task_next_run'] : time(); + $entry['task_description'] = $entry['task_description'] ? $entry['task_description'] : ''; + + unset( $entry['task_id'] ); - /* Read the xml file */ - $skin_content = implode( '', file( $file ) ); - - /* Parse the xml file contents */ - $xml->xml_parse_document( $skin_content ); - - /* Fix up */ - if ( ! is_array( $xml->xml_array['export']['group']['row'][0] ) ) - { - /* Ensure [0] is populated */ - $tmp = $xml->xml_array['export']['group']['row']; - unset($xml->xml_array['export']['group']['row']); - $xml->xml_array['export']['group']['row'][0] = $tmp; - } - - /* Make sure we have some task data */ - if ( ! is_array( $xml->xml_array['export']['group']['row'][0] ) OR ! count( $xml->xml_array['export']['group']['row'][0] ) ) - { - if ( $no_return ) + if ( $tasks[ $_key ]['task_key'] ) { - return FALSE; + unset($entry['task_cronkey']); + unset($entry['task_enabled']); + + $updated++; + $this->DB->update( 'task_manager', $entry, "task_key='" . $tasks[ $_key ]['task_key'] . "'" ); } else { - $this->registry->output->global_message = $this->lang->words['t_noupdate']; - $this->taskManagerOverview(); - } - } - - /* Loop through the tasks */ - if ( is_array( $xml->xml_array['export']['group']['row'] ) AND count( $xml->xml_array['export']['group']['row'] ) ) - { - foreach( $xml->xml_array['export']['group']['row'] as $id => $entry ) - { - $newrow = array(); - - $_key = $entry['task_key']['VALUE']; - - foreach( $entry as $f => $data ) - { - if ( $f == 'VALUE' or $f == 'task_id' ) - { - continue; - } - - if ( $f == 'task_cronkey' ) - { - $entry[ $f ]['VALUE'] = $tasks[ $_key ]['task_cronkey'] ? $tasks[ $_key ]['task_cronkey'] : md5( uniqid( microtime() ) ); - } - - if ( $f == 'task_next_run' ) - { - $entry[ $f ]['VALUE'] = $tasks[ $_key ]['task_next_run'] ? $tasks[ $_key ]['task_next_run'] : time(); - } - - $newrow[$f] = $entry[ $f ]['VALUE']; - } - - $newrow['task_description'] = ( $newrow['task_description'] ) ? $newrow['task_description'] : ''; - - if ( $tasks[ $_key ]['task_key'] ) - { - $updated++; - $this->DB->update( 'task_manager', $newrow, "task_key='" . $tasks[ $_key ]['task_key'] . "'" ); - } - else - { - $inserted++; - $this->DB->insert( 'task_manager', $newrow ); - $tasks[ $_key ] = $newrow; - } + $inserted++; + $this->DB->insert( 'task_manager', $entry ); + $tasks[ $_key ] = $entry; } } @@ -874,13 +840,13 @@ class admin_core_system_taskmanager extends ipsCommand /** * Import all tasks from XML * - * @param bool $no_return - * @return void + * @return @e void */ public function tasksImportAllApps() { /* INIT */ $tasks = array(); + $_gmsg = array(); /* Grab current tasks */ $this->DB->build( array( 'select' => '*', 'from' => 'task_manager' ) ); @@ -892,7 +858,7 @@ class admin_core_system_taskmanager extends ipsCommand } /* Grab XML class */ - require_once( IPS_KERNEL_PATH . 'classXML.php' ); + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ /* Loop through all the applications */ foreach( $this->registry->getApplications() as $app => $__data ) @@ -901,7 +867,7 @@ class admin_core_system_taskmanager extends ipsCommand $xml = new classXML( IPS_DOC_CHAR_SET ); $file = IPSLib::getAppDir( $app ) . '/xml/' . $app . '_tasks.xml'; - if( file_exists( $file ) ) + if( is_file( $file ) ) { $xml->load( $file ); @@ -916,10 +882,14 @@ class admin_core_system_taskmanager extends ipsCommand /* Update */ $entry['task_cronkey'] = ( $entry['task_cronkey'] ) ? $entry['task_cronkey'] : md5( uniqid( microtime() ) ); $entry['task_next_run'] = ( $entry['task_next_run'] ) ? $entry['task_next_run'] : time(); - $entry['task_description'] = ( $entry['task_description'] ) ? $entry['task_description'] : ''; + $entry['task_description'] = ( $entry['task_description'] ) ? $entry['task_description'] : ''; + $entry['task_locked'] = intval( $entry['task_locked'] ); if ( $tasks[ $entry['task_key'] ]['task_key'] ) { + unset($entry['task_cronkey']); + unset($entry['task_enabled']); + $stats['updated']++; $this->DB->update( 'task_manager', $entry, "task_key='" . $entry['task_key'] . "'" ); } @@ -933,7 +903,7 @@ class admin_core_system_taskmanager extends ipsCommand } } - $this->registry->output->global_message .= $app . ': ' . sprintf( $this->lang->words['t_inserted'], $stats['inserted'], $stats['updated'] ) . '
    '; + $_gmsg[] = $app . ': ' . sprintf( $this->lang->words['t_inserted'], $stats['inserted'], $stats['updated'] ); /* In dev time stamp? */ if ( IN_DEV ) @@ -943,7 +913,13 @@ class admin_core_system_taskmanager extends ipsCommand $this->cache->setCache( 'indev', $cache, array( 'donow' => 1, 'array' => 1 ) ); } } - + + /* Got a global message? */ + if ( count($_gmsg) ) + { + $this->registry->output->setMessage( implode( '
    ', $_gmsg ), 1 ); + } + /* Return */ $this->taskManagerOverview(); } @@ -951,7 +927,7 @@ class admin_core_system_taskmanager extends ipsCommand /** * Export a single task * - * @return void + * @return @e void */ public function taskExport() { @@ -959,7 +935,7 @@ class admin_core_system_taskmanager extends ipsCommand $entry = array(); $id = intval($this->request['task_id']); - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->newXMLDocument(); @@ -971,7 +947,7 @@ class admin_core_system_taskmanager extends ipsCommand $xml->addElementAsRecord( 'group', 'row', $r ); - /* Finish XML */ + /* Finish XML */ $doc = $xml->fetchDocument(); $this->registry->output->showDownload( $doc, 'task.xml', '', 0 ); @@ -980,14 +956,14 @@ class admin_core_system_taskmanager extends ipsCommand /** * Export tasks to XML * - * @return void + * @return @e void */ public function tasksExportToXML() { /* INIT */ $entry = array(); - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ /* Loop through all the applications */ foreach( $this->registry->getApplications() as $app => $__data ) @@ -997,7 +973,7 @@ class admin_core_system_taskmanager extends ipsCommand $xml->newXMLDocument(); $xml->addElement( 'export' ); $xml->addElement( 'group', 'export' ); - + /* Query tasks */ $this->DB->build( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_application='{$app}'" ) ); $this->DB->execute(); @@ -1009,20 +985,17 @@ class admin_core_system_taskmanager extends ipsCommand $xml->addElementAsRecord( 'group', 'row', $r ); } - /* Finish XML */ + /* Finish XML */ $doc = $xml->fetchDocument(); /* Write */ - if ( $doc AND $_c) + if ( $doc AND $_c ) { - @unlink( IPSLib::getAppDir( $app ) . '/xml/' . $app . '_tasks.xml' ); - $fh = fopen( IPSLib::getAppDir( $app ) . '/xml/' . $app . '_tasks.xml', 'w' ); - fwrite( $fh, $doc ); - fclose( $fh ); + file_put_contents( IPSLib::getAppDir( $app ) . '/xml/' . $app . '_tasks.xml', $doc ); } } - $this->registry->output->global_message = $this->lang->words['t_exported']; - $this->taskManagerOverview(); + $this->registry->output->setMessage( $this->lang->words['t_exported'], 1 ); + $this->taskManagerOverview(); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/system/xml/index.html b/upload/admin/applications/core/modules_admin/system/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/system/xml/index.html +++ b/upload/admin/applications/core/modules_admin/system/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/system/xml/menu.xml b/upload/admin/applications/core/modules_admin/system/xml/menu.xml index 22e8a825..97e6f26a 100644 --- a/upload/admin/applications/core/modules_admin/system/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/system/xml/menu.xml @@ -6,8 +6,10 @@ Управление планировщиком задач + taskmanager taskmanager do=overview + task_manage 0 @@ -17,14 +19,23 @@ Инструменты безопасности + security security + security_center 0 + +
    + + Список администраторов + Список администраторов + listadmins security do=list_admins + list_admins 0 diff --git a/upload/admin/applications/core/modules_admin/system/xml/permissions.xml b/upload/admin/applications/core/modules_admin/system/xml/permissions.xml index 5f89747e..7da2013e 100644 --- a/upload/admin/applications/core/modules_admin/system/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/system/xml/permissions.xml @@ -2,7 +2,12 @@ Центр безопасности + core_security + + security_center + Может просматривать центр безопасности? + acplink_remove Может удалить ссылку на АЦ? @@ -39,6 +44,7 @@ Управление задачами планировщика + core_tasks task_manage @@ -65,6 +71,7 @@ Журнал авторизаций администраторов + core_acp_loginlogs acplogin_log diff --git a/upload/admin/applications/core/modules_admin/templates/css.php b/upload/admin/applications/core/modules_admin/templates/css.php deleted file mode 100644 index 0dd95d98..00000000 --- a/upload/admin/applications/core/modules_admin/templates/css.php +++ /dev/null @@ -1,153 +0,0 @@ - - * Invision Power Services - * IP.Board v3.1.4 - * CSS editing - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Who knows... - * @version $Revision: 5713 $ - * - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_templates_css extends ipsCommand -{ - /** - * Skin Functions Class - * - * @access private - * @var object - */ - private $skinFunctions; - - /** - * Skin object - * - * @access private - * @var object Skin templates - */ - private $html; - - /** - * Main class entry point - * - * @access public - * @param object ipsRegistry reference - * @return void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - //----------------------------------------- - // Load skin - //----------------------------------------- - - $this->html = $this->registry->output->loadTemplate('cp_skin_templates'); - - //----------------------------------------- - // Set up stuff - //----------------------------------------- - - $this->form_code = $this->html->form_code = 'module=templates&section=css'; - $this->form_code_js = $this->html->form_code_js = 'module=templates§ion=css'; - - //----------------------------------------- - // Load lang - //----------------------------------------- - - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ) ); - - //----------------------------------------- - // Load functions and cache classes - //----------------------------------------- - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - - $this->skinFunctions = new skinCaching( $registry ); - - ///---------------------------------------- - // What to do... - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'list': - default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'css_manage' ); - $this->_listCSS(); - break; - } - - /* Output */ - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * List available CSS for this skin set - * - * @access private - * @return void - */ - private function _listCSS() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $setID = intval( $this->request['setID'] ); - $css = array(); - $setData = array(); - - //----------------------------------------- - // Get template set data - //----------------------------------------- - - $setData = $this->skinFunctions->fetchSkinData( $setID ); - - //----------------------------------------- - // Get CSS - //----------------------------------------- - - $_css = $this->skinFunctions->fetchCSS( $setID ); - - //----------------------------------------- - // Fix up positioning - //----------------------------------------- - - foreach( $_css as $_id => $_data ) - { - $css[ $_data['css_position'] . '.' . $_data['css_id'] ] = $_data; - } - - ksort( $css, SORT_NUMERIC ); - - //----------------------------------------- - // Navvy Gation - //----------------------------------------- - - $this->registry->output->extra_nav[] = array( $this->settings['base_url'].'module=templates&section=skinsets&do=overview', $this->lang->words['cs_nav1'] ); - $this->registry->output->extra_nav[] = array( $this->settings['base_url'].'module=templates&section=css&do=list&setID=' . $setID, $this->lang->words['cs_nav2'] . $setData['set_name'] ); - - //----------------------------------------- - // Print it... - //----------------------------------------- - - $this->registry->output->html .= $this->html->css_listCSS( $css, $setData ); - } -} diff --git a/upload/admin/applications/core/modules_admin/templates/defaultSection.php b/upload/admin/applications/core/modules_admin/templates/defaultSection.php index faf2ce84..544a9a74 100644 --- a/upload/admin/applications/core/modules_admin/templates/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/templates/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default templates section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'templates' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - $DEFAULT_SECTION = 'skinsets'; diff --git a/upload/admin/applications/core/modules_admin/templates/easylogo.php b/upload/admin/applications/core/modules_admin/templates/easylogo.php index 030f0dc8..2f1cea2b 100644 --- a/upload/admin/applications/core/modules_admin/templates/easylogo.php +++ b/upload/admin/applications/core/modules_admin/templates/easylogo.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Easy Logo Changer
    - * Last Updated: $Date: 2010-07-16 14:28:53 -0400 (Fri, 16 Jul 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 17th August 2004 - * @version $Revision: 6664 $ + * @version $Revision: 8644 $ * */ @@ -31,7 +31,6 @@ class admin_core_templates_easylogo extends ipsCommand /** * HTML Skin object * - * @access protected * @var object */ protected $html; @@ -39,17 +38,15 @@ class admin_core_templates_easylogo extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -76,8 +73,8 @@ class admin_core_templates_easylogo extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); @@ -106,8 +103,7 @@ class admin_core_templates_easylogo extends ipsCommand /** * Finish changing the logo * - * @access public - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function complete() { @@ -180,7 +176,7 @@ class admin_core_templates_easylogo extends ipsCommand if ( move_uploaded_file( $_FILES[ 'FILE_UPLOAD' ]['tmp_name'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . "/style_images/{$this->request['skin']}_" . $FILE_NAME ) ) { - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . "/style_images/{$this->requestt['skin']}_".$FILE_NAME, 0777 ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . "/style_images/" . $this->requestt['skin'] . "_" . $FILE_NAME, IPS_FILE_PERMISSION ); } else { @@ -222,8 +218,7 @@ class admin_core_templates_easylogo extends ipsCommand /** * Show the form to change the logo * - * @access public - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function splash() { diff --git a/upload/admin/applications/core/modules_admin/templates/external.php b/upload/admin/applications/core/modules_admin/templates/external.php new file mode 100644 index 00000000..b7be234f --- /dev/null +++ b/upload/admin/applications/core/modules_admin/templates/external.php @@ -0,0 +1,135 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Externally edit templates and css + * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $ + * + * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Board + * @subpackage Core + * @link http://hatynka.in + * @since Tuesday 17th August 2004 + * @version $Revision: 8644 $ + * + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + + +class admin_core_templates_external extends ipsCommand +{ + /** + * HTML Skin object + * + * @var object + */ + protected $html; + + /** + * Skin Functions Class + * + * @var object + */ + protected $skinFunctions; + + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen/redirects] + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Load lang + //----------------------------------------- + + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_templates' ), 'core' ); + + //----------------------------------------- + // Load skin + //----------------------------------------- + + $this->html = $this->registry->output->loadTemplate('cp_skin_templates'); + + //----------------------------------------- + // Set up stuff + //----------------------------------------- + + $this->form_code = $this->html->form_code = 'module=templates&section=external'; + $this->form_code_js = $this->html->form_code_js = 'module=templates§ion=external'; + + //----------------------------------------- + // Load functions and cache classes + //----------------------------------------- + + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + + $this->skinFunctions = new skinCaching( $registry ); + + //----------------------------------------- + // What to do? + //----------------------------------------- + + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settemplates_external' ); + + switch( $this->request['do'] ) + { + default: + case 'overview': + $this->_overview(); + break; + case 'save': + $this->_save(); + break; + } + + /* Output */ + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } + + /** + * Saves um.. it + * + * @return @e void [Outputs to screen/redirects] + */ + protected function _save() + { + /* Init */ + $webdav_on = intval( $this->request['webdav_on'] ); + + /* Save */ + IPSLib::updateSettings( array( 'webdav_on' => $webdav_on ) ); + + /* Relist */ + $this->registry->output->silentRedirect( "{$this->settings['base_url']}{$this->html->form_code}" ); + } + + /** + * Shows the current state of the external edit system + * + * @return @e void [Outputs to screen/redirects] + */ + protected function _overview() + { + /* Init */ + $form = array(); + + $form['webdav_on']= $this->registry->getClass('output')->formYesNo( 'webdav_on', $this->settings['webdav_on'] ); + + $this->registry->output->html .= $this->html->externalEditOverview( $form ); + } + +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/templates/importexport.php b/upload/admin/applications/core/modules_admin/templates/importexport.php index d9efc77a..b74010cf 100644 --- a/upload/admin/applications/core/modules_admin/templates/importexport.php +++ b/upload/admin/applications/core/modules_admin/templates/importexport.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Import and export skin sets
    - * Last Updated: $Date: 2010-09-13 17:28:12 -0400 (Mon, 13 Sep 2010) $
    + * Last Updated: $Date: 2011-09-01 23:02:38 -0400 (Thu, 01 Sep 2011) $
      * 
    * - * @author $Author: terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6863 $ + * @version $Revision: 9442 $ * */ @@ -30,31 +30,27 @@ class admin_core_templates_importexport extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Recursive depth guide * - * @access private * @var array */ - private $_depthGuide = array(); + protected $_depthGuide = array(); /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -64,9 +60,8 @@ class admin_core_templates_importexport extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -93,9 +88,9 @@ class admin_core_templates_importexport extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/ $this->skinFunctions = new skinImportExport( $registry ); @@ -145,10 +140,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Import an XMLarchive skin set * - * @access private * @return string HTML to show */ - private function _importReplacements() + protected function _importReplacements() { $importLocation = trim( $this->request['importLocation'] ); $setID = intval( $this->request['setID'] ); @@ -184,10 +178,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Import an XMLarchive skin set * - * @access private * @return string HTML to show */ - private function _importImages() + protected function _importImages() { $importName = trim( $this->request['importName'] ); $importLocation = trim( $this->request['importLocation'] ); @@ -199,10 +192,10 @@ class admin_core_templates_importexport extends ipsCommand if( ! $importName ) { - $importName = isset( $_FILES['FILE_UPLOAD']['name'] ) && $_FILES['FILE_UPLOAD']['name'] ? $_FILES['FILE_UPLOAD']['name'] : $this->request['importLocation']; + $importName = !empty( $_FILES['FILE_UPLOAD']['name'] ) ? $_FILES['FILE_UPLOAD']['name'] : $this->request['importLocation']; } - $importName = str_ireplace( array( '.xml', '.gz', 'images-' ), '', $importName ); + $importName = preg_replace( "/[^a-zA-Z0-9_]/", "_", str_ireplace( array( '.xml', '.gz', 'images-' ), '', $importName ) ); //----------------------------------------- // Attempt to get contents @@ -235,10 +228,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Import an XMLarchive skin set * - * @access private * @return string HTML to show */ - private function _importSet() + protected function _importSet() { $importName = trim( $this->request['importName'] ); $importUpgrade = intval( $this->request['importUpgrade'] ) ? TRUE : FALSE; @@ -308,10 +300,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Export replacements to an XMLArchive * - * @access private - * @return void + * @return @e void */ - private function _exportReplacements() + protected function _exportReplacements() { //----------------------------------------- // INIT @@ -330,10 +321,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Export an image set to an XMLArchive * - * @access private - * @return void + * @return @e void */ - private function _exportImages() + protected function _exportImages() { //----------------------------------------- // INIT @@ -361,10 +351,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Export the entire set to an XMLArchive * - * @access private - * @return void + * @return @e void */ - private function _exportSet() + protected function _exportSet() { //----------------------------------------- // INIT @@ -385,8 +374,6 @@ class admin_core_templates_importexport extends ipsCommand $apps[] = 'core'; $apps[] = 'forums'; $apps[] = 'members'; - $apps[] = 'calendar'; - $apps[] = 'portal'; } else if ( $v ) { @@ -414,10 +401,9 @@ class admin_core_templates_importexport extends ipsCommand /** * Show the main form * - * @access private - * @return void + * @return @e void */ - private function _showForm() + protected function _showForm() { //----------------------------------------- // INIT @@ -511,13 +497,12 @@ class admin_core_templates_importexport extends ipsCommand * I did debate moving it into a function elsewhere * But it's only used here also, so... * - * @access private * @param int Set ID to be 'selected' * @param int Parent id * @param int Iteration * @return string HTML */ - private function _fetchSetsDropDown( $skinID=NULL, $parent=0, $iteration=0 ) + protected function _fetchSetsDropDown( $skinID=NULL, $parent=0, $iteration=0 ) { //----------------------------------------- // INIT diff --git a/upload/admin/applications/core/modules_admin/templates/index.html b/upload/admin/applications/core/modules_admin/templates/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/templates/index.html +++ b/upload/admin/applications/core/modules_admin/templates/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/templates/replacements.php b/upload/admin/applications/core/modules_admin/templates/replacements.php index 6d581328..4a3b45ab 100644 --- a/upload/admin/applications/core/modules_admin/templates/replacements.php +++ b/upload/admin/applications/core/modules_admin/templates/replacements.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Macros/replacements
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ * */ @@ -30,25 +30,22 @@ class admin_core_templates_replacements extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -75,8 +72,8 @@ class admin_core_templates_replacements extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); @@ -101,10 +98,9 @@ class admin_core_templates_replacements extends ipsCommand /** * List available CSS for this skin set * - * @access private - * @return void + * @return @e void */ - private function _listReplacements() + protected function _listReplacements() { //----------------------------------------- // INIT diff --git a/upload/admin/applications/core/modules_admin/templates/searchandreplace.php b/upload/admin/applications/core/modules_admin/templates/searchandreplace.php index 572c4c57..897374be 100644 --- a/upload/admin/applications/core/modules_admin/templates/searchandreplace.php +++ b/upload/admin/applications/core/modules_admin/templates/searchandreplace.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Skin search and replace tool
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
      * 
    * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 5713 $ + * @version $Revision: 9487 $ * */ @@ -30,39 +30,34 @@ class admin_core_templates_searchandreplace extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Recursive depth guide * - * @access private * @var array */ - private $_depthGuide = array(); + protected $_depthGuide = array(); /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Amount of items per go * - * @access private * @var int */ - private $_bitsPerRound = 50; + protected $_bitsPerRound = 50; /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -72,9 +67,8 @@ class admin_core_templates_searchandreplace extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -101,9 +95,9 @@ class admin_core_templates_searchandreplace extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ $this->skinFunctions = new skinDifferences( $registry ); @@ -132,10 +126,9 @@ class admin_core_templates_searchandreplace extends ipsCommand /** * Processes the template bits... * - * @access private * @return string HTML */ - private function _start() + protected function _start() { //----------------------------------------- // INIT @@ -215,16 +208,15 @@ class admin_core_templates_searchandreplace extends ipsCommand /** * Displays the search form * - * @access private - * @return void + * @return @e void */ - private function _showForm() + protected function _showForm() { //----------------------------------------- // INIT //----------------------------------------- - $this->registry->output->html = $this->html->searchandreplace_form( $this->skinFunctions->getTiersFunction()->fetchAllsItemDropDown(), $this->skinFunctions->fetchNumberTemplateBits(), $this->_bitsPerRound ); + $this->registry->output->html .= $this->html->searchandreplace_form( $this->skinFunctions->getTiersFunction()->fetchAllsItemDropDown(), $this->skinFunctions->fetchNumberTemplateBits(), $this->_bitsPerRound ); } } diff --git a/upload/admin/applications/core/modules_admin/templates/skindiff.php b/upload/admin/applications/core/modules_admin/templates/skindiff.php index 6a4059a3..d0d3a102 100644 --- a/upload/admin/applications/core/modules_admin/templates/skindiff.php +++ b/upload/admin/applications/core/modules_admin/templates/skindiff.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Skin diff report tools
    - * Last Updated: $Date: 2010-07-22 04:20:07 -0400 (Thu, 22 Jul 2010) $
    + * Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
      * 
    * - * @author $Author: matt $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6694 $ + * @version $Revision: 9487 $ * */ @@ -30,39 +30,34 @@ class admin_core_templates_skindiff extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Recursive depth guide * - * @access private * @var array */ - private $_depthGuide = array(); + protected $_depthGuide = array(); /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Amount of items per go * - * @access private * @var int */ - private $_bitsPerRound = 10; + protected $_bitsPerRound = 10; /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -72,9 +67,8 @@ class admin_core_templates_skindiff extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -101,9 +95,9 @@ class admin_core_templates_skindiff extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinDifferences.php' );/*noLibHook*/ $this->skinFunctions = new skinDifferences( $registry ); @@ -146,10 +140,9 @@ class admin_core_templates_skindiff extends ipsCommand /** * Action a report drop down * - * @access private - * @return void + * @return @e void */ - private function _multiManage() + protected function _multiManage() { $merge_id = $this->request['sessionID'] = intval( $this->request['merge_id'] ); $mergeOption = trim( $this->request['mergeOption'] ); @@ -192,10 +185,9 @@ class admin_core_templates_skindiff extends ipsCommand /** * Remove a report * - * @access private - * @return void + * @return @e void */ - private function _removeReport() + protected function _removeReport() { //----------------------------------------- // Init @@ -231,10 +223,9 @@ class admin_core_templates_skindiff extends ipsCommand /** * Export a report * - * @access private - * @return void + * @return @e void */ - private function _exportReport() + protected function _exportReport() { //----------------------------------------- // Init @@ -267,10 +258,9 @@ class admin_core_templates_skindiff extends ipsCommand /** * View a diff report * - * @access private - * @return void + * @return @e void */ - private function _viewReport() + protected function _viewReport() { //----------------------------------------- // Init @@ -302,15 +292,14 @@ class admin_core_templates_skindiff extends ipsCommand $this->registry->output->extra_nav[] = array( $this->settings['base_url'].'module=templates&section=skindiff&do=overview', $this->lang->words['sk_skindiffreports'] ); $this->registry->output->extra_nav[] = array( $this->settings['base_url'].'module=templates&section=skindiff&do=viewReport&sessionID=' . $session['merge_id'], $this->skinFunctions->fetchReportTitle( $session ) ); - $this->registry->output->html = $this->html->skindiff_reportOverview( $session, $data['data'], $data['counts']['missing'], $data['counts']['changed'] ); + $this->registry->output->html .= $this->html->skindiff_reportOverview( $session, $data['data'], $data['counts']['missing'], $data['counts']['changed'] ); } /** * Compare skin differences (XML files) * * @since 2.1.0.2005-07-22 - * @access public - * @return void + * @return @e void */ public function _start() { @@ -356,17 +345,16 @@ class admin_core_templates_skindiff extends ipsCommand $items = intval( $session['merge_templates_togo'] ) + intval( $session['merge_css_togo'] ); - $this->registry->output->html = $this->html->skindiff_ajaxScreen( $sessionId, $items, $this->_bitsPerRound ); + $this->registry->output->html .= $this->html->skindiff_ajaxScreen( $sessionId, $items, $this->_bitsPerRound ); } /** * List all current difference 'sets' * - * @access private - * @return void + * @return @e void */ - private function _list() + protected function _list() { //----------------------------------------- // Do it diff --git a/upload/admin/applications/core/modules_admin/templates/skinsets.php b/upload/admin/applications/core/modules_admin/templates/skinsets.php index 4fa5367d..4d368e81 100644 --- a/upload/admin/applications/core/modules_admin/templates/skinsets.php +++ b/upload/admin/applications/core/modules_admin/templates/skinsets.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Skin set management
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-10-14 09:43:08 -0400 (Fri, 14 Oct 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6995 $ + * @version $Revision: 9617 $ * */ @@ -32,21 +32,21 @@ class admin_core_templates_skinsets extends ipsCommand * * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Recursive depth guide * * @var array */ - private $_depthGuide = array(); + protected $_depthGuide = array(); /** * Skin object * * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits @@ -61,7 +61,7 @@ class admin_core_templates_skinsets extends ipsCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -88,10 +88,11 @@ class admin_core_templates_skinsets extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinGenerator.php' );/*noLibHook*/ - $this->skinFunctions = new skinCaching( $registry ); + $this->skinFunctions = new skinGenerator( $registry ); ///---------------------------------------- // What to do... @@ -156,6 +157,24 @@ class admin_core_templates_skinsets extends ipsCommand $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settemplates_manage' ); $this->reorder(); break; + case 'skinGenStepOne': + $this->_skinGenStepOne(); + break; + case 'skinGenStepOneComplete': + $this->_skinGenStepOneComplete(); + break; + case 'skinGenStepTwoStart': + $this->_skinGenStepTwoStart(); + break; + case 'launchVisualEditor': + $this->_launchVisualEditor(); + break; + case 'cancelVisualEditor': + $this->_cancelVisualEditor(); + break; + case 'convertVisEditToFull': + $this->_convertVisEditToFull(); + break; } /* Output */ @@ -163,10 +182,204 @@ class admin_core_templates_skinsets extends ipsCommand $this->registry->output->sendOutput(); } + /** + * Convert a skin from vissy eddy to full + */ + protected function _convertVisEditToFull() + { + $skinSetId = intval( $this->request['set_id'] ); + + /* Set this user session */ + $this->skinFunctions->convertToFull( $skinSetId ); + + $this->skinFunctions->rebuildSkinSetsCache(); + + $this->registry->output->global_message = $this->lang->words['skin_gen_convert_done']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=overview' ); + } + + /** + * Close the visual editor + * + * @return @e void + */ + protected function _cancelVisualEditor() + { + $skinSet = intval( $this->request['set_id'] ); + + /* Set this user session */ + $this->skinFunctions->deleteUserSession( $this->memberData['member_id'] ); + + /* Onto step two */ + $this->registry->output->silentRedirect( "{$this->settings['base_url']}{$this->html->form_code}" ); + } + + /** + * Launch the visual editor + * + * @return @e void + */ + protected function _launchVisualEditor() + { + $skinSet = intval( $this->request['set_id'] ); + + /* Build the local cache */ + try + { + $this->skinFunctions->buildLocalJsonCache(); + } + catch ( Exception $e ) + { + die( $e->getMessage ); + } + + /* Set this user session */ + $this->skinFunctions->setUserSession( $this->memberData['member_id'], array( 'skin_set_id' => $skinSet ) ); + + /* Onto step two */ + $this->registry->output->silentRedirect( $this->settings['public_url'] ); + } + + /** + * Step Two: Start + * + * @return @e void + */ + protected function _skinGenStepTwoStart() + { + $skinSetId = intval( $this->request['set_id'] ); + + $this->_listSets( $this->html->skinGeneratorReady( $skinSetId ) ); + } + + /** + * Step One: Save + * + * @return @e void + */ + protected function _skinGenStepOneComplete() + { + $set_name = $this->request['set_name']; + $set_author_name = $this->request['set_author_name']; + $set_author_url = $this->request['set_author_url']; + $skinSet = array(); + $set_key = IPS_UNIX_TIME_NOW; + $messages = $errors = array(); + + /* Fetch default skin to set some defaults for this skin */ + $default = $this->skinFunctions->fetchSkinData( $this->skinFunctions->fetchSetIdByKey('default') ); + + /* Check */ + if ( ! $set_name ) + { + $this->registry->getClass('output')->global_message = $this->lang->words['ss_specifyname']; + $this->_start(); + return; + } + + /* Build save array */ + $save = array( 'set_name' => $set_name, + 'set_key' => $set_key, + 'set_parent_id' => 0, + 'set_permissions' => '*', + 'set_is_default' => 0, + 'set_author_name' => $set_author_name, + 'set_author_url' => $set_author_url, + 'set_image_dir' => $default['set_image_dir'], + 'set_emo_dir' => $default['set_emo_dir'], + 'set_css_inline' => 0, + 'set_output_format' => 'html', + 'set_hide_from_list'=> 1, + 'set_minify' => $this->settings['use_minify'], + 'set_master_key' => 'root', + 'set_updated' => IPS_UNIX_TIME_NOW, + 'set_added' => IPS_UNIX_TIME_NOW, + 'set_by_skin_gen' => 1, + 'set_skin_gen_data' => serialize( array() ) ); + + /* Add position */ + $curPos = $this->skinFunctions->fetchHighestSetPosition(); + $save['set_order'] = (int)$curPos++; + + $this->DB->insert( 'skin_collections', $save ); + $set_id = $this->DB->getInsertId(); + + /* Caches need to be rebuilt first, so that the parent tree is setup. Bug #21008 */ + $this->skinFunctions->rebuildSkinSetsCache(); + $messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) ); + $errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) ); + + /* Rebuild tree info */ + $this->skinFunctions->rebuildTreeInformation( $set_id ); + + /* Flush the data */ + $this->skinFunctions->flushSkinData(); + + /* Rebuild caches */ + $this->skinFunctions->rebuildCSS( $set_id ); + $messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) ); + $errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) ); + + $this->skinFunctions->rebuildPHPTemplates( $set_id ); + $messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) ); + $errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) ); + + $this->skinFunctions->rebuildReplacementsCache( $set_id ); + $messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) ); + $errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) ); + + /* Build the local cache */ + try + { + $this->skinFunctions->buildLocalJsonCache(); + } + catch ( Exception $e ) + { + die( $e->getMessage ); + } + + /* Set this user session */ + $this->skinFunctions->setUserSession( $this->memberData['member_id'], array( 'skin_set_id' => $set_id ) ); + + /* Onto step two */ + $this->registry->output->silentRedirect( "{$this->settings['base_url']}{$this->html->form_code}&do=skinGenStepTwoStart&set_id=" . $set_id ); + } + + /** + * Start. No really. + * + * @return @e void [Outputs to screen/redirects] + */ + protected function _skinGenStepOne() + { + /* Basic checks and tests */ + $warnings = $this->skinFunctions->healthCheck(); + $errors = array(); + $form = array(); + + if ( $warnings !== true ) + { + $errors = $warnings; + } + + /* Perform license check */ + if ( IPSLib::hasActiveLicense() !== true ) + { + $errors[] = "License key out of date"; + } + + /* Form */ + $form['set_name'] = $this->registry->getClass('output')->formInput( 'set_name' , $_POST['set_name'] ); + $form['set_author_name'] = $this->registry->getClass('output')->formInput( 'set_author_name' , $_POST['set_author_name'] ); + $form['set_author_url'] = $this->registry->getClass('output')->formInput( 'set_author_url' , $_POST['set_author_url'] ); + + $this->registry->output->html .= $this->html->skinGenerator( $form, $errors ); + } + /** * AJAX Action: Reorder Skin Sets */ - private function reorder() + protected function reorder() { //----------------------------------------- // INIT @@ -213,7 +426,7 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _toggleHidden() + protected function _toggleHidden() { /* INIT */ $set_id = intval( $this->request['set_id'] ); @@ -233,17 +446,12 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _makeDefault() + protected function _makeDefault() { /* INIT */ $set_id = intval( $this->request['set_id'] ); - $skinSet = $this->skinFunctions->fetchSkinData( $set_id ); - /* Make none default.. */ - $this->DB->update( 'skin_collections', array( 'set_is_default' => 0 ), 'set_output_format=\'' . $skinSet['set_output_format'] . '\'' ); - - /* Make this one default.. */ - $this->DB->update( 'skin_collections', array( 'set_is_default' => 1 ), 'set_id=' . $set_id ); + $this->skinFunctions->makeDefault( $set_id ); $this->skinFunctions->rebuildSkinSetsCache(); @@ -256,7 +464,7 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _setRevert() + protected function _setRevert() { $set_id = intval( $this->request['setID'] ); $authKey = $this->request['authKey']; @@ -283,7 +491,7 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _revertSplash() + protected function _revertSplash() { /* INIT */ $setId = intval( $this->request['setID'] ); @@ -301,7 +509,7 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _setWriteMasterCss() + protected function _setWriteMasterCss() { $set_id = intval( $this->request['set_id'] ); @@ -329,7 +537,7 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _setWriteMaster() + protected function _setWriteMaster() { $set_id = intval( $this->request['set_id'] ); @@ -357,11 +565,10 @@ class admin_core_templates_skinsets extends ipsCommand * * @return string HTML */ - private function _setRemove() + protected function _setRemove() { $set_id = intval( $this->request['set_id'] ); $authKey = $this->request['authKey']; - $setData = $this->skinFunctions->fetchSkinData( $set_id ); /* Auth check */ if ( $authKey != $this->member->form_hash ) @@ -386,9 +593,9 @@ class admin_core_templates_skinsets extends ipsCommand /** * Remove splash * - * @return void + * @return @e void */ - private function _setRemoveSplash() + protected function _setRemoveSplash() { $set_id = intval( $this->request['set_id'] ); $setData = $this->skinFunctions->fetchSkinData( $set_id ); @@ -406,9 +613,9 @@ class admin_core_templates_skinsets extends ipsCommand * Form: Save * * @param string Type of form to show (add/edit) - * @return void + * @return @e void */ - private function _setSave( $type='' ) + protected function _setSave( $type='' ) { $set_id = intval( $this->request['set_id'] ); $set_name = $this->request['set_name']; @@ -421,10 +628,8 @@ class admin_core_templates_skinsets extends ipsCommand $set_author_url = $this->request['set_author_url']; $set_image_dir = $this->request['set_image_dir']; $set_emo_dir = $this->request['set_emo_dir']; - $set_css_inline = intval( $this->request['set_css_inline'] ); $set_output_format = IPSText::alphanumericalClean( $this->request['set_output_format'] ); $set_hide_from_list = intval( $this->request['set_hide_from_list'] ); - $set_minify = intval( $this->request['set_minify'] ); $skinSet = array(); //----------------------------------------- @@ -519,7 +724,7 @@ class admin_core_templates_skinsets extends ipsCommand return; } } - + //----------------------------------------- // Build Save Array //----------------------------------------- @@ -533,10 +738,10 @@ class admin_core_templates_skinsets extends ipsCommand 'set_author_url' => $set_author_url, 'set_image_dir' => $set_image_dir, 'set_emo_dir' => $set_emo_dir, - 'set_css_inline' => $set_css_inline, + 'set_css_inline' => 1, 'set_output_format' => $set_output_format, 'set_hide_from_list'=> ( $set_is_default ) ? 0 : $set_hide_from_list, - 'set_minify' => $set_minify, + 'set_minify' => $this->settings['use_minify'], 'set_master_key' => ( isset( $skinSet['set_master_key'] ) ) ? $skinSet['set_master_key'] : ( ( $set_output_format == 'xml' ) ? 'xmlskin' : 'root' ), 'set_updated' => time() ); @@ -564,7 +769,7 @@ class admin_core_templates_skinsets extends ipsCommand if ( $set_is_default ) { - $this->DB->update( 'skin_collections', array( 'set_is_default' => 0 ), 'set_id != ' . $set_id . ' AND set_output_format=\'' . $set_output_format . '\'' ); + $this->skinFunctions->makeDefault( $set_id ); } $messages = array(); @@ -611,7 +816,7 @@ class admin_core_templates_skinsets extends ipsCommand // Done... //----------------------------------------- - $this->registry->getClass('output')->global_message = $this->lang->words['ss_skinsetsaved'] . '
    ' . implode( '
    ', $messages ) . '
    ' . implode( '
    ', $errors ); + $this->registry->output->setMessage( $this->lang->words['ss_skinsetsaved'] . '
    ' . implode( '
    ', $messages ) . '
    ' . implode( '
    ', $errors ), true ); $this->_listSets(); } @@ -620,9 +825,9 @@ class admin_core_templates_skinsets extends ipsCommand * Form * * @param string Type of form to show (add/edit) - * @return void + * @return @e void */ - private function _setForm( $type='' ) + protected function _setForm( $type='' ) { //----------------------------------------- // INIT @@ -688,19 +893,6 @@ class admin_core_templates_skinsets extends ipsCommand $emoDirs[] = array( $_dir, $_dir ); } - //----------------------------------------- - // Can we write into the images directory? - //----------------------------------------- - - if ( is_writeable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css' ) ) - { - $form['set_css_inline'] = $this->registry->getClass('output')->formYesNo('set_css_inline', $skinSet['set_css_inline']); - } - else - { - $form['set_css_inline'] = $this->lang->words['ss_unavailable']; - } - //----------------------------------------- // Check (please?) //----------------------------------------- @@ -732,8 +924,7 @@ class admin_core_templates_skinsets extends ipsCommand $form['set_emo_dir'] = $this->registry->getClass('output')->formDropdown( 'set_emo_dir' , $emoDirs, ( $_POST['set_emo_dir'] ) ? $_POST['set_emo_dir'] : $skinSet['set_emo_dir'] ); $form['set_output_format'] = $this->registry->getClass('output')->formDropdown( 'set_output_format', $outputFormats, ( $_POST['set_output_format'] ) ? $_POST['set_output_format'] : $skinSet['set_output_format'] ); $form['set_hide_from_list']= $this->registry->getClass('output')->formYesNo( 'set_hide_from_list', ( $_POST['set_hide_from_list'] ) ? $_POST['set_hide_from_list'] : $skinSet['set_hide_from_list'] ); - $form['set_minify'] = $this->registry->getClass('output')->formYesNo( 'set_minify' , ( $_POST['set_minify'] ) ? $_POST['set_minify'] : $skinSet['set_minify'] ); - + //----------------------------------------- // Get group permissions //----------------------------------------- @@ -761,19 +952,20 @@ class admin_core_templates_skinsets extends ipsCommand /** * List template sets * - * @return void + * @return @e void */ - private function _listSets() + protected function _listSets( $html='' ) { //----------------------------------------- // INIT //----------------------------------------- - $root_id = 'root'; - $sets = array(); - $cacheData = array(); - $hasData = array(); - $canMerge = $this->skinFunctions->canUseMergeSystem(); + $root_id = 'root'; + $sets = array(); + $cacheData = array(); + $hasData = array(); + $canMerge = $this->skinFunctions->canUseMergeSystem(); + $skinGenSessions = array(); //----------------------------------------- // See if we have any cached data @@ -821,6 +1013,17 @@ class admin_core_templates_skinsets extends ipsCommand } } + /* Fetch skin gen sessions */ + $this->DB->build( array( 'select' => '*', + 'from' => 'skin_generator_sessions') ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $skinGenSessions[ $row['sg_skin_set_id'] ] = $row; + } + //----------------------------------------- // Recurse through and gather data //----------------------------------------- @@ -850,7 +1053,7 @@ class admin_core_templates_skinsets extends ipsCommand // Print it... //----------------------------------------- - $this->registry->output->html .= $this->html->skinsets_listSkinSets( $sets, $cacheData, $hasData, $canMerge ); + $this->registry->output->html .= $this->html->skinsets_listSkinSets( $sets, $cacheData, $hasData, $canMerge, $skinGenSessions, $html ); } /** @@ -861,7 +1064,7 @@ class admin_core_templates_skinsets extends ipsCommand * @param int Depth gauge count * @return array Array of skin set entries */ - private function _listSetsRecurse($id, $sets, $depth=0) + protected function _listSetsRecurse($id, $sets, $depth=0) { if ( is_array( $this->skinFunctions->recursiveTiers->getData( $id ) ) and count( $this->skinFunctions->recursiveTiers->getData( $id ) ) ) { @@ -884,7 +1087,7 @@ class admin_core_templates_skinsets extends ipsCommand * @param int Depth gauge count * @return array Modified skin set entry */ - private function _listSetsFormatData( $set_data, $depth=0 ) + protected function _listSetsFormatData( $set_data, $depth=0 ) { //----------------------------------------- // Get last modified date @@ -898,8 +1101,7 @@ class admin_core_templates_skinsets extends ipsCommand $set_data['_canRemove'] = ( ! $set_data['set_is_default'] AND ( ! in_array( $set_data['set_key'], $this->skinFunctions->remapData['masterKeys'] ) ) ) ? 1 : 0; - $set_data['_setImg'] = ( $set_data['set_parent_id'] > 0 ) ? 'package.png' : 'folder_palette.png'; - $set_data['_cssClass'] = ( $set_data['set_parent_id'] > 0 ) ? 'tablerow2' : 'tablerow1'; + $set_data['_setImg'] = ( $set_data['set_by_skin_gen'] ) ? 'palette.png' : ( ( $set_data['set_parent_id'] > 0 ) ? 'package.png' : 'folder_palette.png' ); $set_data['_canWriteMaster'] = ( isset( $this->skinFunctions->remapData['templates'][ $set_data['set_id'] ] ) ); $set_data['_canWriteMasterCss'] = ( isset( $this->skinFunctions->remapData['css'][ $set_data['set_id'] ] ) ); diff --git a/upload/admin/applications/core/modules_admin/templates/templates.php b/upload/admin/applications/core/modules_admin/templates/templates.php index 1f42a9e9..cc46316c 100644 --- a/upload/admin/applications/core/modules_admin/templates/templates.php +++ b/upload/admin/applications/core/modules_admin/templates/templates.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Template editing
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-06-30 07:54:38 -0400 (Thu, 30 Jun 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 5713 $ + * @version $Revision: 9128 $ * */ @@ -30,31 +30,27 @@ class admin_core_templates_templates extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Recursive depth guide * - * @access private * @var array */ - private $_depthGuide = array(); + protected $_depthGuide = array(); /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -64,9 +60,8 @@ class admin_core_templates_templates extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -93,8 +88,8 @@ class admin_core_templates_templates extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); @@ -119,10 +114,9 @@ class admin_core_templates_templates extends ipsCommand /** * List template sets * - * @access private - * @return void + * @return @e void */ - private function _listTemplateGroups() + protected function _listTemplateGroups() { //----------------------------------------- // INIT @@ -139,6 +133,12 @@ class admin_core_templates_templates extends ipsCommand $setData = $this->skinFunctions->fetchSkinData( $setID ); + /* is this a vised skin? */ + if ( $setData['set_by_skin_gen'] ) + { + $this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=core&module=templates&section=skinsets&do=setEdit&set_id=' . $setID ); + } + //----------------------------------------- // Fetch Template Groups //----------------------------------------- diff --git a/upload/admin/applications/core/modules_admin/templates/tools.php b/upload/admin/applications/core/modules_admin/templates/tools.php index 5b43823e..8458ee1c 100644 --- a/upload/admin/applications/core/modules_admin/templates/tools.php +++ b/upload/admin/applications/core/modules_admin/templates/tools.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Skin tools
    - * Last Updated: $Date: 2010-10-11 20:21:22 -0400 (Mon, 11 Oct 2010) $
    + * Last Updated: $Date: 2011-05-27 15:29:26 -0400 (Fri, 27 May 2011) $
      * 
    * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6962 $ + * @version $Revision: 8913 $ * */ @@ -32,14 +32,14 @@ class admin_core_templates_tools extends ipsCommand * * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Skin object * * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits @@ -80,9 +80,9 @@ class admin_core_templates_tools extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/ $this->skinFunctions = new skinImportExport( $registry ); @@ -159,7 +159,7 @@ class admin_core_templates_tools extends ipsCommand /** * Cleans out CSS DB * - * @return void + * @return @e void */ public function _toolCacheClean() { @@ -186,7 +186,7 @@ class admin_core_templates_tools extends ipsCommand /** * Cleans out CSS DB * - * @return void + * @return @e void */ public function _cssDbClean() { @@ -198,7 +198,7 @@ class admin_core_templates_tools extends ipsCommand /** * Cleans out template DB * - * @return void + * @return @e void */ public function _templateDbClean() { @@ -210,16 +210,16 @@ class admin_core_templates_tools extends ipsCommand /** * Creates the master skin * - * @return void + * @return @e void */ public function _createMasterSkin() { /* No dir? create */ if ( ! is_dir( IPS_CACHE_PATH . 'cache/skin_cache/master_skin' ) ) { - if ( @mkdir( IPS_CACHE_PATH . 'cache/skin_cache/master_skin', 0777 ) ) + if ( @mkdir( IPS_CACHE_PATH . 'cache/skin_cache/master_skin', IPS_FOLDER_PERMISSION ) ) { - @chmod( IPS_CACHE_PATH . 'cache/skin_cache/master_skin', 0777 ); + @chmod( IPS_CACHE_PATH . 'cache/skin_cache/master_skin', IPS_FOLDER_PERMISSION ); } else { @@ -236,9 +236,9 @@ class admin_core_templates_tools extends ipsCommand /** * Rebuild everything for a release * - * @return void + * @return @e void */ - private function _rebuildForRelease() + protected function _rebuildForRelease() { //----------------------------------------- // INIT @@ -254,7 +254,7 @@ class admin_core_templates_tools extends ipsCommand // Can do .. stuff? //----------------------------------------- - if ( ! is_writable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins' ) ) + if ( ! is_writable( IPS_ROOT_PATH . 'setup/xml/skins' ) ) { $this->registry->output->global_error = $this->lang->words['to_writetoprs']; return $this->_splash(); @@ -323,17 +323,17 @@ class admin_core_templates_tools extends ipsCommand /* Build and write XML files for replacements and CSS */ $replacementsXML = $this->skinFunctions->generateReplacementsXML( $id, FALSE ); - @unlink( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml', $replacementsXML ); + @unlink( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml', $replacementsXML ); if ( $replacementsXML ) { - if ( ! @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml', $replacementsXML ) ) + if ( ! @file_put_contents( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml', $replacementsXML ) ) { - $errors[] = "{$this->lang->words['to_couldnotwrite']}: " . DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml'; + $errors[] = "{$this->lang->words['to_couldnotwrite']}: " . IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml'; } else { - $messages[] = "{$this->lang->words['to_wrote']} " . DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml'; + $messages[] = "{$this->lang->words['to_wrote']} " . IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml'; } } @@ -360,15 +360,15 @@ class admin_core_templates_tools extends ipsCommand /* Generate skin sets XML */ $skinSetXML = $this->skinFunctions->generateMasterSkinSetXML( $skinIDs ); - @unlink( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/setsData.xml' ); + @unlink( IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml' ); - if ( ! @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/setsData.xml', $skinSetXML ) ) + if ( ! @file_put_contents( IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml', $skinSetXML ) ) { - $errors[] = "{$this->lang->words['to_couldnotwrite']}: " . DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/setsData.xml'; + $errors[] = "{$this->lang->words['to_couldnotwrite']}: " . IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml'; } else { - $messages[] = "{$this->lang->words['to_wrote']} " . DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/setsData.xml'; + $messages[] = "{$this->lang->words['to_wrote']} " . IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml'; } $messages[] = $this->lang->words['to_alldone']; @@ -386,7 +386,7 @@ class admin_core_templates_tools extends ipsCommand * @param int [Set ID to import, default is all] * @return string HTML */ - private function _inDevMasterCSS( $setId=false ) + protected function _inDevMasterCSS( $setId=false ) { /* This is which skins we want to export for default installations */ $skinIDs = array_keys( $this->skinFunctions->remapData['css'] ); @@ -422,7 +422,7 @@ class admin_core_templates_tools extends ipsCommand * * @return string HTML */ - private function _inDevMasterReplacements() + protected function _inDevMasterReplacements() { $skinIDs = array_keys( $this->skinFunctions->remapData['templates'] ); $messages = array(); @@ -450,9 +450,9 @@ class admin_core_templates_tools extends ipsCommand /** * Imports all APP templates * - * @return void + * @return @e void */ - private function _importAPPTemplates() + protected function _importAPPTemplates() { //----------------------------------------- // Easy one this... @@ -470,9 +470,9 @@ class admin_core_templates_tools extends ipsCommand /** * Exports all APP templates * - * @return void + * @return @e void */ - private function _exportAPPTemplates() + protected function _exportAPPTemplates() { //----------------------------------------- // Easy one this... @@ -490,9 +490,9 @@ class admin_core_templates_tools extends ipsCommand /** * Exports all APP templates * - * @return void + * @return @e void */ - private function _exportAPPCSS() + protected function _exportAPPCSS() { //----------------------------------------- // Easy one this... @@ -510,9 +510,9 @@ class admin_core_templates_tools extends ipsCommand /** * Exports Replacements to XML * - * @return void + * @return @e void */ - private function _exportReplacements() + protected function _exportReplacements() { //----------------------------------------- // INIT @@ -542,15 +542,15 @@ class admin_core_templates_tools extends ipsCommand /* Build and write XML files for replacements and CSS */ $replacementsXML = $this->skinFunctions->generateReplacementsXML( $id, FALSE ); - @unlink( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml', $replacementsXML ); + @unlink( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml', $replacementsXML ); - if ( ! @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml', $replacementsXML ) ) + if ( ! @file_put_contents( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml', $replacementsXML ) ) { - $errors[] = "{$this->lang->words['to_couldnotwrite']}: " . DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml'; + $errors[] = "{$this->lang->words['to_couldnotwrite']}: " . IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml'; } else { - $messages[] = "{$this->lang->words['to_wrote']} " . DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/resources/skins/replacements_' . $key . '.xml'; + $messages[] = "{$this->lang->words['to_wrote']} " . IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml'; } /* Got any errors? */ @@ -573,9 +573,9 @@ class admin_core_templates_tools extends ipsCommand /** * Rebuild PHP Templates Cache * - * @return void + * @return @e void */ - private function _rebuildMasterSkin() + protected function _rebuildMasterSkin() { $messages = array(); $errors = array(); @@ -620,7 +620,7 @@ class admin_core_templates_tools extends ipsCommand * * @return string HTML */ - private function _resetSkin() + protected function _resetSkin() { //----------------------------------------- // INIT @@ -662,7 +662,7 @@ class admin_core_templates_tools extends ipsCommand * * @return string HTML */ - private function _rebuildMaster() + protected function _rebuildMaster() { //----------------------------------------- // INIT @@ -733,9 +733,9 @@ class admin_core_templates_tools extends ipsCommand /** * Rebuild PHP Templates Cache * - * @return void + * @return @e void */ - private function _recache() + protected function _recache() { //----------------------------------------- // INIT @@ -754,6 +754,8 @@ class admin_core_templates_tools extends ipsCommand if( $setID == -1 ) { + $this->registry->output->global_message = $this->lang->words['to_recache_done']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=overview', TRUE ); } @@ -819,24 +821,24 @@ class admin_core_templates_tools extends ipsCommand } /* More to go.. */ - $this->registry->output->redirect( $this->settings['base_url'] . 'app=core&module=templates§ion=tools&do=toolsRecache&type=all&setID=' . $nextID, $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'], 2, TRUE ); + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . 'app=core&module=templates§ion=tools&do=toolsRecache&type=all&setID=' . $nextID, $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ); + return; } else { - /* All done */ - $this->registry->output->global_message = $this->lang->words['to_recache_done']; - if ( count( $errors ) ) { $this->registry->output->global_error = implode( '
    ', $errors ); } - $this->registry->output->redirect( $this->settings['base_url'] . 'app=core&module=templates§ion=tools&do=toolsRecache&type=all&setID=-1', $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'], 2, TRUE ); + + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . 'app=core&module=templates§ion=tools&do=toolsRecache&type=all&setID=-1', $this->lang->words['to_recachedset'] . $this->registry->output->allSkins[ $setID ]['set_name'] ); + return; } } else { /* All done */ - $this->registry->output->global_message = $this->lang->words['to_recache_done'] . '
    ' . implode( '
    ', $messages ); + $this->registry->output->setMessage( $this->lang->words['to_recache_done'] . '
    ' . implode( '
    ', $messages ), true ); if ( count( $errors ) ) { @@ -850,9 +852,9 @@ class admin_core_templates_tools extends ipsCommand /** * Rebuild PHP Templates Cache * - * @return void + * @return @e void */ - private function _rebuildPHPTemplates() + protected function _rebuildPHPTemplates() { //----------------------------------------- // INIT @@ -882,7 +884,7 @@ class admin_core_templates_tools extends ipsCommand /** * Shows a list of available tools * - * @return void + * @return @e void */ public function _splash() { diff --git a/upload/admin/applications/core/modules_admin/templates/urlmap.php b/upload/admin/applications/core/modules_admin/templates/urlmap.php index fac786dd..3bfd8a28 100644 --- a/upload/admin/applications/core/modules_admin/templates/urlmap.php +++ b/upload/admin/applications/core/modules_admin/templates/urlmap.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Skin URL mapping
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 2.3.x - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ * */ @@ -30,23 +30,20 @@ class admin_core_templates_urlmap extends ipsCommand /** * Skin Functions Class * - * @access private * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -56,9 +53,8 @@ class admin_core_templates_urlmap extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -85,8 +81,8 @@ class admin_core_templates_urlmap extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); @@ -131,10 +127,9 @@ class admin_core_templates_urlmap extends ipsCommand /** * Remove a remap * - * @access private - * @return void + * @return @e void */ - private function _remapRemove() + protected function _remapRemove() { //-------------------------------------------- // INIT @@ -166,11 +161,10 @@ class admin_core_templates_urlmap extends ipsCommand /** * Save the form * - * @access private * @param string Type of form * @return string HTML */ - private function _remapSave( $type='add' ) + protected function _remapSave( $type='add' ) { //-------------------------------------------- // INIT @@ -247,11 +241,10 @@ class admin_core_templates_urlmap extends ipsCommand /** * Remap form * - * @access private * @param string Type of form * @return string HTML */ - private function _remapForm( $type='add' ) + protected function _remapForm( $type='add' ) { //----------------------------------------- // INIT @@ -304,9 +297,9 @@ class admin_core_templates_urlmap extends ipsCommand // Form elements //----------------------------------------- - $form['map_title'] = $this->registry->getClass('output')->formInput( 'map_title' , IPSText::htmlspecialchars( ( isset($_POST['map_title']) AND $_POST['map_title'] ) ? $_POST['map_title'] : $remap['map_title'] ) ); - $form['map_match_type'] = $this->registry->getClass('output')->formDropdown( 'map_match_type' , $map_match_type, ( isset($_POST['map_match_type']) AND $_POST['map_match_type'] ) ? $_POST['map_match_type'] : $remap['map_match_type'] ); - $form['map_url'] = $this->registry->getClass('output')->formInput( 'map_url' , IPSText::htmlspecialchars( ( isset($_POST['map_url']) AND $_POST['map_url'] ) ? $_POST['map_url'] : $remap['map_url'] ) ); + $form['map_title'] = $this->registry->getClass('output')->formInput( 'map_title' , IPSText::htmlspecialchars( !empty($_POST['map_title']) ? $_POST['map_title'] : $remap['map_title'] ) ); + $form['map_match_type'] = $this->registry->getClass('output')->formDropdown( 'map_match_type' , $map_match_type, !empty($_POST['map_match_type']) ? $_POST['map_match_type'] : $remap['map_match_type'] ); + $form['map_url'] = $this->registry->getClass('output')->formInput( 'map_url' , IPSText::htmlspecialchars( !empty($_POST['map_url']) ? $_POST['map_url'] : $remap['map_url'] ) ); //----------------------------------------- // Navvy Gation @@ -325,10 +318,9 @@ class admin_core_templates_urlmap extends ipsCommand /** * Show URL maps for this skin set * - * @access private - * @return void + * @return @e void */ - private function _showURLMappingList() + protected function _showURLMappingList() { //----------------------------------------- // INIT diff --git a/upload/admin/applications/core/modules_admin/templates/useragents.php b/upload/admin/applications/core/modules_admin/templates/useragents.php index 18b3fa62..758ceddf 100644 --- a/upload/admin/applications/core/modules_admin/templates/useragents.php +++ b/upload/admin/applications/core/modules_admin/templates/useragents.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Gallery Application
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-07-28 05:42:41 -0400 (Thu, 28 Jul 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6995 $ + * @version $Revision: 9328 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,21 +30,21 @@ class admin_core_templates_useragents extends ipsCommand * * @var object */ - private $skinFunctions; + protected $skinFunctions; /** * User agent functions * * @var object UA functions */ - private $userAgentFunctions; + protected $userAgentFunctions; /** * Skin object * * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits @@ -59,7 +59,7 @@ class admin_core_templates_useragents extends ipsCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -86,8 +86,8 @@ class admin_core_templates_useragents extends ipsCommand // Load functions and cache classes //----------------------------------------- - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' ); - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ $this->skinFunctions = new skinCaching( $registry ); $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php', 'userAgentFunctions' ); @@ -120,7 +120,7 @@ class admin_core_templates_useragents extends ipsCommand * * @return string HTML */ - private function _saveAgents() + protected function _saveAgents() { //----------------------------------------- // INIT @@ -203,9 +203,9 @@ class admin_core_templates_useragents extends ipsCommand /** * Show useragents for this skin set * - * @return void + * @return @e void */ - private function _showUserAgentMapping() + protected function _showUserAgentMapping() { //----------------------------------------- // INIT @@ -247,4 +247,4 @@ class admin_core_templates_useragents extends ipsCommand $this->registry->output->html .= $this->html->useragents_showUserAgents( $userAgents, $userAgentGroups, $setData ); } -} \ No newline at end of file +} diff --git a/upload/admin/applications/core/modules_admin/templates/xml/index.html b/upload/admin/applications/core/modules_admin/templates/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/templates/xml/index.html +++ b/upload/admin/applications/core/modules_admin/templates/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/templates/xml/menu.xml b/upload/admin/applications/core/modules_admin/templates/xml/menu.xml index 45b5181f..c987cef1 100644 --- a/upload/admin/applications/core/modules_admin/templates/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/templates/xml/menu.xml @@ -6,8 +6,10 @@ Управление стилями + skins_manage skinsets do=overview + settemplates_manage 0 @@ -17,32 +19,75 @@ Инструменты стилей + skins_tools tools do=splash + template_tools 0 + +
    + + Сравнение стилей + Сравнение + skins_merge skindiff do=overview + skindiff_reports 0 + + + + Поиск и замена + Поиск и замена + skins_sar searchandreplace do=showform + templates_manage 0 + + + + Смена логотипа + Смена логотипа + skins_logo easylogo + easy_logo 0 + + + + Импорт / Экспорт + Импорт / Экспорт + skins_ie importexport do=overview + settemplates_export + 0 + + + + + Внешнее редактирование + + + Внешнее редактирование + skins_external + external + do=overview + settemplates_external 0 diff --git a/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml b/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml index b756f2d5..ce4d0acf 100644 --- a/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml @@ -2,6 +2,7 @@ Управление стилями + core_templates css_manage @@ -63,6 +64,10 @@ easy_logo Может воспользоваться инструментом смены логотипа? + + settemplates_external + Может редактировать стиль? + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/api.php b/upload/admin/applications/core/modules_admin/tools/api.php index 3f09bfdf..02d25402 100644 --- a/upload/admin/applications/core/modules_admin/tools/api.php +++ b/upload/admin/applications/core/modules_admin/tools/api.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * API Users
    - * Last Updated: $Date: 2010-10-11 20:21:22 -0400 (Mon, 11 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 1st march 2002 - * @version $Revision: 6962 $ + * @version $Revision: 8644 $ * */ @@ -30,33 +30,29 @@ class admin_core_tools_api extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /** * Shortcut for url * - * @access private * @var string URL shortcut */ - private $form_code; + protected $form_code; /** * Shortcut for url (javascript) * - * @access private * @var string JS URL shortcut */ - private $form_code_js; + protected $form_code_js; /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -127,12 +123,11 @@ class admin_core_tools_api extends ipsCommand * API Logs View * View API Log * - * @access private - * @return void [Outputs] + * @return @e void [Outputs] * @author Matt Mecham * @since 2.3.2 */ - private function logViewDetail() + public function logViewDetail() { //----------------------------------------- // Fix up navigation bar @@ -189,12 +184,11 @@ class admin_core_tools_api extends ipsCommand * API Logs List * List API Logs * - * @access private - * @return void [Outputs] + * @return @e void [Outputs] * @author Matt Mecham * @since 2.3.2 */ - private function logList() + public function logList() { //----------------------------------------- // Fix up navigation bar @@ -226,7 +220,7 @@ class admin_core_tools_api extends ipsCommand $links = $this->registry->output->generatePagination( array( 'totalItems' => intval( $count['count'] ), 'itemsPerPage' => $perpage, 'currentStartValue' => $start, - 'baseUrl' => $this->settings['base_url'].'&'.$this->form_code ) ); + 'baseUrl' => $this->settings['base_url'] . $this->form_code . '&do=log_list' ) ); //----------------------------------------- // Get from DB @@ -255,12 +249,11 @@ class admin_core_tools_api extends ipsCommand * API User Remove * Removes an API User * - * @access private - * @return void [Outputs] + * @return @e void [Outputs] * @author Matt Mecham * @since 2.3.2 */ - private function apiRemove() + public function apiRemove() { $api_user_id = $this->request['api_user_id'] ? intval($this->request['api_user_id']) : 0; @@ -292,13 +285,12 @@ class admin_core_tools_api extends ipsCommand * API Save * Save API user * - * @access private * @param string Type - * @return void [Outputs] + * @return @e void [Outputs] * @author Matt Mecham * @since 2.3.2 */ - private function apiSave( $type='add' ) + public function apiSave( $type='add' ) { //----------------------------------------- // INIT @@ -406,20 +398,19 @@ class admin_core_tools_api extends ipsCommand $this->DB->update( 'api_users', $save, 'api_user_id=' . $api_user_id ); } - $this->apiList(); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code ); } /** * API Form * Shows the add/edit form * - * @access private * @param string Type - * @return void [Outputs] + * @return @e void [Outputs] * @author Matt Mecham * @since 2.3.2 */ - private function apiForm( $type='add' ) + public function apiForm( $type='add' ) { //----------------------------------------- // INIT @@ -465,8 +456,8 @@ class admin_core_tools_api extends ipsCommand // Form //----------------------------------------- - $form['api_user_name'] = $this->registry->output->formInput( 'api_user_name', ( isset($_POST['api_user_name']) AND $_POST['api_user_name'] ) ? stripslashes($_POST['api_user_name']) : $api_user['api_user_name'] ); - $form['api_user_ip'] = $this->registry->output->formInput( 'api_user_ip', ( isset($_POST['api_user_ip']) AND $_POST['api_user_ip'] ) ? stripslashes($_POST['api_user_ip']) : $api_user['api_user_ip'] ); + $form['api_user_name'] = $this->registry->output->formInput( 'api_user_name', !empty($_POST['api_user_name']) ? stripslashes($_POST['api_user_name']) : $api_user['api_user_name'] ); + $form['api_user_ip'] = $this->registry->output->formInput( 'api_user_ip', !empty($_POST['api_user_ip']) ? stripslashes($_POST['api_user_ip']) : $api_user['api_user_ip'] ); //----------------------------------------- // Get all modules and stuff and other things @@ -482,12 +473,12 @@ class admin_core_tools_api extends ipsCommand { if ( is_dir( $path . '/' . $file ) ) { - if ( file_exists( $path . '/' . $file . '/config.php' ) ) + if ( is_file( $path . '/' . $file . '/config.php' ) ) { $CONFIG = array(); $_name = $file; - require_once( $path . "/" . $file . '/config.php' ); + require_once( $path . "/" . $file . '/config.php' );/*noLibHook*/ if ( $CONFIG['api_module_title'] ) { @@ -501,10 +492,10 @@ class admin_core_tools_api extends ipsCommand // Get all available methods //----------------------------------------- - if ( file_exists( $path . '/' . $file . '/methods.php' ) ) + if ( is_file( $path . '/' . $file . '/methods.php' ) ) { $ALLOWED_METHODS = array(); - require_once( $path . '/' . $file . '/methods.php' ); + require_once( $path . '/' . $file . '/methods.php' );/*noLibHook*/ $permissions[ $_name ]['perms'] = array_keys( $ALLOWED_METHODS ); } @@ -551,12 +542,11 @@ class admin_core_tools_api extends ipsCommand * API LIST * List all currently stored API users * - * @access private - * @return void [Outputs] + * @return @e void [Outputs] * @author Matt Mecham * @since 2.3.2 */ - private function apiList() + public function apiList() { //----------------------------------------- // INIT @@ -576,19 +566,10 @@ class admin_core_tools_api extends ipsCommand $users[] = $row; } - //----------------------------------------- - // XML RPC Enabled? - //----------------------------------------- - - if ( ! $this->settings['xmlrpc_enable'] ) - { - $this->registry->output->html .= $this->registry->output->global_template->warning_box( $this->lang->words['a_disabled'], sprintf( $this->lang->words['a_msg3'], $this->settings['base_url'] ) ) . "
    "; - } - //----------------------------------------- // Dun... //----------------------------------------- $this->registry->output->html .= $this->html->api_list( $users ); } -} +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/cache.php b/upload/admin/applications/core/modules_admin/tools/cache.php index c1cc082d..14372509 100644 --- a/upload/admin/applications/core/modules_admin/tools/cache.php +++ b/upload/admin/applications/core/modules_admin/tools/cache.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * ACP : Cache management
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 26th January 2004 - * @version $Revision: 6995 $ + * @version $Revision: 9487 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -50,7 +50,7 @@ class admin_core_tools_cache extends ipsCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -58,7 +58,7 @@ class admin_core_tools_cache extends ipsCommand // Load language //----------------------------------------- - $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ), 'core' ); //----------------------------------------- // Load skin @@ -95,6 +95,10 @@ class admin_core_tools_cache extends ipsCommand $this->cacheRecache(); break; + case 'globalCachesRecache': + $this->globalCachesRecache(); + break; + case 'cache_update_all_process': $this->cacheUpdateAllProcess(); break; @@ -115,9 +119,9 @@ class admin_core_tools_cache extends ipsCommand /** * View an individual cache store contents * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _contentCache() + protected function _contentCache() { $type = $this->request['type']; $method = $this->request['method']; @@ -139,7 +143,7 @@ class admin_core_tools_cache extends ipsCommand /** * View an individual cache store contents * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function cacheView() { @@ -183,7 +187,7 @@ class admin_core_tools_cache extends ipsCommand ob_end_clean(); - $this->registry->output->html = $this->html->cache_pop_up( $id, htmlspecialchars($out) ); + $this->registry->output->html .= $this->html->cache_pop_up( $id, htmlspecialchars($out) ); $this->registry->output->printPopupWindow(); } @@ -191,7 +195,7 @@ class admin_core_tools_cache extends ipsCommand /** * Rebuild all caches * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function cacheUpdateAllProcess() { @@ -220,10 +224,10 @@ class admin_core_tools_cache extends ipsCommand { $_file = IPSLib::getAppDir( $app_dir ) . '/extensions/coreVariables.php'; - if ( file_exists( $_file ) ) + if ( is_file( $_file ) ) { $CACHE = array(); - require( $_file ); + require( $_file );/*maybeLibHook*/ foreach( $CACHE as $k => $v ) { @@ -271,7 +275,7 @@ class admin_core_tools_cache extends ipsCommand /** * Recache an individual cache * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function cacheRecache() { @@ -293,11 +297,42 @@ class admin_core_tools_cache extends ipsCommand $this->registry->output->global_message = $this->lang->words['c_recachethecachegetitgotitgood']; $this->cacheOverview(); } + + /** + * Recache the global caches + * + * @return @e void [Outputs to screen] + */ + public function globalCachesRecache() + { + try + { + IPSLib::cacheGlobalCaches(); + $msg = $this->lang->words['gcaches_cache_rebuilt']; + } + catch( Exception $e ) + { + $msg = $e->getMessage(); + + switch( $msg ) + { + case 'CANNOT_WRITE': + $msg = $this->lang->words['gcaches_cannot_write']; + break; + case 'NO_DATA_TO_WRITE': + $msg = $this->lang->words['gcaches_no_data']; + break; + } + } + + $this->registry->output->global_message = $msg; + $this->cacheOverview(); + } /** * List all of the current caches * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function cacheOverview() { @@ -342,19 +377,14 @@ class admin_core_tools_cache extends ipsCommand // Get all application's cache lists //----------------------------------------- - foreach( ipsRegistry::$applications as $app_dir => $app_data ) + foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data ) { - if( !IPSLib::appIsInstalled( $app_dir ) ) - { - continue; - } - $_file = IPSLib::getAppDir( $app_dir ) . '/extensions/coreVariables.php'; - if ( file_exists( $_file ) ) + if ( is_file( $_file ) ) { $CACHE = array(); - require( $_file ); + require( $_file );/*maybeLibHook*/ foreach( $CACHE as $cache_name => $cache_data ) { @@ -379,19 +409,6 @@ class admin_core_tools_cache extends ipsCommand /* Content Cache Stuffs */ if ( IPSContentCache::isEnabled() ) { - /* Monitor? */ - if ( $this->settings['cc_monitor'] ) - { - $cache = $this->cache->getCache('ccMonitor'); - - $cacheContent['m_posts'] = sprintf( $this->lang->words['served_data'], intval( $cache['post']['raw'] ), intval( $cache['post']['cached'] ) ); - $cacheContent['m_sigs'] = sprintf( $this->lang->words['served_data'], intval( $cache['sig']['raw'] ), intval( $cache['sig']['cached'] ) ); - } - else - { - $cacheContent['m_posts'] = $cacheContent['m_sigs'] = $this->lang->words['no_monitoring_data']; - } - /* Get all posts */ $cacheContent['posts'] = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', 'from' => 'posts' ) ); @@ -429,22 +446,22 @@ class admin_core_tools_cache extends ipsCommand */ public function rebuildRssCache( $app='' ) { - $retrieved = array( time() + 60*60 ); + if( defined('IPS_IS_UPGRADER') AND IPS_IS_UPGRADER ) + { + return array(); + } - foreach( ipsRegistry::$applications as $app_dir => $app_data ) + $retrieved = array(); + + foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data ) { if ( ( ! empty( $app ) AND $app == $app_dir ) || empty( $app ) ) { - if ( ! IPSLib::appIsInstalled( $app_dir ) ) - { - continue; - } - //----------------------------------------- // Retrieve the RSS links for the header //----------------------------------------- - if( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/rssOutput.php' ) ) + if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/rssOutput.php' ) ) { $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/rssOutput.php', 'rss_output_' . $app_dir, $app_dir ); diff --git a/upload/admin/applications/core/modules_admin/tools/defaultSection.php b/upload/admin/applications/core/modules_admin/tools/defaultSection.php index 1019dd48..549af6ce 100644 --- a/upload/admin/applications/core/modules_admin/tools/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/tools/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default tools section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'tools' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: bfarber $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $ + * @version v3.2.3 + * $Revision: 9373 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'settings'; \ No newline at end of file +$DEFAULT_SECTION = 'licensekey'; diff --git a/upload/admin/applications/core/modules_admin/tools/help.php b/upload/admin/applications/core/modules_admin/tools/help.php index 54d1c8f7..73201329 100644 --- a/upload/admin/applications/core/modules_admin/tools/help.php +++ b/upload/admin/applications/core/modules_admin/tools/help.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Help Files
    - * Last Updated: $LastChangedDate: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $LastChangedDate: 2011-09-20 08:16:45 -0400 (Tue, 20 Sep 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6995 $ + * @link http://hatynka.in + * @version $Rev: 9513 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,13 +30,13 @@ class admin_core_tools_help extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -52,7 +52,7 @@ class admin_core_tools_help extends ipsCommand switch( $this->request['do'] ) { case 'edit': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'help_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'helpfiles_manage' ); $this->helpFileForm( 'edit' ); break; @@ -67,7 +67,7 @@ class admin_core_tools_help extends ipsCommand break; case 'doreorder': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'help_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'helpfiles_manage' ); $this->helpFilesReorder(); break; @@ -82,18 +82,18 @@ class admin_core_tools_help extends ipsCommand break; case 'exportXml': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'help_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'helpfiles_manage' ); $this->helpFilesXMLExport(); break; case 'importXml': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'help_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'helpfiles_manage' ); $this->helpFilesXMLImport(); break; case 'help_overview': default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'help_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'helpfiles_manage' ); $this->helpFilesList(); break; } @@ -106,7 +106,7 @@ class admin_core_tools_help extends ipsCommand /** * Import help files XML * - * @return void + * @return @e void */ public function helpFilesXMLImport() { @@ -128,7 +128,7 @@ class admin_core_tools_help extends ipsCommand } } - $this->registry->output->global_message = $this->lang->words['h_imported'] . "
    " . implode( "
    ", $messages ); + $this->registry->output->setMessage( $this->lang->words['h_imported'] . "
    " . implode( "
    ", $messages ), 1 ); $this->helpFilesList(); } @@ -147,9 +147,9 @@ class admin_core_tools_help extends ipsCommand $processed = array( 'added' => 0, 'updated' => 0 ); /* Got anything to import? */ - if ( file_exists( $file ) ) + if ( is_file( $file ) ) { - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ $xml = new classXML( IPS_DOC_CHAR_SET ); $xml->load( $file ); @@ -192,14 +192,14 @@ class admin_core_tools_help extends ipsCommand /** * Export help files XML * - * @return void + * @return @e void */ public function helpFilesXMLExport() { /* INIT */ $entry = array(); - require_once( IPS_KERNEL_PATH.'classXML.php' ); + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ /* Loop through all the applications */ foreach( $this->registry->getApplications() as $app => $__data ) @@ -232,11 +232,11 @@ class admin_core_tools_help extends ipsCommand @unlink( IPSLib::getAppDir( $app ) . '/xml/' . $app . '_help.xml' ); /* Write */ - if( $doc and $c) + if( $doc and $c ) { - $fh = fopen( IPSLib::getAppDir( $app ) . '/xml/' . $app . '_help.xml', 'w' ); - fwrite( $fh, $doc ); - fclose( $fh ); + $fh = @fopen( IPSLib::getAppDir( $app ) . '/xml/' . $app . '_help.xml', 'w' ); + @fwrite( $fh, $doc ); + @fclose( $fh ); } /* In dev time stamp? */ @@ -255,7 +255,7 @@ class admin_core_tools_help extends ipsCommand /** * Removes a help file * - * @return void + * @return @e void * @author Josh */ public function helpFileRemove() @@ -279,7 +279,7 @@ class admin_core_tools_help extends ipsCommand * Handles the add/edit help file form * * @param string $type Either new or edit - * @return void + * @return @e void */ public function handleHelpFileForm( $type='new' ) { @@ -337,7 +337,7 @@ class admin_core_tools_help extends ipsCommand * Form for adding/editing help files * * @param string $type New or edit - * @return void + * @return @e void */ public function helpFileForm( $type='new' ) { @@ -392,7 +392,7 @@ class admin_core_tools_help extends ipsCommand $form['title'] = $this->registry->output->formInput('title' , $r['title'] ); $form['description'] = $this->registry->output->formTextarea('description', $r['description'] ); $form['appDir'] = $this->registry->output->formDropdown( 'appDir', $dropdown, $r['app'] ); - $form['text'] = $r['text']; + $form['text'] = IPSText::textToForm( $r['text'] ); /* Ouput */ $this->registry->output->html .= $this->html->helpFileForm( $code, $id, $form, $button ); @@ -401,7 +401,7 @@ class admin_core_tools_help extends ipsCommand /** * Reorders help files * - * @return void + * @return @e void */ public function helpFilesReorder() { @@ -446,7 +446,7 @@ class admin_core_tools_help extends ipsCommand /** * List current help files * - * @return void + * @return @e void */ public function helpFilesList() { diff --git a/upload/admin/applications/core/modules_admin/tools/incomingEmails.php b/upload/admin/applications/core/modules_admin/tools/incomingEmails.php index e37cae2f..31be1b50 100644 --- a/upload/admin/applications/core/modules_admin/tools/incomingEmails.php +++ b/upload/admin/applications/core/modules_admin/tools/incomingEmails.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Incoming Email Routing
    - * Last Updated: $LastChangedDate: 2010-10-04 11:44:10 -0400 (Mon, 04 Oct 2010) $
    + * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: mark $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6938 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,9 +28,8 @@ class admin_core_tools_incomingEmails extends ipsCommand /** * Main entry point * - * @access public * @param object ipsRegistry reference - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -39,6 +38,8 @@ class admin_core_tools_incomingEmails extends ipsCommand $this->html = $this->registry->output->loadTemplate( 'cp_skin_tools' ); $this->form_code = $this->html->form_code = 'module=tools&section=incomingEmails'; + + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'incomingemail_manage' ); /* What to do */ switch( $this->request['do'] ) @@ -74,12 +75,11 @@ class admin_core_tools_incomingEmails extends ipsCommand /** * Test POP3 * - * @access public - * @return void + * @return @e void */ protected function test() { - require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' ); + require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );/*noLibHook*/ $pop3 = new pop3_class; $pop3->hostname = $this->settings['pop3_server']; @@ -126,8 +126,7 @@ class admin_core_tools_incomingEmails extends ipsCommand /** * Manage Rules * - * @access public - * @return void + * @return @e void */ protected function manage() { @@ -149,8 +148,7 @@ class admin_core_tools_incomingEmails extends ipsCommand /** * Show Form * - * @access public - * @return void + * @return @e void */ protected function form( $type ) { @@ -168,7 +166,7 @@ class admin_core_tools_incomingEmails extends ipsCommand $applications = array(); foreach ( ipsRegistry::$applications as $dir => $app ) { - if ( file_exists( IPSLib::getAppDir( $dir ) . '/extensions/incomingEmails.php' ) ) + if ( is_file( IPSLib::getAppDir( $dir ) . '/extensions/incomingEmails.php' ) ) { $applications[] = array( $dir, $this->lang->words['ie_sendto'] . $app['app_title'] ); } diff --git a/upload/admin/applications/core/modules_admin/tools/index.html b/upload/admin/applications/core/modules_admin/tools/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/tools/index.html +++ b/upload/admin/applications/core/modules_admin/tools/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/licensekey.php b/upload/admin/applications/core/modules_admin/tools/licensekey.php index d6afa4c4..eab1f498 100644 --- a/upload/admin/applications/core/modules_admin/tools/licensekey.php +++ b/upload/admin/applications/core/modules_admin/tools/licensekey.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * License Manager
    - * Last Updated: $LastChangedDate$
    + * Last Updated: $LastChangedDate: 2011-09-26 16:02:02 -0400 (Mon, 26 Sep 2011) $
      * 
    * - * @author $Author$ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev$ + * @link http://hatynka.in + * @version $Rev: 9551 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,8 +29,8 @@ class admin_core_tools_licensekey extends ipsCommand * HTML object * * @var object - **/ - private $html; + */ + protected $html; /**#@+ * URL bits @@ -45,7 +45,7 @@ class admin_core_tools_licensekey extends ipsCommand * Main entry point * * @param object ipsRegistry reference - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -56,6 +56,10 @@ class admin_core_tools_licensekey extends ipsCommand /* URLs */ $this->form_code = $this->html->form_code = 'module=tools&section=licensekey'; $this->form_code_js = $this->html->form_code_js = 'module=tools§ion=licensekey'; + + /* We need a classFileManagement object */ + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); + $this->classFileManagement = new $classToLoad(); /* What to do */ switch( $this->request['do'] ) @@ -78,10 +82,11 @@ class admin_core_tools_licensekey extends ipsCommand $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); $this->registry->output->sendOutput(); } + /** * Removes a license key * - * @return void + * @return @e void */ public function remove() { @@ -99,21 +104,19 @@ class admin_core_tools_licensekey extends ipsCommand /** * Activates a license * - * @return void + * @return @e void */ public function activate() { - /* Get the file managemnet class */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $query = new $classToLoad(); - $query->use_sockets = 1; - /* Query the api */ + $response = $this->classFileManagement->getFileContents( "http://myipb.in/license.php?api=activateKey&lk={$this->request['license_key']}&domain=".urlencode($this->request['domain_key']) ); /* Decode */ - $this->DB->update( 'core_sys_conf_settings', array( 'conf_value' => $this->request['license_key'] ), "conf_key='ipb_reg_number'" ); - $this->cache->rebuildCache( 'settings', 'global' ); - $this->cache->setCache( 'licenseData', array(), array( 'array' => 1 ) ); + $response = json_decode( $response, true ); + + $this->DB->update( 'core_sys_conf_settings', array( 'conf_value' => $this->request['license_key'] ), "conf_key='ipb_reg_number'" ); + $this->cache->rebuildCache( 'settings', 'global' ); + $this->cache->setCache( 'licenseData', array(), array( 'array' => 1 ) ); $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code ); } @@ -121,7 +124,7 @@ class admin_core_tools_licensekey extends ipsCommand /** * Displays license information * - * @return void + * @return @e void */ public function overview() { @@ -137,17 +140,27 @@ class admin_core_tools_licensekey extends ipsCommand if( ! $licenseData || $this->request['refresh'] == 1 || ( IPS_UNIX_TIME_NOW - $licenseData['_cached_date'] ) > 86400 ) { - /* Get the file managemnet class */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $query = new $classToLoad(); - $query->use_sockets = 1; - /* Query the api */ - - /* Get License Data */ + $response = $this->classFileManagement->getFileContents( "http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" ); + /* Get License Data */ + $licenseData = json_decode( $response, true ); + + /* Copyright Removal? */ + if ( $licenseData['cr'] ) + { + IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) ); + } + elseif ( $this->settings['ips_cp_purchase'] ) + { + IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) ); + } + /* Save to cache */ - $licenseData['_cached_date'] = time(); + $licenseData['_cached_date'] = time(); + $licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999; + $licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999; + $this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) ); } @@ -161,7 +174,7 @@ class admin_core_tools_licensekey extends ipsCommand /** * Displays license key status * - * @return void + * @return @e void */ public function activateForm() { diff --git a/upload/admin/applications/core/modules_admin/tools/login.php b/upload/admin/applications/core/modules_admin/tools/login.php index 67a1dd10..0ed94cb9 100644 --- a/upload/admin/applications/core/modules_admin/tools/login.php +++ b/upload/admin/applications/core/modules_admin/tools/login.php @@ -2,19 +2,20 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Login Manager Administration
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-09-08 15:22:26 -0400 (Thu, 08 Sep 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Thursday 26th January 2006 (11:03) - * @version $Revision: 6995 $ + * @version $Revision: 9469 $ + * */ if ( ! defined( 'IN_IPB' ) ) @@ -30,27 +31,27 @@ class admin_core_tools_login extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Shortcut for url * * @var string URL shortcut */ - private $form_code; + protected $form_code; /** * Shortcut for url (javascript) * * @var string JS URL shortcut */ - private $form_code_js; + protected $form_code_js; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -148,7 +149,7 @@ class admin_core_tools_login extends ipsCommand * * @return boolean Saved or not */ - private function _loginSaveConf() + protected function _loginSaveConf() { //----------------------------------------- // Init Vars @@ -168,44 +169,23 @@ class admin_core_tools_login extends ipsCommand $this->_loginList(); return false; } - - //----------------------------------------- - // Generate file path - //----------------------------------------- - - $mypath = IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name']; - + //----------------------------------------- // Check (still waiting) //----------------------------------------- - if( !file_exists( $mypath . '/acp.php' ) ) + if( !is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/acp.php' ) ) { ipsRegistry::getClass('output')->global_message = $this->lang->words['l_noconfig']; $this->_loginList(); return false; } - - if( !file_exists( $mypath . '/conf.php' ) ) - { - ipsRegistry::getClass('output')->global_message = $this->lang->words['l_noconfigfile']; - $this->_loginList(); - return false; - } - - if( !is_writable( $mypath . '/conf.php' ) ) - { - ipsRegistry::getClass('output')->global_message = $mypath . $this->lang->words['l_confwrite']; - $this->_loginList(); - return false; - } - + //----------------------------------------- - // We all good? + // Check our ACP options file //----------------------------------------- $config = array(); - require_once( $mypath . '/acp.php' ); - require_once( $mypath . '/conf.php' ); + require_once( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/acp.php' );/*noLibHook*/ if( !is_array($config) OR !count($config) ) { @@ -215,7 +195,7 @@ class admin_core_tools_login extends ipsCommand } //----------------------------------------- - // Teh form + // Save //----------------------------------------- $save = array(); @@ -228,26 +208,17 @@ class admin_core_tools_login extends ipsCommand } } - $conf_file = '<' . '?php' . "\n\n"; + $this->DB->update( 'login_methods', array( 'login_custom_config' => serialize( $save ) ), 'login_id=' . $login_id ); - foreach( $save as $k => $v ) - { - $conf_file .= '$LOGIN_CONF[' . "'" . $k . "'] = " . '"' . addslashes( $v ) . '";' . "\n"; - } + //----------------------------------------- + // Recache + //----------------------------------------- - $conf_file .= "\n\n?" . '>'; - - if( $fh = @fopen( $mypath . '/conf.php', 'w' ) ) - { - fwrite( $fh, $conf_file ); - fclose( $fh ); - } - else - { - ipsRegistry::getClass('output')->global_message = $mypath . $this->lang->words['l_confwrite']; - $this->_loginACPConf(); - return false; - } + $this->loginsRecache(); + + //----------------------------------------- + // And then show list + //----------------------------------------- ipsRegistry::getClass('output')->global_message = sprintf($this->lang->words['l_confup'], $login['login_title'] ); $this->_loginList(); @@ -258,8 +229,9 @@ class admin_core_tools_login extends ipsCommand * Configure details specific to a login method * * @return mixed Outputs, or return false + * @todo [Future] Remove legacy check for conf.php file in IPB 3.4 or higher */ - private function _loginACPConf() + protected function _loginACPConf() { //----------------------------------------- // Init Vars @@ -271,7 +243,7 @@ class admin_core_tools_login extends ipsCommand // Check (please?) //----------------------------------------- - $login = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'login_methods', 'where' => 'login_id=' . $login_id ) ); + $login = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'login_methods', 'where' => 'login_id=' . $login_id ) ); if ( ! $login['login_id'] ) { @@ -280,44 +252,38 @@ class admin_core_tools_login extends ipsCommand return false; } + $LOGIN_CONF = $login['login_custom_config'] ? @unserialize($login['login_custom_config']) : array(); + //----------------------------------------- - // Generate file path + // If not populated, check for flat file config (legacy) //----------------------------------------- - $mypath = IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name']; - + if( !count($LOGIN_CONF) ) + { + if( is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/conf.php' ) ) + { + require( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/conf.php' );/*noLibHook*/ + } + } + //----------------------------------------- // Check (still waiting) //----------------------------------------- - if( !file_exists( $mypath . '/acp.php' ) ) + if( !is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/acp.php' ) ) { ipsRegistry::getClass('output')->global_message = $this->lang->words['l_noconfig']; $this->_loginList(); return false; } - - if( !file_exists( $mypath . '/conf.php' ) ) - { - ipsRegistry::getClass('output')->global_message = $this->lang->words['l_noconfigfile']; - $this->_loginList(); - return false; - } - - if( !is_writable( $mypath . '/conf.php' ) ) - { - ipsRegistry::getClass('output')->global_message = $mypath . $this->lang->words['l_confwrite']; - $this->_loginList(); - return false; - } - + //----------------------------------------- - // We all good? + // Get config //----------------------------------------- - $config = array(); - $LOGIN_CONF = array(); - require_once( $mypath . '/acp.php' ); - require_once( $mypath . '/conf.php' ); + + $config = array(); + + require_once( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/acp.php' );/*noLibHook*/ if( !is_array($config) OR !count($config) ) { @@ -329,6 +295,7 @@ class admin_core_tools_login extends ipsCommand //----------------------------------------- // Teh form //----------------------------------------- + $form = array(); foreach( $config as $option ) @@ -365,7 +332,7 @@ class admin_core_tools_login extends ipsCommand * @param array Entries to add * @return string XML Document */ - private function _buildXML( $data=array() ) + protected function _buildXML( $data=array() ) { //----------------------------------------- // INIT @@ -376,22 +343,22 @@ class admin_core_tools_login extends ipsCommand //----------------------------------------- // Get XML class //----------------------------------------- - - require_once( IPS_KERNEL_PATH . 'class_xml.php' ); - $xml = new class_xml(); - $xml->doc_type = IPS_DOC_CHAR_SET; - $xml->xml_set_root( 'export', array( 'exported' => time() ) ); + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + $xml->newXMLDocument(); + $xml->addElement( 'export' ); + $xml->addElement( 'group', 'export' ); + //----------------------------------------- // Set group //----------------------------------------- - - $xml->xml_add_group( 'group' ); - + foreach( $data as $thisentry => $r ) { - $content = array(); + $r['login_enabled'] = 0; if ( $r['login_folder_name'] == 'internal' ) { @@ -405,42 +372,22 @@ class admin_core_tools_login extends ipsCommand $r['login_logout_url'] = ''; $r['login_enabled'] = 0; } - else - { - $r['login_enabled'] = 0; - } - //----------------------------------------- - // Sort the fields... - //----------------------------------------- + unset($r['login_id']); - foreach( $r as $k => $v ) - { - if( in_array( $k, array( 'login_id' ) ) ) - { - continue; - } - - $content[] = $xml->xml_build_simple_tag( $k, $v ); - } - - $entry[] = $xml->xml_build_entry( 'row', $content ); + $xml->addElementAsRecord( 'group', 'row', $r ); } - - $xml->xml_add_entry_to_group( 'group', $entry ); - - $xml->xml_format_document(); - - return $xml->xml_document; + + return $xml->fetchDocument(); } /** * Export master XML file for installer * * @param integer [Optional] Login ID - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _masterXmlExport( $login_id=0 ) + protected function _masterXmlExport( $login_id=0 ) { //----------------------------------------- // INIT @@ -485,7 +432,7 @@ class admin_core_tools_login extends ipsCommand * * @return mixed Outputs, or returns false */ - private function _loginDiagnostics() + protected function _loginDiagnostics() { //----------------------------------------- // Init Vars @@ -505,51 +452,19 @@ class admin_core_tools_login extends ipsCommand $this->_loginList(); return false; } - - //----------------------------------------- - // Generate file - //----------------------------------------- - - $mypath = IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name']; - - //----------------------------------------- - // Generate General Info - //----------------------------------------- - - $login['_enabled_img'] = $login['login_enabled'] ? 'tick.png' : 'cross.png'; - $login['_has_settings'] = $login['login_settings'] ? 'tick.png' : 'cross.png'; - - //----------------------------------------- - // File based info - //----------------------------------------- - - $login['_file_auth_exists'] = @file_exists( $mypath . '/auth.php' ) ? 'tick.png' : 'cross.png'; - $login['_file_conf_exists'] = @file_exists( $mypath . '/conf.php' ) ? 'tick.png' : 'cross.png'; - $login['_file_acp_exists'] = @file_exists( $mypath . '/acp.php' ) ? 'tick.png' : 'cross.png'; - - $login['_file_conf_write'] = @is_writable( $mypath.'/conf.php' ) ? 'tick.png' : 'cross.png'; - - /* Try to setup the module */ - require_once( IPS_PATH_CUSTOM_LOGIN . '/login_core.php' ); - require_once( IPS_PATH_CUSTOM_LOGIN . '/login_interface.php' ); - if( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/auth.php' ) ) + /* Try to setup the module */ + require_once( IPS_PATH_CUSTOM_LOGIN . '/login_core.php' );/*noLibHook*/ + require_once( IPS_PATH_CUSTOM_LOGIN . '/login_interface.php' );/*noLibHook*/ + + if( is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/auth.php' ) ) { - $classFile = IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/auth.php'; - $config = IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/conf.php'; + $LOGIN_CONF = $login['login_custom_config'] ? @unserialize($login['login_custom_config']) : array(); - if( file_exists( $config ) ) - { - $LOGIN_CONF = array(); - require( $config ); - } + $classToLoad = IPSLib::loadLibrary( IPS_PATH_CUSTOM_LOGIN . '/' . $login['login_folder_name'] . '/auth.php', 'login_' . $login['login_folder_name'] ); + $module = new $classToLoad( $this->registry, $login, $LOGIN_CONF ); - $classname = "login_" . $login['login_folder_name']; - - require_once( $classFile ); - $module = new $classname( $this->registry, $login, $LOGIN_CONF ); - - if( $module->missingModules ) + if( isset($module->missingModules) && is_array($module->missingModules) && count($module->missingModules) ) { $login['_missingModules'] = implode( ', ', $module->missingModules ); } @@ -562,9 +477,9 @@ class admin_core_tools_login extends ipsCommand * Saves the login method to the database [add,edit] * * @param string Add or Edit flag - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginSave($type='add') + protected function _loginSave($type='add') { //-------------------------------------------- // INIT @@ -671,9 +586,9 @@ class admin_core_tools_login extends ipsCommand * Shows the login method form [add,edit] * * @param string Add or Edit flag - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginForm( $type='add' ) + protected function _loginForm( $type='add' ) { //----------------------------------------- // Init Vars @@ -740,41 +655,48 @@ class admin_core_tools_login extends ipsCommand /** * Lists the login method overview screen * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginList() + protected function _loginList() { //----------------------------------------- // Output //----------------------------------------- - ipsRegistry::getClass('output')->nav[] = array( $this->form_code, $this->lang->words['l_nav'] ); - + ipsRegistry::getClass('output')->nav[] = array( $this->form_code, $this->lang->words['l_nav'] ); + + //----------------------------------------- + // Get xml class + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + //----------------------------------------- // INIT //----------------------------------------- - - require_once( IPS_KERNEL_PATH . 'class_xml.php' ); - $xml = new class_xml(); - $xml->doc_type = IPS_DOC_CHAR_SET; + $content = ""; $db_methods = array(); $dir_methods = array(); $installed = array(); - $missing = array(); //----------------------------------------- // Get login methods from database //----------------------------------------- - $this->DB->build( array( 'select' => '*', 'from' => 'login_methods' ) ); + $i = 0; + + $this->DB->build( array( 'select' => '*', 'from' => 'login_methods', 'order' => 'login_order ASC' ) ); $this->DB->execute(); while( $r = $this->DB->fetch() ) { $r['login_installed'] = 1; - $db_methods[ $r['login_order'] ] = $r; + $db_methods[ $i ] = $r; $installed[] = $r['login_folder_name']; + $i++; } ksort( $db_methods ); @@ -793,45 +715,19 @@ class admin_core_tools_login extends ipsCommand { $data = array( 'login_title' => $file, 'login_folder_name' => $file ); - if( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/loginauth_install.xml' ) ) + if( is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/loginauth_install.xml' ) ) { $file_content = file_get_contents( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/loginauth_install.xml' ); - $xml->xml_parse_document( $file_content ); + $xml->loadXML( $file_content ); - if( is_array($xml->xml_array['export']['group']['row']) ) + foreach( $xml->fetchElements('row') as $record ) { - foreach( $xml->xml_array['export']['group']['row'] as $f => $entry ) - { - if( is_array($entry) ) - { - foreach( $entry as $k => $v ) - { - if ( $f == 'VALUE' or $f == 'login_id' ) - { - continue; - } - - $data[ $f ] = $v; - } - } - } + $data = $xml->fetchElementsFromRecord( $record ); } } - $data['acp_plugin'] = 0; - - if( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/acp.php' ) ) - { - if ( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/conf.php' ) ) - { - $data['acp_plugin'] = 1; - } - else if ( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/conf.dist.php' ) ) - { - $missing[] = IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/'; - } - } + $data['acp_plugin'] = is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/acp.php' ) ? 1 : 0; $dir_methods[ $file ] = $data; } @@ -839,15 +735,6 @@ class admin_core_tools_login extends ipsCommand closedir( $dh ); } - - //----------------------------------------- - // Got some folders with the .dist.php files? - //----------------------------------------- - - if ( count( $missing ) ) - { - $this->registry->output->showError( sprintf( $this->lang->words['l_rename_conf'], implode( "
  • ", $missing ) ) ); - } //----------------------------------------- // First...we show installed methods @@ -912,9 +799,9 @@ class admin_core_tools_login extends ipsCommand /** * Toggle login method enabled/disabled * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginToggle() + protected function _loginToggle() { //-------------------------------------------- // INIT @@ -968,9 +855,9 @@ class admin_core_tools_login extends ipsCommand /** * Uninstall a login method * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginUninstall() + protected function _loginUninstall() { //-------------------------------------------- // INIT @@ -1008,18 +895,17 @@ class admin_core_tools_login extends ipsCommand /** * Install a login method * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginInstall() + protected function _loginInstall() { - //-------------------------------------------- - // INIT - //-------------------------------------------- - - require_once( IPS_KERNEL_PATH . 'class_xml.php' ); - $xml = new class_xml(); - $xml->doc_type = IPS_DOC_CHAR_SET; + //----------------------------------------- + // Get xml class + //----------------------------------------- + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); $login_id = basename(ipsRegistry::$request['login_folder']); //----------------------------------------- @@ -1034,29 +920,15 @@ class admin_core_tools_login extends ipsCommand { if( is_dir( IPS_PATH_CUSTOM_LOGIN . '/' . $file ) AND $file == $login_id ) { - if( file_exists( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/loginauth_install.xml' ) ) + if( is_file( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/loginauth_install.xml' ) ) { $file_content = file_get_contents( IPS_PATH_CUSTOM_LOGIN . '/' . $file . '/loginauth_install.xml' ); - $xml->xml_parse_document( $file_content ); + $xml->loadXML( $file_content ); - if( is_array($xml->xml_array['export']['group']['row']) ) + foreach( $xml->fetchElements('row') as $record ) { - foreach( $xml->xml_array['export']['group']['row'] as $f => $entry ) - { - if( is_array($entry) ) - { - foreach( $entry as $k => $v ) - { - if ( $f == 'VALUE' or $f == 'login_id' ) - { - continue; - } - - $data[ $f ] = $v; - } - } - } + $data = $xml->fetchElementsFromRecord( $record ); } } else @@ -1121,9 +993,9 @@ class admin_core_tools_login extends ipsCommand /** * Reorder a login method * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ - private function _loginReorder() + protected function _loginReorder() { //----------------------------------------- // INIT @@ -1147,14 +1019,17 @@ class admin_core_tools_login extends ipsCommand //----------------------------------------- $position = 1; - + if( is_array($this->request['logins']) AND count($this->request['logins']) ) { foreach( $this->request['logins'] as $this_id ) { - $this->DB->update( 'login_methods', array( 'login_order' => $position ), 'login_id=' . $this_id ); - - $position++; + if( intval($this_id) == $this_id ) + { + $this->DB->update( 'login_methods', array( 'login_order' => $position ), 'login_id=' . intval($this_id) ); + + $position++; + } } } diff --git a/upload/admin/applications/core/modules_admin/tools/logsSplash.php b/upload/admin/applications/core/modules_admin/tools/logsSplash.php index 4f8a78a7..0faee912 100644 --- a/upload/admin/applications/core/modules_admin/tools/logsSplash.php +++ b/upload/admin/applications/core/modules_admin/tools/logsSplash.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Log Splash Screen
    - * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $LastChangedDate: 2011-09-13 21:55:41 -0400 (Tue, 13 Sep 2011) $
      * 
    * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 5713 $ + * @version $Rev: 9487 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,15 +29,13 @@ class admin_core_tools_logsSplash extends ipsCommand /** * Skin object * - * @access private * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -47,9 +45,8 @@ class admin_core_tools_logsSplash extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -64,7 +61,7 @@ class admin_core_tools_logsSplash extends ipsCommand $this->form_code_js = $this->html->form_code_js = 'module=logs§ion=splash'; /* Get the splash screen */ - $this->registry->output->html = $this->html->logSplashScreen(); + $this->registry->output->html .= $this->html->logSplashScreen(); /* Output */ $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); diff --git a/upload/admin/applications/core/modules_admin/tools/performance.php b/upload/admin/applications/core/modules_admin/tools/performance.php index 294d768c..d74a22f8 100644 --- a/upload/admin/applications/core/modules_admin/tools/performance.php +++ b/upload/admin/applications/core/modules_admin/tools/performance.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Toggle performance mode on/off
    - * Last Updated: $LastChangedDate: 2010-06-01 18:11:37 -0400 (Tue, 01 Jun 2010) $
    + * Last Updated: $LastChangedDate: 2011-07-19 19:39:43 -0400 (Tue, 19 Jul 2011) $
      * 
    * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6435 $ + * @link http://hatynka.in + * @version $Rev: 9291 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,64 +28,56 @@ class admin_core_tools_performance extends ipsCommand /** * Settings to ENABLE * - * @access private * @var array */ - private $settingsEnable = array( 'live_search_disable', 'no_au_forum', 'no_au_topic', 'disable_summary', 'topic_marking_noquery' ); + protected $settingsEnable = array( 'live_search_disable', 'no_au_forum', 'no_au_topic', 'disable_summary', 'topic_marking_noquery' ); /** * Settings to DISABLE * - * @access private * @var array */ - private $settingsDisable = array( 'spider_visit', 'custom_profile_topic', 'update_topic_views_immediately', 'show_user_posted', + protected $settingsDisable = array( 'spider_visit', 'custom_profile_topic', 'update_topic_views_immediately', 'show_user_posted', 'show_active', 'allow_search', 'topic_marking_enable' ); /** * Group settings to ENABLE * - * @access private * @var array */ - private $groupEnable = array(); + protected $groupEnable = array(); /** * Group settings to DISABLE * - * @access private * @var array */ - private $groupDisable = array( 'g_mem_info', 'g_can_add_friends', 'g_email_friend' ); + protected $groupDisable = array( 'g_mem_info', 'g_can_add_friends' ); /** * Other stuff to do...(custom coded) * - * @access private * @var array */ - private $otherDisable = array( 'module__disable_pms', 'module__disable_online', 'disable_calendar', 'disable_hooks' ); + protected $otherDisable = array( 'module__disable_pms', 'module__disable_online', 'disable_calendar', 'disable_hooks' ); /** * HTML object * - * @access private * @var object - **/ - private $html; + */ + protected $html; /** * Current performance settings * - * @access private * @var array */ - private $current = array(); + protected $current = array(); /**#@+ * URL bits * - * @access public * @var string */ public $form_code = ''; @@ -95,9 +87,8 @@ class admin_core_tools_performance extends ipsCommand /** * Main entry point * - * @access public * @param object ipsRegistry reference - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -133,8 +124,7 @@ class admin_core_tools_performance extends ipsCommand /** * Toggle on/off * - * @access public - * @return void + * @return @e void * @author Brandon */ public function toggle() @@ -255,12 +245,12 @@ class admin_core_tools_performance extends ipsCommand if( $app['app_directory'] == 'calendar' ) { $stored['other']['disable_calendar'] = $app['app_enabled']; + + $this->DB->update( 'core_applications', array( 'app_enabled' => 0 ), "app_directory='calendar'" ); + $results[] = $this->lang->words['perf_discal']; break; } } - - $this->DB->update( 'core_applications', array( 'app_enabled' => 0 ), "app_directory='calendar'" ); - $results[] = $this->lang->words['perf_discal']; break; case 'disable_hooks': @@ -382,7 +372,7 @@ class admin_core_tools_performance extends ipsCommand case 'disable_calendar': $previous = $this->current['other']['disable_calendar']; - if( $previous ) + if( $previous && IPSLib::appIsInstalled('calendar') ) { $this->DB->update( 'core_applications', array( 'app_enabled' => 1 ), "app_directory='calendar'" ); $results[] = $this->lang->words['perf_encal']; @@ -431,8 +421,7 @@ class admin_core_tools_performance extends ipsCommand /** * List current status/data * - * @access public - * @return void + * @return @e void */ public function overview() { @@ -444,10 +433,9 @@ class admin_core_tools_performance extends ipsCommand * Retrieve current cached performance settings. * Leaves array blank if currently "off" * - * @access private - * @return void + * @return @e void */ - private function getSettings() + protected function getSettings() { $record = $this->cache->getCache('performanceCache'); diff --git a/upload/admin/applications/core/modules_admin/tools/qanda.php b/upload/admin/applications/core/modules_admin/tools/qanda.php index 8f4fc0d4..5a466eb7 100644 --- a/upload/admin/applications/core/modules_admin/tools/qanda.php +++ b/upload/admin/applications/core/modules_admin/tools/qanda.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Registration question and answer challenges
    - * Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -28,17 +28,15 @@ class admin_core_tools_qanda extends ipsCommand /** * HTML object * - * @access private * @var object */ - private $html; + protected $html; /** * Main entry point * - * @access public * @param object ipsRegistry reference - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -74,16 +72,13 @@ class admin_core_tools_qanda extends ipsCommand break; case 'remove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'qa_remove' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'qa_manage' ); $this->remove(); break; - - case 'switchOn': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'qa_manage' ); - $this->_switchOn(); + case 'overview': default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'qa_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'qanda_view' ); $this->overview(); break; } @@ -93,28 +88,10 @@ class admin_core_tools_qanda extends ipsCommand $this->registry->output->sendOutput(); } - - /** - * Toggles the setting 'registration_qanda' - * - * @access private - * @return void - * @author Brandon - */ - private function _switchOn() - { - /* Switch it on */ - IPSLib::updateSettings( array( 'registration_qanda' => 1 ) ); - - /* Done */ - $this->registry->output->silentRedirect( $this->settings['base_url'] . $this->form_code ); - } - /** * Removes a question * - * @access public - * @return void + * @return @e void * @author Brandon */ public function remove() @@ -138,8 +115,7 @@ class admin_core_tools_qanda extends ipsCommand /** * List current questions * - * @access public - * @return void + * @return @e void */ public function overview() { @@ -166,9 +142,8 @@ class admin_core_tools_qanda extends ipsCommand /** * Form for adding/editing questions * - * @access public * @param string Type [new|edit] - * @return void + * @return @e void */ public function showForm( $type='new' ) { @@ -211,7 +186,7 @@ class admin_core_tools_qanda extends ipsCommand /* Form Elements */ $form = array(); - $form['question'] = $this->registry->output->formTextarea( 'question', htmlspecialchars( $r['qa_question'], ENT_QUOTES ) ); + $form['question'] = $this->registry->output->formInput( 'question', htmlspecialchars( $r['qa_question'], ENT_QUOTES ) ); $form['answers'] = $this->registry->output->formTextarea( 'answers', htmlspecialchars( $r['qa_answers'], ENT_QUOTES ) ); /* Ouput */ @@ -221,9 +196,8 @@ class admin_core_tools_qanda extends ipsCommand /** * Save the questions from the form * - * @access public * @param string Type [new|edit] - * @return void + * @return @e void */ public function saveForm( $type='new' ) { @@ -233,7 +207,11 @@ class admin_core_tools_qanda extends ipsCommand $this->registry->output->showError( $this->lang->words['qa_no_question'], 11150 ); } - if( ! $this->request['answers'] ) + //----------------------------------------- + // We use strlen so '0' is still supported + //----------------------------------------- + + if( !strlen($this->request['answers']) ) { $this->registry->output->showError( $this->lang->words['qa_no_answer'], 11150 ); } diff --git a/upload/admin/applications/core/modules_admin/tools/rebuild.php b/upload/admin/applications/core/modules_admin/tools/rebuild.php index 952aa48c..68ec1720 100644 --- a/upload/admin/applications/core/modules_admin/tools/rebuild.php +++ b/upload/admin/applications/core/modules_admin/tools/rebuild.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Rebuild & Other Tools
    - * Last Updated: $LastChangedDate: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
    + * Last Updated: $LastChangedDate: 2011-09-20 21:18:18 -0400 (Tue, 20 Sep 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 7023 $ + * @link http://hatynka.in + * @version $Rev: 9520 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -29,7 +29,7 @@ class admin_core_tools_rebuild extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /**#@+ * URL bits @@ -44,7 +44,7 @@ class admin_core_tools_rebuild extends ipsCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -117,11 +117,6 @@ class admin_core_tools_rebuild extends ipsCommand $this->cleanAttachments(); break; - case 'cleanavatars': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_orphana' ); - $this->cleanAvatars(); - break; - case 'cleanphotos': $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_orphanp' ); $this->cleanPhotos(); @@ -136,53 +131,59 @@ class admin_core_tools_rebuild extends ipsCommand // Tools //----------------------------------------- + case '320photos': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools320Photos(); + break; + case '300pms': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->tools300Pms(); break; case '220tool_contacts': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->tools220Contacts(); break; case '210polls': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->tools210Polls(); break; case '210calevents': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->tools210Calevents(); break; case '210tool_settings': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->tools210DupeSettings(); break; case 'tool_settings': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->toolsDupeSettings(); break; case 'tool_converge': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->toolsConverge(); break; case 'tool_bansettings': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->toolBanSettings(); break; case 'tools': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_220' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); $this->toolsSplashScreen(); break; case 'rebuild_overview': default: + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'rebuild_manage' ); $this->rebuildSplashScreen(); break; } @@ -192,10 +193,121 @@ class admin_core_tools_rebuild extends ipsCommand $this->registry->output->sendOutput(); } + /** + * 3.2.x Tools: Convert photos + * + * @return @e void + */ + public function tools320photos() + { + /* INIT */ + $convertFrom = $this->request['from'] == 'avatars' ? 'avatars' : 'photos'; + $st = intval($this->request['st']); + $did = 0; + $each = 200; + + /* Photo library */ + require_once( IPS_ROOT_PATH . 'sources/classes/member/photo.php' );/*noLibHook*/ + $photo = new classes_member_photo( $this->registry ); + + /* Loop over members */ + $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'limit' => array( $st, $each ) ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $did++; + + $update = array(); + + if( $r['fb_photo'] ) + { + $update['pp_photo_type'] = 'facebook'; + } + else if( $r['tc_photo'] ) + { + $update['pp_photo_type'] = 'twitter'; + } + else + { + if( $convertFrom == 'avatars' ) + { + if( $r['avatar_type'] == 'upload' AND $r['avatar_location'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['avatar_location']; + $_dims = @getimagesize( $this->settings['upload_dir'] . '/' . $r['avatar_location'] ); + $update['pp_main_width'] = $_dims[0]; + $update['pp_main_height'] = $_dims[1]; + } + else if( $r['avatar_type'] == 'gravatar' ) + { + $update['pp_photo_type'] = 'gravatar'; + $update['pp_gravatar'] = $r['avatar_location']; + + $md5Gravatar = md5( $update['pp_gravatar'] ); + + $_url = "http://www.gravatar.com"; + + if( $this->registry->output->isHTTPS ) + { + $_url = "https://secure.gravatar.com"; + } + + $update['pp_main_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_main_width'] = 100; + $update['pp_main_height'] = 100; + $update['pp_thumb_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_thumb_width'] = 100; + $update['pp_thumb_height'] = 100; + } + } + else + { + if( $r['pp_main_photo'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['pp_main_photo']; + } + } + } + + if( $update['pp_photo_type'] == 'custom' ) + { + $info = $photo->buildSizedPhotos( str_replace( 'upload:', '', $update['pp_main_photo'] ), $r['pp_member_id'], true ); + + $update['pp_main_width'] = intval( $info['final_width'] ); + $update['pp_main_height'] = intval( $info['final_height'] ); + $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; + $update['pp_thumb_width'] = intval( $info['t_final_width'] ); + $update['pp_thumb_height'] = intval( $info['t_final_height'] ); + } + + if( count($update) ) + { + $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); + } + } + + /* Show message and redirect */ + if( $did > 0 ) + { + $this->request['st'] = ( $st + $did ); + + $url = "{$this->settings['base_url']}{$this->form_code}&do=" . $this->request['do'] . '&from=' . $this->request['from'] . '&st=' . $this->request['st']; + + $this->_specialRedirect( $url, sprintf( $this->lang->words['tools320photos'], $this->request['st'], $did ) ); + } + else + { + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . '&do=tools', $this->lang->words['re_photosconverted'] ); + } + } + /** * 3.0.x Tools: PM Conversion * - * @return void + * @return @e void */ public function tools300pms() { @@ -302,7 +414,7 @@ class admin_core_tools_rebuild extends ipsCommand /* Build invited - does not include 'to' person */ if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) ) { - $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id']; + $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/ } $_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0; @@ -376,34 +488,25 @@ class admin_core_tools_rebuild extends ipsCommand if ( $seen ) { $this->request['st'] = $start + $pergo; - - /* We did some, go check again.. */ - $this->registry->output->global_message = sprintf( $this->lang->words['tools300pms'], $this->request['st'], $converted ); - + /* Re-do Page */ $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&st=' . $this->request['st']; + + $this->_specialRedirect( $url, sprintf( $this->lang->words['tools300pms'], $this->request['st'], $converted ) ); } else { /* Update all members */ $this->DB->update( 'members', array( 'msg_count_reset' => 1 ) ); - - $this->registry->output->global_message = $this->lang->words['re_pmsconverted']; - $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; + $this->registry->output->redirect( "{$this->settings['base_url']}{$this->form_code}&do=tools", $this->lang->words['re_pmsconverted'], 1 ); } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->registry->output->redirect( $url, $this->registry->output->global_message, 1 ); } /** * Tools: Ban Settings * - * @return void + * @return @e void */ public function toolBanSettings() { @@ -433,7 +536,7 @@ class admin_core_tools_rebuild extends ipsCommand // Get $INFO (again) ip email name //----------------------------------------- $INFO = array(); - require( DOC_IPS_ROOT_PATH."conf_global.php" ); + require( DOC_IPS_ROOT_PATH . 'conf_global.php' );/*noLibHook*/ //----------------------------------------- // IP @@ -511,7 +614,7 @@ class admin_core_tools_rebuild extends ipsCommand /** * 2.0.0 Tools: Converge * - * @return void + * @return @e void */ public function toolsConverge() { @@ -554,7 +657,7 @@ class admin_core_tools_rebuild extends ipsCommand /** * 2.0.0 Tools: Dupe Settings * - * @return void + * @return @e void */ public function toolsDupeSettings() { @@ -583,7 +686,7 @@ class admin_core_tools_rebuild extends ipsCommand if ( count( $title_id_to_delete ) ) { - $this->DB->buildAndFetch( array( 'delete' => 'conf_settings_titles', 'where' => 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ) ); + $this->DB->delete( 'conf_settings_titles', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); } $title_deleted_count = intval( count($title_id_to_delete) ); @@ -613,7 +716,7 @@ class admin_core_tools_rebuild extends ipsCommand if ( count( $setting_id_to_delete ) ) { - $this->DB->buildAndFetch( array( 'delete' => 'conf_settings', 'where' => 'conf_id IN ('.implode( ',', $setting_id_to_delete ).')' ) ); + $this->DB->delete( 'conf_settings', 'conf_id IN ('.implode( ',', $setting_id_to_delete ).')' ); } $setting_deleted_count = intval( count($setting_id_to_delete) ); @@ -629,7 +732,7 @@ class admin_core_tools_rebuild extends ipsCommand /** * 2.1.0 Tools: Dupe Settings * - * @return void + * @return @e void */ public function tools210DupeSettings() { @@ -678,7 +781,7 @@ class admin_core_tools_rebuild extends ipsCommand /** * 2.1.0 Tools: Calendar Events * - * @return void + * @return @e void */ public function tools210Calevents() { @@ -806,13 +909,13 @@ class admin_core_tools_rebuild extends ipsCommand // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $this->registry->output->global_message, 1 ); + $this->registry->output->redirect( $url, $this->registry->output->global_message ); } /** * 2.1.0 Tools: Polls * - * @return void + * @return @e void */ public function tools210Polls() { @@ -956,14 +1059,14 @@ class admin_core_tools_rebuild extends ipsCommand // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $this->registry->output->global_message, 1 ); + $this->registry->output->redirect( $url, $this->registry->output->global_message ); } /** * 2.2.0 Tools: Contacts * DEPRECATED * - * @return void + * @return @e void */ public function tools220Contacts() { @@ -1065,13 +1168,13 @@ class admin_core_tools_rebuild extends ipsCommand // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $this->registry->output->global_message, 1 ); + $this->registry->output->redirect( $url, $this->registry->output->global_message ); } /** * Cleanup Tools Splash Screen * - * @return void + * @return @e void */ public function toolsSplashScreen() { @@ -1082,7 +1185,7 @@ class admin_core_tools_rebuild extends ipsCommand /** * Count stats * - * @return void + * @return @e void */ public function doCount() { @@ -1099,11 +1202,11 @@ class admin_core_tools_rebuild extends ipsCommand { $topics = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as tcount', 'from' => 'topics', - 'where' => 'approved=1' ) ); + 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) ) ); $posts = $this->DB->buildAndFetch( array( 'select' => 'SUM(posts) as replies', 'from' => 'topics', - 'where' => 'approved=1' ) ); + 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) ) ); $stats['total_topics'] = $topics['tcount']; $stats['total_replies'] = $posts['replies']; @@ -1148,31 +1251,26 @@ class admin_core_tools_rebuild extends ipsCommand $this->registry->output->showError( $this->lang->words['re_nothing'], 11155 ); } - $this->registry->output->global_message = $this->lang->words['re_statsrecount']; - - $this->registry->output->doneScreen($this->lang->words['re_statsrecount'], $this->lang->words['re_statscenter'], "{$this->form_code}", 'redirect' ); + $this->registry->output->global_message = $this->lang->words['re_statsrecount']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code ); } /** * Clean out photos * - * @return void + * @return @e void */ public function cleanPhotos() { - /* Upload Class */ - require_once( IPS_KERNEL_PATH.'classUpload.php' ); - $upload = new classUpload(); - //----------------------------------------- // Set up //----------------------------------------- - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $display = $end + $start; - $output = array(); + $done = 0; + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $display = $end + $start; + $output = array(); //----------------------------------------- // Pop open the directory and @@ -1183,7 +1281,7 @@ class admin_core_tools_rebuild extends ipsCommand try { - foreach( new DirectoryIterator( $this->settings['upload_dir'] ) as $file ) + foreach( new DirectoryIterator( $this->settings['upload_dir'] . '/profile' ) as $file ) { if ( strstr( $file->getFilename(), 'photo-' ) ) { @@ -1240,7 +1338,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -1250,25 +1347,24 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $display ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$display}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** - * Clean out avatars + * Clean out attachments * - * @return void + * @return @e void */ - public function cleanAvatars() + public function cleanAttachments() { /* Upload Class */ - require_once( IPS_KERNEL_PATH.'classUpload.php' ); + require_once( IPS_KERNEL_PATH.'classUpload.php' );/*noLibHook*/ $upload = new classUpload(); //----------------------------------------- @@ -1288,112 +1384,6 @@ class admin_core_tools_rebuild extends ipsCommand $i = 0; - try - { - foreach( new DirectoryIterator( $this->settings['upload_dir'] ) as $file ) - { - if ( strstr( $file->getFilename(), 'av-' ) ) - { - $fullfile = $this->settings['upload_dir'].'/'.$file->getFilename(); - - $i++; - - //----------------------------------------- - // Already started? - //----------------------------------------- - - if ( $start > $i ) - { - continue; - } - - //----------------------------------------- - // Done for this iteration? - //----------------------------------------- - - if ( $i > $dis ) - { - break; - } - - //----------------------------------------- - // Try and get attach row - //----------------------------------------- - - $found = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "avatar_location='{$file->getFilename()}' or avatar_location='upload:{$file->getFilename()}'" ) ); - - if ( ! $found['pp_member_id'] ) - { - @unlink( $fullfile ); - $output[] = "{$this->lang->words['re_removedorph']} $file"; - } - else - { - $output[] = "{$this->lang->words['re_attachedok']} $file"; - } - } - } - } catch ( Exception $e ) {} - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( $i < $dis) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomplete'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->registry->output->redirect( $url, $text, $time ); - } - - /** - * Clean out attachments - * - * @return void - */ - public function cleanAttachments() - { - /* Upload Class */ - require_once( IPS_KERNEL_PATH.'classUpload.php' ); - $upload = new classUpload(); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Pop open the directory and - // peek inside... - //----------------------------------------- - - $i = 0; try { foreach( new DirectoryIterator( $this->settings['upload_dir'] ) as $file ) @@ -1458,6 +1448,7 @@ class admin_core_tools_rebuild extends ipsCommand } } } catch ( Exception $e ) {} + closedir( $ndh ); } else if ( strstr( $file, 'post-' ) ) @@ -1511,37 +1502,35 @@ class admin_core_tools_rebuild extends ipsCommand // Done.. //----------------------------------------- - $text = $this->lang->words['re_rebuidcomp'] . '
    ' . implode( "
    ", $output ); + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { //----------------------------------------- // More.. //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + + $text = sprintf( $this->lang->words['re_thisgoeshere'], $dis ) . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Attachment Data * - * @return void + * @return @e void */ public function rebuildAttachdata() { /* Upload Class */ - require_once( IPS_KERNEL_PATH.'classUpload.php' ); + require_once( IPS_KERNEL_PATH.'classUpload.php' );/*noLibHook*/ $upload = new classUpload(); //----------------------------------------- @@ -1580,11 +1569,11 @@ class admin_core_tools_rebuild extends ipsCommand $update = array(); - $update['attach_ext'] = $upload->_getFileExtension( $r['attach_file'] ); + $update['attach_ext'] = IPSText::getFileExtension( $r['attach_file'] ); if ( $r['attach_location'] ) { - if ( file_exists( $this->settings['upload_dir'].'/'.$r['attach_location'] ) ) + if ( is_file( $this->settings['upload_dir'].'/'.$r['attach_location'] ) ) { $update['attach_filesize'] = @filesize( $this->settings['upload_dir'].'/'.$r['attach_location'] ); @@ -1621,7 +1610,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -1631,26 +1619,25 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Photos * - * @return void + * @return @e void */ public function rebuildPhotos() { /* Image Class */ - require_once( IPS_KERNEL_PATH . 'classImage.php' ); - require_once( IPS_KERNEL_PATH . 'classImageGd.php' ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' ); + $photoClass = new $classToLoad( $this->registry ); //----------------------------------------- // Set up @@ -1682,47 +1669,36 @@ class admin_core_tools_rebuild extends ipsCommand while( $r = $this->DB->fetch( $outer ) ) { - if ( $r['pp_thumb_photo'] and ( $r['pp_thumb_photo'] != $r['pp_main_photo'] ) ) + /* Preserve FB, Twitter and Gravatar photos */ + if( $r['pp_photo_type'] != 'custom' ) { - if ( file_exists( $this->settings['upload_dir'].'/'.$r['pp_thumb_photo'] ) ) - { - if ( ! @unlink( $this->settings['upload_dir'].'/'.$r['pp_thumb_photo'] ) ) - { - $output[] = $this->lang->words['re_noremove'].$r['pp_thumb_photo']; - continue; - } - } - } - - if( !file_exists( $this->settings['upload_dir'] . '/' . $r['pp_main_photo'] ) ) - { - $output[] = $this->lang->words['re_noresizefound'] . $r['pp_main_photo']; continue; } - $photo_data = array(); - $thumb_data = array(); + $update = array(); + + $info = $photoClass->buildSizedPhotos( str_replace( 'upload:', '', $r['pp_main_photo'] ), $r['pp_member_id'], true ); - $image = new classImageGd(); - - $image->init( array( 'image_path' => $this->settings['upload_dir'], 'image_file' => $r['pp_main_photo'] ) ); - - $thumb_data = $image->resizeImage( 50, 50 ); - $image->writeImage( $this->settings['upload_dir'] . '/' . $r['pp_thumb_photo'] ); - - $photo_data['pp_thumb_width'] = intval($thumb_data['newWidth']); - $photo_data['pp_thumb_height'] = intval($thumb_data['newHeight']); - $photo_data['pp_thumb_photo'] = $r['pp_thumb_photo']; - - if ( count( $photo_data ) ) + if( $info['status'] == 'missing_image' ) { - $this->DB->update( 'profile_portal', $photo_data, 'pp_member_id='.$r['pp_member_id'] ); - - $output[] = $this->lang->words['re_resized'].$r['pp_main_photo']; + $update['pp_main_photo'] = ''; + $update['pp_main_width'] = 0; + $update['pp_main_height'] = 0; + $update['pp_thumb_photo'] = ''; + $update['pp_thumb_width'] = 0; + $update['pp_thumb_height'] = 0; + } + else + { + $update['pp_main_width'] = intval( $info['final_width'] ); + $update['pp_main_height'] = intval( $info['final_height'] ); + $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; + $update['pp_thumb_width'] = intval( $info['t_final_width'] ); + $update['pp_thumb_height'] = intval( $info['t_final_height'] ); } - unset($image); - + $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); + $done++; } @@ -1738,7 +1714,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -1748,25 +1723,24 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Post Thumbnails * - * @return void + * @return @e void */ public function rebuildThumbnails() { - require_once( IPS_KERNEL_PATH . 'classImage.php' ); - require_once( IPS_KERNEL_PATH . 'classImageGd.php' ); + require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ + require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ //----------------------------------------- // Set up @@ -1802,19 +1776,20 @@ class admin_core_tools_rebuild extends ipsCommand { if ( $r['attach_thumb_location'] and ( $r['attach_thumb_location'] != $r['attach_location'] ) ) { - if ( file_exists( $this->settings['upload_dir'].'/'.$r['attach_thumb_location'] ) ) + if ( is_file( $this->settings['upload_dir'] . '/' . $r['attach_thumb_location'] ) ) { - if ( ! @unlink( $this->settings['upload_dir'].'/'.$r['attach_thumb_location'] ) ) + if ( ! @unlink( $this->settings['upload_dir'] . '/' . $r['attach_thumb_location'] ) ) { - $output[] = $this->lang->words['re_noremove'].$r['attach_thumb_location']; + $r['attach_thumb_location'] = ''; + + $output[] = $this->lang->words['re_noremove'] . $r['attach_thumb_location']; continue; } } } $attach_data = array(); - $thumbnail = $r['attach_thumb_location'] ? $r['attach_thumb_location'] - : preg_replace( "/^(.*)\.(.+?)$/", "\\1_thumb.\\2", $r['attach_location'] ); + $thumbnail = preg_replace( "/^(.*)\.(.+?)$/", "\\1_thumb.\\2", $r['attach_location'] ); $image = new classImageGd(); @@ -1823,18 +1798,25 @@ class admin_core_tools_rebuild extends ipsCommand 'image_file' => $r['attach_location'], ) ); + $image->force_resize = false; + $return = $image->resizeImage( $this->settings['siu_width'], $this->settings['siu_height'] ); - $image->writeImage( $this->settings['upload_dir'] . '/' . $thumbnail ); + + if( !$return['noResize'] ) + { + $image->writeImage( $this->settings['upload_dir'] . '/' . $thumbnail ); + + $attach_data['attach_thumb_location'] = $thumbnail; + } $attach_data['attach_thumb_width'] = intval($return['newWidth'] ? $return['newWidth'] : $image->cur_dimensions['width']); $attach_data['attach_thumb_height'] = intval($return['newHeight'] ? $return['newHeight'] : $image->cur_dimensions['height']); - $attach_data['attach_thumb_location'] = $thumbnail; if ( count( $attach_data ) ) { $this->DB->update( 'attachments', $attach_data, 'attach_id='.$r['attach_id'] ); - $output[] = $this->lang->words['re_resized'].$r['attach_location']; + $output[] = $this->lang->words['re_resized'] . $r['attach_location']; } unset($image); @@ -1855,7 +1837,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -1865,20 +1846,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Messenger Totals * - * @return void + * @return @e void */ public function rebuildMsgCounts() { @@ -1938,7 +1918,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -1948,20 +1927,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Post Count * - * @return void + * @return @e void */ public function rebuildPostCount() { @@ -2009,15 +1987,17 @@ class admin_core_tools_rebuild extends ipsCommand while( $r = $this->DB->fetch( $outer ) ) { + $_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), 'p.' ); + if ( ! count( $forums ) ) { - $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'posts', 'where' => 'queued != 1 AND author_id='.$r['member_id'] ) ); + $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'posts p', 'where' => $_queued . ' AND p.author_id=' . $r['member_id'] ) ); } else { $this->DB->build( array( 'select' => 'count(p.pid) as count', 'from' => array( 'posts' => 'p' ), - 'where' => 'p.queued <> 1 AND p.author_id='.$r['member_id'].' AND t.forum_id NOT IN ('.implode(",",$forums).')', + 'where' => $_queued . ' AND p.author_id=' . $r['member_id'] . ' AND t.forum_id NOT IN (' . implode( ",", $forums ) . ')', 'add_join' => array( 1 => array( 'type' => 'left', 'from' => array( 'topics' => 't' ), 'where' => 't.tid=p.topic_id' @@ -2047,7 +2027,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -2057,20 +2036,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Seo User Names * - * @return void + * @return @e void */ public function rebuildSeoUserNames() { @@ -2120,7 +2098,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -2130,21 +2107,20 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild Post Names * - * @return void + * @return @e void */ public function rebuildPostNames() { @@ -2197,7 +2173,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -2207,20 +2182,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Rebuild posts * - * @return void + * @return @e void */ public function rebuildPosts() { @@ -2266,7 +2240,7 @@ class admin_core_tools_rebuild extends ipsCommand $output = array(); $plugin = null; - $types = array( 'posts', 'pms', 'cal', 'announce', 'sigs', 'aboutme', 'rules' ); + $types = array( 'posts', 'pms', 'announce', 'sigs', 'aboutme', 'rules' ); foreach( ipsRegistry::$applications as $app_dir => $app_data ) { @@ -2274,7 +2248,7 @@ class admin_core_tools_rebuild extends ipsCommand // Retrieve the RSS links for the header //----------------------------------------- - if( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) + if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) { $className = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php', 'postRebuild_'.$app_dir, $app_dir ); @@ -2312,11 +2286,6 @@ class admin_core_tools_rebuild extends ipsCommand switch( $type ) { - case 'cal': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'event_id', 'from' => 'cal_events', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['event_id'] ); - break; - case 'announce': $tmp = $this->DB->buildAndFetch( array( 'select' => 'announce_id', 'from' => 'announcements', 'limit' => array($dis,1) ) ); $max = intval( $tmp['announce_id'] ); @@ -2359,20 +2328,6 @@ class admin_core_tools_rebuild extends ipsCommand switch( $type ) { - case 'cal': - $this->DB->build( array( 'select' => 'e.*', - 'from' => array( 'cal_events' => 'e' ), - 'order' => 'e.event_id ASC', - 'where' => 'e.event_id > ' . $start, - 'limit' => array($end), - 'add_join' => array( 1 => array( 'type' => 'left', - 'select' => 'm.member_group_id, m.mgroup_others', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=e.event_member_id" - ) ) - ) ); - break; - case 'announce': $this->DB->build( array( 'select' => 'a.*', 'from' => array( 'announcements' => 'a' ), @@ -2463,8 +2418,23 @@ class admin_core_tools_rebuild extends ipsCommand // Process... //----------------------------------------- + /* On mssql, the select query blocks all the updates. Doing this causes the engine not to lock */ + if ( method_exists( $this->DB, 'setQueryRowLocking' ) ) + { + $this->DB->setQueryRowLocking( 'OFF' ); + } + while( $r = $this->DB->fetch( $outer ) ) { + //----------------------------------------- + // Group + //----------------------------------------- + + if( $r['member_group_id'] ) + { + $r = array_merge( $r, $this->caches['group_cache'][ $r['member_group_id'] ] ); + } + //----------------------------------------- // Reset //----------------------------------------- @@ -2481,15 +2451,6 @@ class admin_core_tools_rebuild extends ipsCommand switch( $type ) { - case 'cal': - $parser->parse_smilies = $oldparser->parse_smilies = $r['event_smilies']; - $parser->parse_html = $oldparser->parse_html = 0; - $parser->parse_bbcode = $oldparser->parse_bbcode = 1; - $parser->parsing_section = 'calendar'; - - $rawpost = $oldparser->preEditParse( $r['event_content'] ); - break; - case 'announce': $parser->parse_smilies = $oldparser->parse_smilies = 1; $parser->parse_html = $oldparser->parse_html = $r['announce_html_enabled']; @@ -2502,8 +2463,8 @@ class admin_core_tools_rebuild extends ipsCommand case 'pms': $parser->parse_smilies = $oldparser->parse_smilies = 1; - $parser->parse_html = $oldparser->parse_html = $this->settings['msg_allow_html']; - $parser->parse_bbcode = $oldparser->parse_bbcode = $this->settings['msg_allow_code']; + $parser->parse_html = $oldparser->parse_html = $r['g_dohtml']; + $parser->parse_bbcode = $oldparser->parse_bbcode = 1; $parser->parse_nl2br = $oldparser->parse_nl2br = 1; $parser->parsing_section = 'pms'; @@ -2512,8 +2473,8 @@ class admin_core_tools_rebuild extends ipsCommand case 'sigs': $parser->parse_smilies = $oldparser->parse_smilies = 0; - $parser->parse_html = $oldparser->parse_html = $this->settings['sig_allow_html']; - $parser->parse_bbcode = $oldparser->parse_bbcode = $this->settings['sig_allow_ibc']; + $parser->parse_html = $oldparser->parse_html = $r['g_dohtml']; + $parser->parse_bbcode = $oldparser->parse_bbcode = 1; $parser->parse_nl2br = $oldparser->parse_nl2br = 1; $parser->parsing_section = 'signatures'; @@ -2521,9 +2482,9 @@ class admin_core_tools_rebuild extends ipsCommand break; case 'aboutme': - $parser->parse_smilies = $oldparser->parse_smilies = $this->settings['aboutme_emoticons']; - $parser->parse_html = $oldparser->parse_html = intval($this->settings['aboutme_html']); - $parser->parse_bbcode = $oldparser->parse_bbcode = $this->settings['aboutme_bbcode']; + $parser->parse_smilies = $oldparser->parse_smilies = 1; + $parser->parse_html = $oldparser->parse_html = $r['g_dohtml']; + $parser->parse_bbcode = $oldparser->parse_bbcode = 1; $parser->parse_nl2br = $oldparser->parse_nl2br = 1; $parser->parsing_section = 'aboutme'; @@ -2532,9 +2493,7 @@ class admin_core_tools_rebuild extends ipsCommand case 'posts': $parser->parse_smilies = $oldparser->parse_smilies = $r['use_emo']; - $parser->parse_html = $oldparser->parse_html = ( $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] AND - $this->caches['group_cache'][ $r['member_group_id'] ]['g_dohtml'] AND - $r['post_htmlstate'] > 0 ) ? 1 : 0; + $parser->parse_html = $oldparser->parse_html = ( $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] AND $r['g_dohtml'] AND $r['post_htmlstate'] > 0 ) ? 1 : 0; $parser->parse_bbcode = $oldparser->parse_bbcode = $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_ibc']; $parser->parse_nl2br = $oldparser->parse_nl2br = ( $r['post_htmlstate'] != 1 ) ? 1 : 0; $parser->parsing_section = 'topics'; @@ -2623,11 +2582,6 @@ class admin_core_tools_rebuild extends ipsCommand $last = $r['pp_member_id']; break; - case 'cal': - $this->DB->update( 'cal_events', array( 'event_content' => $newpost ), 'event_id='.$r['event_id'] ); - $last = $r['event_id']; - break; - case 'announce': $this->DB->update( 'announcements', array( 'announce_post' => $newpost ), 'announce_id='.$r['announce_id'] ); $last = $r['announce_id']; @@ -2647,6 +2601,11 @@ class admin_core_tools_rebuild extends ipsCommand $done++; } + if ( method_exists( $this->DB, 'setQueryRowLocking' ) ) + { + $this->DB->setQueryRowLocking( 'ON' ); + } + //----------------------------------------- // Finish - or more?... //----------------------------------------- @@ -2659,7 +2618,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; $sections[] = $type; $this->DB->replace( 'cache_store', array( 'cs_key' => 'isRebuilt', 'cs_value' => implode( ',', $sections ) ), array( "cs_key" ) ); @@ -2683,20 +2641,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&type={$type}&pergo={$this->request['pergo']}&st={$last}&dis={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Resyncronize Topics * - * @return void + * @return @e void */ public function resyncTopics() { @@ -2757,7 +2714,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -2767,20 +2723,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Resyncronize forum data * - * @return void + * @return @e void */ public function resyncForums() { @@ -2834,7 +2789,6 @@ class admin_core_tools_rebuild extends ipsCommand $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}"; - $time = 2; } else { @@ -2844,20 +2798,19 @@ class admin_core_tools_rebuild extends ipsCommand $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - $time = 0; } //----------------------------------------- // Bye.... //----------------------------------------- - $this->registry->output->redirect( $url, $text, $time ); + $this->_specialRedirect( $url, $text ); } /** * Splash screen with rebuild options * - * @return void + * @return @e void */ public function rebuildSplashScreen() { @@ -2876,7 +2829,6 @@ class admin_core_tools_rebuild extends ipsCommand $todo = array( array( 'posts' , $this->lang->words['remenu_posts'] ), array( 'pms' , $this->lang->words['remenu_pms'] ), - array( 'cal' , $this->lang->words['remenu_events'] ), array( 'announce', $this->lang->words['remenu_announce'] ), array( 'sigs' , $this->lang->words['remenu_sigs'] ), array( 'aboutme' , $this->lang->words['remenu_aboutme'] ), @@ -2889,7 +2841,7 @@ class admin_core_tools_rebuild extends ipsCommand // Retrieve the RSS links for the header //----------------------------------------- - if( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) + if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) { $className = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php', 'postRebuild_'.$app_dir, $app_dir ); @@ -2920,4 +2872,16 @@ class admin_core_tools_rebuild extends ipsCommand /* Output */ $this->registry->output->html .= $this->html->rebuildSplashScreen( $form, $todo, $sections ); } + + /** + * Redirect via a temporary page + * + * @param string $url URL to redirect to + * @param string $text Text to display + * @return @e void + */ + protected function _specialRedirect( $url, $text ) + { + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $url, $text ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/sharelinks.php b/upload/admin/applications/core/modules_admin/tools/sharelinks.php index 960b4b86..52c76dcc 100644 --- a/upload/admin/applications/core/modules_admin/tools/sharelinks.php +++ b/upload/admin/applications/core/modules_admin/tools/sharelinks.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Bookmarks
    - * Last Updated: $LastChangedDate: 2010-01-15 15:18:44 +0000 (Fri, 15 Jan 2010) $
    + * Last Updated: $LastChangedDate: 2011-07-01 08:57:21 -0400 (Fri, 01 Jul 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Blog - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 27th January 2004 - * @version $Rev: 5713 $ + * @version $Rev: 9140 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,27 +30,27 @@ class admin_core_tools_sharelinks extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * Shortcut for url * * @var string URL shortcut */ - private $form_code; + protected $form_code; /** * Shortcut for url (javascript) * * @var string JS URL shortcut */ - private $form_code_js; + protected $form_code_js; /** * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -110,9 +110,9 @@ class admin_core_tools_sharelinks extends ipsCommand /** * Reorder * - * @return void + * @return @e void */ - private function shareLinksReorder() + protected function shareLinksReorder() { /* AJAX Class */ $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); @@ -149,7 +149,7 @@ class admin_core_tools_sharelinks extends ipsCommand * sharelinksDelete * * @return void - **/ + */ function sharelinksDelete() { /* ID */ @@ -169,7 +169,7 @@ class admin_core_tools_sharelinks extends ipsCommand * * @param string [$type='add'] * @return void - **/ + */ function sharelinksSave( $type='add' ) { /* INI */ @@ -237,7 +237,7 @@ class admin_core_tools_sharelinks extends ipsCommand * * @param string [$type='add'] * @return void - **/ + */ public function sharelinksForm( $type='add' ) { /* Check form type */ @@ -269,10 +269,10 @@ class admin_core_tools_sharelinks extends ipsCommand $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_share_links', 'where' => "share_id={$id}" ) ); /* Set Defaults */ - $data['share_title'] = ( isset( $this->request['share_title'] ) && $this->request['share_title'] ) ? $this->request['share_title'] : $data['share_title']; - $data['share_key'] = ( isset( $this->request['share_key'] ) && $this->request['share_key'] ) ? $this->request['share_key'] : $data['share_key']; - $data['share_enabled'] = ( isset( $this->request['share_enabled'] ) && $this->request['share_enabled'] ) ? $this->request['share_enabled'] : $data['share_enabled']; - $data['share_canonical'] = ( isset( $this->request['share_canonical'] ) && $this->request['share_canonical'] ) ? $this->request['share_canonical'] : $data['share_canonical']; + $data['share_title'] = !empty( $this->request['share_title'] ) ? $this->request['share_title'] : $data['share_title']; + $data['share_key'] = !empty( $this->request['share_key'] ) ? $this->request['share_key'] : $data['share_key']; + $data['share_enabled'] = !empty( $this->request['share_enabled'] ) ? $this->request['share_enabled'] : $data['share_enabled']; + $data['share_canonical'] = !empty( $this->request['share_canonical'] ) ? $this->request['share_canonical'] : $data['share_canonical']; } /* Form Elements */ @@ -290,8 +290,8 @@ class admin_core_tools_sharelinks extends ipsCommand * List all the the current bookmark types * * @return void - **/ - private function _sharelinksIndex() + */ + protected function _sharelinksIndex() { /* Init */ $rows = array(); @@ -315,12 +315,13 @@ class admin_core_tools_sharelinks extends ipsCommand /** * Recaches share links * - * @return void + * @return @e void */ public function rebuildCache() { /* INIT */ $cache = array(); + $path = IPS_ROOT_PATH . 'sources/classes/share/plugins/'; /* Fetch */ $this->DB->build( array( 'select' => '*', @@ -331,6 +332,19 @@ class admin_core_tools_sharelinks extends ipsCommand while( $row = $this->DB->fetch() ) { + $_file = $path . IPSText::alphanumericalClean( $row['share_key'] ) . '.php'; + + if ( is_file( $_file ) ) + { + $classToLoad = IPSLib::loadLibrary( $_file, 'sl_' . $row['share_key'] ); + $test = new $classToLoad( $this->registry ); + + if ( method_exists( $test, 'customOutput' ) ) + { + $row['customOutput'] = $test->customOutput(); + } + } + $cache[ $row['share_key'] ] = $row; } diff --git a/upload/admin/applications/core/modules_admin/tools/uagents.php b/upload/admin/applications/core/modules_admin/tools/uagents.php index 15e33f16..c47209bb 100644 --- a/upload/admin/applications/core/modules_admin/tools/uagents.php +++ b/upload/admin/applications/core/modules_admin/tools/uagents.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * User agent management
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6995 $ + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -30,14 +30,14 @@ class admin_core_tools_uagents extends ipsCommand * * @var object Skin templates */ - private $html; + protected $html; /** * User agent functions * * @var object Skin templates */ - private $userAgentFunctions; + protected $userAgentFunctions; /**#@+ * URL bits @@ -52,7 +52,7 @@ class admin_core_tools_uagents extends ipsCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -66,8 +66,8 @@ class admin_core_tools_uagents extends ipsCommand // Set up stuff //----------------------------------------- - $this->form_code = $this->html->form_code = 'module=tools&section=uagents'; - $this->form_code_js = $this->html->form_code_js = 'module=tools§ion=uagents'; + $this->form_code = $this->html->form_code = 'module=tools&section=uagents&'; + $this->form_code_js = $this->html->form_code_js = 'module=tools§ion=uagents&'; //----------------------------------------- // Load lang @@ -90,15 +90,15 @@ class admin_core_tools_uagents extends ipsCommand { case 'list': default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ua_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'uagents' ); $this->_listUagents(); break; case 'reorder': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ua_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'uagents' ); $this->_uagentsReorder(); break; case 'groupsList': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ua_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'uagents' ); $this->_listGroups(); break; case 'groupAdd': @@ -122,7 +122,7 @@ class admin_core_tools_uagents extends ipsCommand $this->_groupRemove(); break; case 'rebuildMaster': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ua_manage' ); + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'uagents' ); $this->_rebuildMasterUserAgents(); break; } @@ -137,7 +137,7 @@ class admin_core_tools_uagents extends ipsCommand * * @return string HTML */ - private function _groupRemove() + protected function _groupRemove() { //----------------------------------------- // INIT @@ -160,7 +160,7 @@ class admin_core_tools_uagents extends ipsCommand * @param string Type of form to show (add/edit) * @return string HTML */ - private function _groupSave( $type ) + protected function _groupSave( $type ) { //----------------------------------------- // INIT @@ -188,9 +188,9 @@ class admin_core_tools_uagents extends ipsCommand * Form type * * @param string Type of form to show (add/edit) - * @return void + * @return @e void */ - private function _groupForm( $type='' ) + protected function _groupForm( $type='' ) { //----------------------------------------- // INIT @@ -252,9 +252,9 @@ class admin_core_tools_uagents extends ipsCommand /** * List available user agent groups * - * @return void + * @return @e void */ - private function _listGroups() + protected function _listGroups() { //----------------------------------------- // INIT @@ -293,7 +293,7 @@ class admin_core_tools_uagents extends ipsCommand * * @return string HTML */ - private function _rebuildMasterUserAgents() + protected function _rebuildMasterUserAgents() { $this->userAgentFunctions->rebuildMasterUserAgents(); @@ -303,9 +303,9 @@ class admin_core_tools_uagents extends ipsCommand /** * List available user agents * - * @return void + * @return @e void */ - private function _listUagents() + protected function _listUagents() { //----------------------------------------- // INIT @@ -335,9 +335,9 @@ class admin_core_tools_uagents extends ipsCommand /** * Reorder useragents * - * @return void + * @return @e void */ - private function _uagentsReorder() + protected function _uagentsReorder() { //----------------------------------------- // INIT diff --git a/upload/admin/applications/core/modules_admin/tools/xml/index.html b/upload/admin/applications/core/modules_admin/tools/xml/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_admin/tools/xml/index.html +++ b/upload/admin/applications/core/modules_admin/tools/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/xml/menu.xml b/upload/admin/applications/core/modules_admin/tools/xml/menu.xml index 92a474c5..21bf1ceb 100644 --- a/upload/admin/applications/core/modules_admin/tools/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/tools/xml/menu.xml @@ -2,17 +2,11 @@ - Системные настройки + Режим производительности - - Все настройки - settings - do=settingsview - settings_manage - 0 - Режим производительности + performance performance performance_toggle @@ -20,50 +14,65 @@ + + Ключ лицензии + + + Ключ лицензии + licensekey + licensekey + + licensekey_manage + 0 + + + Управление User Agent - Список User Agents + Управление User Agent + uagents uagents do=list uagents 0 spiders - - Список групп User Agent - uagents - do=groupsList - uagents - 0 - - Пересчет и обновление + Пересчет и перестроение - Инструменты пересчета и обновления + Пересчет и перестроение + recount_rebuild rebuild do=rebuild_overview rebuild_manage 0 + + + + Инструменты очистки + - Инструменты очистки + Иснтрументы очистки + cleanup_tools rebuild do=tools - recount_manage + cleanup_manage 0 - Разделы помощи + Управление разделами помощи Управление разделами помощи + manage_help help do=help_overview helpfiles_manage @@ -75,7 +84,8 @@ Управление кешем - Кеши системы + Управление кешем + caches cache do=cache_overview cache_manage @@ -84,33 +94,37 @@ - Вопросы при регистрации + Управление системой «Вопрос-ответ» - Список вопросов при регистрации + Управление системой «Вопрос-ответ» + qanda qanda - qanda_manage + qanda_view 0 - Настройки API + Пользователи API Пользователи API + api_users api + api_manage 0 - Модули авторизации + Управление модулями авторизации Управление модулями авторизации + login_modules login do=login_overview login_manage @@ -118,38 +132,28 @@ - - Системные журналы - - - Список журналов - logsSplash - - - 0 - - - Сервисы публикации ссылок Сервисы публикации ссылок + sharelinks sharelinks - + sharelinks_manage 0 - Правила входящих email + Правила входящей почты - Правила входящих email + Правила входящей почты + incoming_emails incomingEmails - + incomingemail_manage 0 diff --git a/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml b/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml index 1d9fded8..eb104e03 100644 --- a/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml @@ -1,172 +1,161 @@ - Настройки - - - settings_manage - Может изменять/добавлять настройки или группы настроек? - - - settings_delete - Может удалять настройки или группы настроек? - - - performance_toggle - Может управлять режимом производительности? - - - - - Кеши + Управление кешем + core_caches cache_manage - Может просматривать и обновлять кеши? + Может посматривать и обновлять кеш? - Методы авторизации + Управление модулями авторизации + core_login_modules login_manage - Может управлять методами авторизации? + Может управлять модулями авторизации? - Система вопросов и ответов + Система вопросов при регистрации + core_qanda - qanda_manage - Может просматривать список вопросов и ответов? + qanda_view + Может просматривать? qa_manage - Может добавлять/изменять вопросы и ответы? - - - qa_remove - Может удалять вопросы и ответы? + Может изменять, добавлять и удалять? - Разделы помощи + Управление разделами помощи + core_helpfiles helpfiles_manage - Может просматривать разделы помощи? + Может просматривать? help_manage - Может добавлять/изменять записи помощи? + Может изменять/добавлять? help_remove - Может удалять записи помощи? + Может удалять? - API + Пользователи API + core_apiusers api_manage - Может добавлять/изменять API пользователей? + Может изменять/добавлять? api_remove - Может удалять API пользователей? + Может удалять? api_logs - Может просматривать журнал API? + Может просматривать логи? - Ссылки публикации + Сервисы публикации ссылок + core_sharelinks sharelinks_manage - Может добавлять/изменять/удалять ссылки? - - - - - User Agents - - - uagents - Может просматривать список user agent? - - - ua_manage - Может добавлять/изменять user agent и их группы? - - - ua_remove - Может удалять user agent и их группы? + Может изменять/добавлять/удалять? - Инструменты очистки и обновления + Управление User Agents + core_uagents + + + uagents + Может управлять? + + + ua_manage + Может изменять/добавлять группы и агенты? + + + ua_remove + Может удалять группы и агенты? + + + + + Инструменты очистки и перестроения + core_cleanuprebuild rebuild_manage - Имеет доступ к инструментам обновления? + Имеет доступ к инструментам перестроения? - recount_manage + cleanup_manage Имеет доступ к инструментам пересчета? tools_recount - Может запустить пересчет статистики форума? + Может производить пересчет статистики форума? tools_resynch - Может запустить синхронизацию форумов? + Может производить пересчет статистики форумов? tools_resyncht - Может запустить синхронизацию тем? + Может производить пересчет статистики тем? tools_rebuild - Может запустить перестроение содержимого сообщений? + Может производить перестроение содержимого сообщений? tools_postcounts - Может запустить обновление счетчиков сообщений у пользоватлей? + Может производить пересчет сообщений пользователей? tools_thumbs - Может запустить перестроение эскизов прикрепленных файлов? + Может производить обновление изображений предпросмотра? tools_attach - Может запустить обновление информации о прикрепленных файлов? + Может производить перестроение прикреплений? tools_orphaned - Может запустить удаление потерянных прикрепленных файлов? - - - tools_orphana - Может запустить удаление потерянных аватаров? + Может удалять потерянные файлы? tools_orphanp - Может запустить удаление потерянных фотографий пользователей? + Может удалять потерянные фотографии? + + + + Правила входящей почты + core_emailrules + - tools_220 - Может запустить различные инструменты обновления и пересчета для 2.1.x и 2.2.x? - + incomingemail_manage + Может управлять правилами? + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/attach.php b/upload/admin/applications/core/modules_public/ajax/attach.php new file mode 100644 index 00000000..dba8a868 --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/attach.php @@ -0,0 +1,65 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class public_core_ajax_attach + * @brief Provides ajax methods for the attach functions + */ +class public_core_ajax_attach extends ipsAjaxCommand +{ + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Guest? */ + if ( !$this->memberData['member_id'] ) + { + $this->returnJsonError('no_permission'); + } + + /* What to do? */ + switch( $this->request['do'] ) + { + case 'setPref': + $this->_setPref(); + break; + } + } + + /** + * Sets uploader preference + * + * @return @e void + */ + protected function _setPref() + { + /* Init */ + $uploader = ( $this->request['pref'] == 'flash' ) ? 'flash' : 'default'; + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_uploader' => $uploader ) ) ); + + /* Fetch data */ + return $this->returnJsonArray( array( 'status' => 'ok' ) ); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/captcha.php b/upload/admin/applications/core/modules_public/ajax/captcha.php index 6dcbd9ec..ff4f329d 100644 --- a/upload/admin/applications/core/modules_public/ajax/captcha.php +++ b/upload/admin/applications/core/modules_public/ajax/captcha.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Update captcha image
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 2.3 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ * */ @@ -29,9 +29,8 @@ class public_core_ajax_captcha extends ipsAjaxCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -48,8 +47,7 @@ class public_core_ajax_captcha extends ipsAjaxCommand /** * Refresh the captcha image * - * @access public - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function refresh() { diff --git a/upload/admin/applications/core/modules_public/ajax/comments.php b/upload/admin/applications/core/modules_public/ajax/comments.php index 4bcf386e..2c43dade 100644 --- a/upload/admin/applications/core/modules_public/ajax/comments.php +++ b/upload/admin/applications/core/modules_public/ajax/comments.php @@ -2,17 +2,17 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Image Ajax
    - * Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
    + * Last Updated: $LastChangedDate: 2011-09-21 05:45:37 -0400 (Wed, 21 Sep 2011) $
      * 
    * - * @author $Author: matt $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Gallery - * @link http://www.invisionpower.com - * @version $Rev: 6767 $ + * @link http://hatynka.in + * @version $Rev: 9521 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -27,7 +27,7 @@ class public_core_ajax_comments extends ipsAjaxCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -35,7 +35,7 @@ class public_core_ajax_comments extends ipsAjaxCommand $fromApp = trim( $this->request['fromApp'] ); /* Init some data */ - require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/ $this->_comments = classes_comments_bootstrap::controller( $fromApp ); /* What to do? */ @@ -65,7 +65,7 @@ class public_core_ajax_comments extends ipsAjaxCommand /** * Moderate * - * @return void + * @return @e void */ protected function _moderate() { @@ -91,7 +91,7 @@ class public_core_ajax_comments extends ipsAjaxCommand /** * Reply * - * @return void + * @return @e void */ protected function _fetchReply() { @@ -105,12 +105,18 @@ class public_core_ajax_comments extends ipsAjaxCommand $this->returnString( 'error' ); } + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + # Get Edit form try { $html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData ); - $this->returnString( $html ); + $this->editor->setContent( $html, 'topics', true ); + + $this->returnHtml( $this->editor->getContent() ); } catch ( Exception $error ) { @@ -122,7 +128,7 @@ class public_core_ajax_comments extends ipsAjaxCommand /** * Deletes a comment * - * @return void + * @return @e void */ protected function _delete() { @@ -151,7 +157,7 @@ class public_core_ajax_comments extends ipsAjaxCommand /** * Shows the edit box * - * @return void + * @return @e void */ protected function _showEdit() { @@ -183,7 +189,7 @@ class public_core_ajax_comments extends ipsAjaxCommand /** * Saves the post * - * @return void + * @return @e void */ protected function _saveEdit() { @@ -214,7 +220,7 @@ class public_core_ajax_comments extends ipsAjaxCommand /** * Add a comment via the magic and mystery of ajax * - * @return void + * @return @e void */ protected function _add() { @@ -226,8 +232,16 @@ class public_core_ajax_comments extends ipsAjaxCommand { try { - $newCommentId = $this->_comments->add( $parentId, $_POST['Post'] ); - return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newCommentId ) ); + $newComment = $this->_comments->add( $parentId, $_POST['Post'] ); + + if( $newComment['comment_approved'] ) + { + return $this->returnHtml( $this->_comments->fetchFormattedSingle( $parentId, $newComment['comment_id'] ) ); + } + else + { + $this->returnJsonError( 'comment_requires_approval' ); + } } catch( Exception $e ) { @@ -236,7 +250,7 @@ class public_core_ajax_comments extends ipsAjaxCommand } else { - $this->returnJsonError( 'no_permission'); + $this->returnJsonError( 'no_permission' ); } } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/defaultSection.php b/upload/admin/applications/core/modules_public/ajax/defaultSection.php index 053d4be8..68584462 100644 --- a/upload/admin/applications/core/modules_public/ajax/defaultSection.php +++ b/upload/admin/applications/core/modules_public/ajax/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default ajax section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'ajax' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'login'; \ No newline at end of file +$DEFAULT_SECTION = 'login'; diff --git a/upload/admin/applications/core/modules_public/ajax/editor.php b/upload/admin/applications/core/modules_public/ajax/editor.php new file mode 100644 index 00000000..48dc18ca --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/editor.php @@ -0,0 +1,159 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Handles ajax functions for IP.Board Text Editor + * Author: Matt "Matt Mecham" Mecham + * Last Updated: $LastChangedDate: 2011-09-26 10:20:55 -0400 (Mon, 26 Sep 2011) $ + * + * + * @author $Author: mmecham $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Gallery + * @link http://hatynka.in + * @version $Rev: 9547 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_ajax_editor extends ipsAjaxCommand +{ + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + /* From App */ + $autoSaveKey = trim( $this->request['autoSaveKey'] ); + + if ( ! $autoSaveKey ) + { + trigger_error( "Missing data in " . __FILE__ . ' ' . __LINE__ ); + } + + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + /* What to do? */ + switch( $this->request['do'] ) + { + case 'autoSave': + $this->_autoSave( $autoSaveKey ); + break; + case 'switch': + $this->_switch(); + break; + case 'showSettings': + $this->_showSettings(); + break; + case 'getEmoticons': + $this->_getEmoticons(); + break; + case 'saveSettings': + $this->_saveSettings(); + break; + } + } + + /** + * Show settings box + * + * @return json + */ + protected function _getEmoticons() + { + return $this->returnJsonArray( $this->editor->fetchEmoticons( 250 ) ); + } + + /** + * Show settings box + * + * @return @e void + */ + protected function _showSettings() + { + $this->returnHtml( $this->registry->getClass('output')->getTemplate('editors')->editorSettings() ); + } + + /** + * Save settings + * + * @return @e void + */ + protected function _saveSettings() + { + if( !$this->memberData['member_id'] ) + { + $this->returnJsonError( 'nopermission' ); + } + + $clearSavedContent = intval( $this->request['clearSavedContent'] ); + $bw_cke_contextmenu = intval( $this->request['bw_cke_contextmenu'] ); + + if ( $clearSavedContent ) + { + $this->DB->delete( 'core_editor_autosave', 'eas_member_id=' . $this->memberData['member_id'] ); + } + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'bw_cke_contextmenu' => $bw_cke_contextmenu ) ) ); + $member = IPSMember::load( $this->memberData['member_id'] ); + + + /* return if no errors occurred */ + return $this->returnJsonArray( array( 'status' => 'ok' ) ); + } + + /** + * Switch between bbcode and rte on the fly, man + * + * @return @e void + */ + protected function _switch() + { + $content = $_POST['content']; + + IPSDebug::fireBug( 'info', array( 'Content received: ' . $content ) ); + + if ( $content ) + { + $content = $this->editor->switchContent( $content, intval( $_POST['isRte'] ) ); + } + + IPSDebug::fireBug( 'info', array( 'Content after conversion: ' . $content ) ); + + /* return if no errors occurred */ + return $this->returnString( $content ); + } + + /** + * Show more dialogue + * + * @param string App + * @param string Area + * @param int Relationship ID + * @return @e void + */ + protected function _autoSave( $autoSaveKey ) + { + if ( $_POST['content'] && $autoSaveKey ) + { + $this->editor->autoSave( $_POST['content'], $autoSaveKey ); + } + + /* return if no errors occurred */ + return $this->returnJsonArray( array( 'status' => 'ok' ) ); + } + + +} diff --git a/upload/admin/applications/core/modules_public/ajax/facebook.php b/upload/admin/applications/core/modules_public/ajax/facebook.php index ebd8d57f..c6025caf 100644 --- a/upload/admin/applications/core/modules_public/ajax/facebook.php +++ b/upload/admin/applications/core/modules_public/ajax/facebook.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Login handler abstraction : AJAX login
    - * Last Updated: $Date: 2010-01-25 11:58:04 -0500 (Mon, 25 Jan 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: matt $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 5747 $ + * @version $Revision: 8644 $ * */ @@ -30,7 +30,6 @@ class public_core_ajax_facebook extends ipsAjaxCommand /** * Login handler object * - * @access protected * @var object */ protected $han_login; @@ -38,7 +37,6 @@ class public_core_ajax_facebook extends ipsAjaxCommand /** * Flag : Logged in * - * @access protected * @var boolean */ protected $logged_in = false; @@ -46,9 +44,8 @@ class public_core_ajax_facebook extends ipsAjaxCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -68,10 +65,9 @@ class public_core_ajax_facebook extends ipsAjaxCommand /** * Main AJAX log in routine * - * @access private - * @return void [Outputs JSON to browser AJAX call] + * @return @e void [Outputs JSON to browser AJAX call] */ - private function _getUserByFbId() + protected function _getUserByFbId() { //----------------------------------------- // INIT diff --git a/upload/admin/applications/core/modules_public/ajax/findnames.php b/upload/admin/applications/core/modules_public/ajax/findnames.php index 3f024d3e..290b85da 100644 --- a/upload/admin/applications/core/modules_public/ajax/findnames.php +++ b/upload/admin/applications/core/modules_public/ajax/findnames.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Login handler abstraction : AJAX Find Names functions
    - * Last Updated: $Date: 2010-04-14 19:25:27 -0400 (Wed, 14 Apr 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 6118 $ + * @version $Revision: 8644 $ * @see admin_core_ajax_findnames * */ @@ -31,9 +31,8 @@ class public_core_ajax_findnames extends ipsAjaxCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -48,10 +47,9 @@ class public_core_ajax_findnames extends ipsAjaxCommand /** * Returns possible matches for the string input * - * @access private - * @return void Outputs to screen + * @return @e void Outputs to screen */ - private function _getMemberNames() + protected function _getMemberNames() { //----------------------------------------- // INIT @@ -97,10 +95,10 @@ class public_core_ajax_findnames extends ipsAjaxCommand while( $r = $this->DB->fetch() ) { $photo = IPSMember::buildProfilePhoto( $r ); - $group = IPSLib::makeNameFormatted( '' , $r['member_group_id'] ); + $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], 'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')', - 'img' => $photo['pp_thumb_photo'], + 'img' => $photo['pp_mini_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height'] ); diff --git a/upload/admin/applications/core/modules_public/ajax/index.html b/upload/admin/applications/core/modules_public/ajax/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/ajax/index.html +++ b/upload/admin/applications/core/modules_public/ajax/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/like.php b/upload/admin/applications/core/modules_public/ajax/like.php index 6ff65489..c2727ed2 100644 --- a/upload/admin/applications/core/modules_public/ajax/like.php +++ b/upload/admin/applications/core/modules_public/ajax/like.php @@ -1,19 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Like Ajax - * Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $ - * - * - * @author $Author: matt $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Gallery - * @link http://www.invisionpower.com - * @version $Rev: 6767 $ - * + * @file like.php Provides ajax methods for the central like/follow class + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: bfarber $ + * @since - + * $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $ + * @version v3.2.3 + * $Revision: 9373 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -22,20 +17,25 @@ if ( ! defined( 'IN_IPB' ) ) exit(); } +/** + * + * @class public_core_ajax_like + * @brief Provides ajax methods for the central like/follow class + */ class public_core_ajax_like extends ipsAjaxCommand { /** - * Main class entry point + * Main function executed automatically by the controller * - * @param object ipsRegistry reference - * @return void [Outputs to screen] - */ + * @param object $registry Registry object + * @return @e void + */ public function doExecute( ipsRegistry $registry ) { /* From App */ - $app = trim( $this->request['f_app'] ); - $area = trim( $this->request['f_area'] ); - $relid = intval( $this->request['f_relid'] ); + $app = trim( $this->request['f_app'] ); + $area = trim( $this->request['f_area'] ); + $relid = intval( $this->request['f_relid'] ); if ( ! $app OR ! $area OR empty( $relid ) ) { @@ -43,7 +43,7 @@ class public_core_ajax_like extends ipsAjaxCommand } /* Init some data */ - require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ $this->_like = classes_like::bootstrap( $app, $area ); $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_like' ), 'core' ); @@ -53,42 +53,38 @@ class public_core_ajax_like extends ipsAjaxCommand { case 'setDialogue': $this->_setDialogue( $app, $area, $relid ); - break; + break; case 'save': - $this->_save( $app, $area, $relid ); - break; + $this->_save( $relid ); + break; case 'unset': - $this->_unset( $app, $area, $relid ); - break; + $this->_unset( $relid ); + break; case 'more': - $this->_more( $app, $area, $relid ); - break; + $this->_more( $relid ); + break; } } /** * Show more dialogue * - * @param string App - * @param string Area - * @param int Relationship ID - * @return void + * @param integer $relid Relationship ID + * @return @e void */ - protected function _more( $app, $area, $relid ) + protected function _more( $relid ) { /* Fetch data */ return $this->returnHtml( $this->_like->render( 'more', $relid ) ); } /** - * Do unset + * Do unset like * - * @param string App - * @param string Area - * @param int Relationship ID - * @return void + * @param integer $relid Relationship ID + * @return @e void */ - protected function _unset( $app, $area, $relid ) + protected function _unset( $relid ) { if( !$this->memberData['member_id'] ) { @@ -103,14 +99,12 @@ class public_core_ajax_like extends ipsAjaxCommand } /** - * Save form + * Save like * - * @param string App - * @param string Area - * @param int Relationship ID - * @return void + * @param integer $relid Relationship ID + * @return @e void */ - protected function _save( $app, $area, $relid ) + protected function _save( $relid ) { if( !$this->memberData['member_id'] ) { @@ -125,16 +119,17 @@ class public_core_ajax_like extends ipsAjaxCommand $this->_like->add( $relid, $this->memberData['member_id'], array( 'like_notify_do' => $like_notify, 'like_notify_freq' => $like_freq ), $like_anon ); /* Fetch data */ - return $this->returnHtml( $this->_like->render( 'summary', $relid ) ); + return $this->returnHtml( $this->_like->render( 'summary', $relid ) ); + /* This used to force response as UTF-8, but that caused this bug: @link http://community.invisionpower.com/tracker/issue-32255-character-conversion-bug-with-follow-this-x */ } /** * Show set form * - * @param string App - * @param string Area - * @param int Relationship ID - * @return void + * @param string $app Application + * @param string $area Area + * @param integer $relid Relationship ID + * @return @e void */ protected function _setDialogue( $app, $area, $relid ) { @@ -147,5 +142,4 @@ class public_core_ajax_like extends ipsAjaxCommand return $this->returnHtml( $this->registry->getClass('output')->getTemplate('global_other')->likeSetDialogue( $app, $area, $relid, $data ) ); } - -} +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/login.php b/upload/admin/applications/core/modules_public/ajax/login.php index 670c9292..81bec3ad 100644 --- a/upload/admin/applications/core/modules_public/ajax/login.php +++ b/upload/admin/applications/core/modules_public/ajax/login.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Login handler abstraction : AJAX login
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 6995 $ + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -43,7 +43,7 @@ class public_core_ajax_login extends ipsAjaxCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -88,9 +88,9 @@ class public_core_ajax_login extends ipsAjaxCommand /** * Authenticate a user, returns a JSON array * - * @return void [Outputs JSON to browser AJAX call] + * @return @e void [Outputs JSON to browser AJAX call] */ - private function _authenticateUser() + protected function _authenticateUser() { //----------------------------------------- // INIT @@ -117,9 +117,9 @@ class public_core_ajax_login extends ipsAjaxCommand /** * Main AJAX log in routine * - * @return void [Outputs JSON to browser AJAX call] + * @return @e void [Outputs JSON to browser AJAX call] */ - private function _doLogIn() + protected function _doLogIn() { //----------------------------------------- // Use central method diff --git a/upload/admin/applications/core/modules_public/ajax/media.php b/upload/admin/applications/core/modules_public/ajax/media.php new file mode 100644 index 00000000..2bc73e27 --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/media.php @@ -0,0 +1,128 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Handles ajax functions for IP.Board Text Editor + * Author: Matt "Matt Mecham" Mecham + * Last Updated: $LastChangedDate: 2011-08-18 17:50:15 -0400 (Thu, 18 Aug 2011) $ + * + * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Gallery + * @link http://hatynka.in + * @version $Rev: 9399 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_ajax_media extends ipsAjaxCommand +{ + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Init + //----------------------------------------- + + $this->lang->loadLanguageFile( array( 'public_editors' ), 'core' ); + + //----------------------------------------- + // Route action + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'loadtab': + $this->_showTab(); + break; + + case 'show': + default: + $this->_showPane(); + break; + } + } + + /** + * Show a tab + * + * @return @e void + */ + protected function _showTab() + { + $app = trim($this->request['tabapp']); + $plugin = trim($this->request['tabplugin']); + $output = ''; + $string = $this->convertAndMakeSafe( $this->request['search'], TRUE ); + + if( $app AND is_file( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php' ) ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/sharedmedia/plugin_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app ); + $_plugin = new $classToLoad( $this->registry ); + $output = $_plugin->showTab( $string ); + } + else + { + $output = $this->registry->output->getTemplate('editors')->sharedMediaDefault(); + } + + return $this->returnHtml( $output ); + } + + /** + * Show the panel to select your media + * + * @return @e void + */ + protected function _showPane() + { + //----------------------------------------- + // Loop through apps and collect tabs + //----------------------------------------- + + $_plugins = array(); + $_tabs = array(); + + foreach( ipsRegistry::$applications as $application ) + { + if( is_dir( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) ) + { + try + { + foreach( new DirectoryIterator( IPSLib::getAppDir( $application['app_directory'] ) . '/extensions/sharedmedia' ) as $file ) + { + if( ! $file->isDot() && $file->isFile() ) + { + if( preg_match( '/^plugin_(.+?)\.php$/', $file->getFileName(), $matches ) ) + { + $classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $application['app_directory'] . '_' . $matches[1], $application['app_directory'] ); + $_plugins[ $application['app_directory'] ][ $matches[1] ] = new $classToLoad( $this->registry ); + + if( $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() ) + { + $_tabs[] = array( 'app' => $application['app_directory'], 'plugin' => $matches[1], 'title' => $_plugins[ $application['app_directory'] ][ $matches[1] ]->getTab() ); + } + } + } + } + } catch ( Exception $e ) {} + } + } + + return $this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('editors')->sharedMedia( $_tabs ) ) ); + } + +} diff --git a/upload/admin/applications/core/modules_public/ajax/modcp.php b/upload/admin/applications/core/modules_public/ajax/modcp.php new file mode 100644 index 00000000..d9030c66 --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/modcp.php @@ -0,0 +1,174 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class public_core_ajax_modcp + * @brief Moderator control panel + * + */ +class public_core_ajax_modcp extends ipsAjaxCommand +{ + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Load basic things + //----------------------------------------- + + $this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) ); + + //----------------------------------------- + // Which road are we going to take? + //----------------------------------------- + + switch( $this->request['do'] ) + { + default: + case 'index': + $this->_getTab(); + break; + + case 'getmembers': + $this->_getMembers(); + break; + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->registry->getClass('output')->addContent( $this->output ); + $this->registry->output->sendOutput(); + } + + /** + * Returns possible matches for the string input + * + * @return @e void Outputs to screen + */ + protected function _getMembers() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $name = IPSText::convertUnicode( $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.member_id, m.members_seo_name', + 'from' => array( 'members' => 'm' ), + 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $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() ) + { + $url = $this->registry->output->buildSEOUrl( "app=core&module=modcp&section=editmember&mid={$r['member_id']}", 'public' ); + $photo = IPSMember::buildProfilePhoto( $r ); + $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); + + $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], + 'showas'=> $r['members_display_name'], + 'img' => $photo['pp_thumb_photo'], + 'img_w' => $photo['pp_mini_width'], + 'img_h' => $photo['pp_mini_height'], + 'url' => $url, + ); + } + + $this->returnJsonArray( $return ); + } + + /** + * Retrieve modcp tab based + * + * @return @e void + */ + protected function _getTab() + { + //----------------------------------------- + // Init + //----------------------------------------- + + ipsRegistry::getAppClass( 'forums' ); + + $app = trim($this->request['fromapp']); + $plugin = trim($this->request['tab']); + $moderator = $this->registry->class_forums->getModerator(); + $_output = ''; + + //----------------------------------------- + // Get plugin output + //----------------------------------------- + + if( is_file( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php' ) ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app ); + $_thisPlugin = new $classToLoad( $this->registry ); + + $_output = $_thisPlugin->executePlugin( $moderator ); + } + + //----------------------------------------- + // Output + //----------------------------------------- + + if( $_output ) + { + $this->returnJsonArray( array( 'html' => $_output ) ); + } + else + { + $this->returnJsonError( $this->lang->words['plugin_not_found'] ); + } + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/navigation.php b/upload/admin/applications/core/modules_public/ajax/navigation.php new file mode 100644 index 00000000..90ae65b3 --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/navigation.php @@ -0,0 +1,71 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class public_core_ajax_navigation + * @brief Navigation builder + * + */ +class public_core_ajax_navigation extends ipsAjaxCommand +{ + /** + * 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() ) ); + } + } + + +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/notifications.php b/upload/admin/applications/core/modules_public/ajax/notifications.php index bae41893..1a79b74a 100644 --- a/upload/admin/applications/core/modules_public/ajax/notifications.php +++ b/upload/admin/applications/core/modules_public/ajax/notifications.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Notification AJAX methods
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-09-21 09:23:48 -0400 (Wed, 21 Sep 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 5713 $ + * @version $Revision: 9524 $ * */ @@ -30,9 +30,8 @@ class public_core_ajax_notifications extends ipsAjaxCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -56,9 +55,8 @@ class public_core_ajax_notifications extends ipsAjaxCommand /** * Retrieve next notification for user * - * @access protected * @param string Database order (asc/desc) - * @return void [Outputs JSON to browser AJAX call] + * @return @e void [Outputs JSON to browser AJAX call] */ protected function getMoreNotifications( $dir='DESC' ) { @@ -139,8 +137,7 @@ class public_core_ajax_notifications extends ipsAjaxCommand /** * Retrieve user's last x notifications * - * @access protected - * @return void [Outputs JSON to browser AJAX call] + * @return @e void [Outputs JSON to browser AJAX call] */ protected function getMyNotifications() { @@ -148,7 +145,7 @@ class public_core_ajax_notifications extends ipsAjaxCommand // We logged in? //----------------------------------------- - if( !$this->memberData['member_id'] ) + if ( ! $this->memberData['member_id'] ) { $this->returnJsonError( $this->lang->words['notifylogin_error'] ); } @@ -161,20 +158,18 @@ class public_core_ajax_notifications extends ipsAjaxCommand $notifyLibrary = new $classToLoad( $this->registry ); $notifyLibrary->setMember( $this->memberData ); - $_data = $notifyLibrary->fetchUnreadNotifications( 10, 'notify_sent', 'DESC', false ); + $_data = $notifyLibrary->fetchLatestNotifications( 10 ); //----------------------------------------- // Now mark them all read //----------------------------------------- - $this->DB->update( 'inline_notifications', array( 'notify_read' => 1 ), 'notify_to_id=' . $this->memberData['member_id'] ); - - $notifyLibrary->rebuildUnreadCount(); + $notifyLibrary->markNotificationsAsReadByMemberId( $this->memberData['member_id'] ); //----------------------------------------- // Return results //----------------------------------------- - $this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) ); + $this->returnJsonArray( array( 'html' => $this->cleanOutput( $this->registry->output->getTemplate('global_other')->notificationsList( $_data ) ) ) ); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/register.php b/upload/admin/applications/core/modules_public/ajax/register.php index 78561048..8177977b 100644 --- a/upload/admin/applications/core/modules_public/ajax/register.php +++ b/upload/admin/applications/core/modules_public/ajax/register.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Registration AJAX routines
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Who knows... - * @version $Revision: 6995 $ + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -29,7 +29,7 @@ class public_core_ajax_register extends ipsAjaxCommand * Main class entry point * * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -50,7 +50,7 @@ class public_core_ajax_register extends ipsAjaxCommand /** * Check the email address * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function checkEmail() { @@ -136,7 +136,7 @@ class public_core_ajax_register extends ipsAjaxCommand /** * Check the name or display name * - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function checkDisplayName( $field='members_display_name' ) { diff --git a/upload/admin/applications/core/modules_public/ajax/reports.php b/upload/admin/applications/core/modules_public/ajax/reports.php index b056638a..a6024afb 100644 --- a/upload/admin/applications/core/modules_public/ajax/reports.php +++ b/upload/admin/applications/core/modules_public/ajax/reports.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Reports AJAX options
    - * Last Updated: $Date: 2010-10-19 10:40:05 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6995 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -28,7 +28,7 @@ class public_core_ajax_reports extends ipsAjaxCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -51,9 +51,9 @@ class public_core_ajax_reports extends ipsAjaxCommand /** * Adds a rating to the index * - * @return void + * @return @e void */ - private function _changeStatus() + protected function _changeStatus() { //----------------------------------------- // Get status's and flags diff --git a/upload/admin/applications/core/modules_public/ajax/reputation.php b/upload/admin/applications/core/modules_public/ajax/reputation.php index 5e4528d3..253840e8 100644 --- a/upload/admin/applications/core/modules_public/ajax/reputation.php +++ b/upload/admin/applications/core/modules_public/ajax/reputation.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Reputation
    - * Last Updated: $Date: 2010-10-14 17:24:55 -0400 (Thu, 14 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6982 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -28,7 +28,7 @@ class public_core_ajax_reputation extends ipsAjaxCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -36,19 +36,97 @@ class public_core_ajax_reputation extends ipsAjaxCommand switch( $this->request['do'] ) { case 'add_rating': - $this->doRating(); + $this->_doRating(); + break; + + case 'more': + $this->_more(); + break; + + case 'view': + $this->_viewRep(); break; } exit(); } + /** + * Displays reputation popup + * + * @return @e void + */ + protected function _viewRep() + { + $this->lang->loadLanguageFile( array( 'public_topic' ), 'forums' ); + + if ( !$this->memberData['gbw_view_reps'] ) + { + $this->returnJsonError('no_permission'); + } + + $repApp = $this->request['repApp']; + $repType = $this->request['repType']; + $repId = intval($this->request['repId']); + + /* Get data */ + $reps = array(); + $members = array(); + + $this->DB->build( array( + 'select' => 'member_id, rep_rating', + 'from' => 'reputation_index', + 'where' => "app='{$repApp}' AND type='{$repType}' AND type_id='{$repId}'", + 'order' => 'rep_date', + ) ); + $q = $this->DB->execute(); + + while ( $r = $this->DB->fetch( $q ) ) + { + $reps[ $r['member_id'] ] = $r; + $members[ $r['member_id'] ] = $r['member_id']; + } + + if( count($members) AND count($reps) ) + { + $_members = IPSMember::load( $members ); + + foreach( $reps as $memId => $repData ) + { + $reps[ $memId ]['member'] = $_members[ $memId ]; + } + } + + return $this->returnHtml( $this->registry->output->getTemplate('global_other')->reputationPopup( $reps ) ); + } + /** * Adds a rating to the index * - * @return void + * @return @e void */ - public function doRating() + protected function _more() + { + $app = trim( $this->request['f_app'] ); + $type = trim( $this->request['f_type'] ); + $id = intval( $this->request['f_id'] ); + + /* Get the rep library */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' ); + $repCache = new $classToLoad(); + + /* Fetch members who have wanted to favorite this item */ + $data = $repCache->getDataByRelationshipId( array( 'app' => $app, 'type' => $type, 'id' => $id, 'rating' => 1 ) ); + + return $this->returnHtml( $this->registry->output->getTemplate( 'global_other' )->repMoreDialogue( $data, $id ) ); + } + + /** + * Adds a rating to the index + * + * @return @e void + */ + protected function _doRating() { /* INIT */ $app = $this->request['app_rate']; @@ -67,12 +145,21 @@ class public_core_ajax_reputation extends ipsAjaxCommand $repCache = new $classToLoad(); /* Add the rating */ - if( $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) === false ) + if ( $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) !== false ) { - $this->returnString( $repCache->error_message ); + $formatted = $repCache->getLikeFormatted( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) ); + $current = $repCache->getCurrentMemberRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type, 'memberId' => $this->memberData['member_id'] ) ); + $rating = $repCache->getCurrentRating( array( 'id' => $type_id, 'app' => $app, 'type' => $type ) ); + + $this->returnJsonArray( array( 'status' => 'ok', 'rating' => $rating, 'likeData' => $formatted, 'canRepUp' => IPSMember::canRepUp( $current, $this->memberData ), 'canRepDown' => IPSMember::canRepDown( $current, $this->memberData ) ) ); } else { + if ( $repCache->error_message ) + { + $this->returnJsonError( $repCache->error_message ); + } + $this->returnString( 'done' ); } } diff --git a/upload/admin/applications/core/modules_public/ajax/search.php b/upload/admin/applications/core/modules_public/ajax/search.php new file mode 100644 index 00000000..223bd531 --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/search.php @@ -0,0 +1,192 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class public_core_ajax_search + * @brief Search VNC configurator + * + */ +class public_core_ajax_search extends ipsAjaxCommand +{ + /** + * 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; + } + } + + /** + * Save the form to configure VNC forum filters + * + * @return @e void + */ + public function saveForm() + { + $vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' ); + + /* Filter forums for VNC */ + if( !empty($this->request['saveVncFilters']) ) + { + $this->request['saveVncFilters'] = rtrim( $this->request['saveVncFilters'], ',' ); + + if( $this->request['saveVncFilters'] == 'all' ) + { + unset($vncPrefs['forums']['vnc_forum_filter']); + } + else if( strpos( $this->request['saveVncFilters'], ',' ) !== false ) + { + $vncPrefs['forums']['vnc_forum_filter'] = explode( ',', $this->request['saveVncFilters'] ); + } + else if( !empty($this->request['saveVncFilters']) ) + { + $vncPrefs['forums']['vnc_forum_filter'] = array( $this->request['saveVncFilters'] ); + } + } + + IPSMember::setToMemberCache( $this->memberData, array( 'vncPrefs' => $vncPrefs ) ); + + $this->returnJsonArray( array( 'ok' => true ) ); + } + + /** + * Show the form to configure VNC forum filters + * + * @return @e void + */ + public function showForm() + { + $_data = $this->_getData(); + $vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' ); + $fFP = $vncPrefs == null ? null : ( empty($vncPrefs['forums']['vnc_forum_filter']) ? null : $vncPrefs['forums']['vnc_forum_filter'] ); + + $this->returnHtml( $this->registry->output->getTemplate('search')->forumsVncFilters( $_data, $fFP ) ); + } + + /** + * Fetches forum jump data + * + * @return string + */ + private function _getData() + { + $depth_guide = 0; + $links = array(); + + if( is_array($this->registry->class_forums->forum_cache['root'] ) AND count($this->registry->class_forums->forum_cache['root'] ) ) + { + foreach($this->registry->class_forums->forum_cache['root'] as $forum_data ) + { + if ( $forum_data['sub_can_post'] or ( isset($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) AND is_array($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) AND count($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) ) ) + { + $forum_data['redirect_on'] = isset( $forum_data['redirect_on'] ) ? $forum_data['redirect_on'] : 0; + + if ( $forum_data['redirect_on'] == 1 ) + { + continue; + } + + $links[] = array( 'important' => true, 'depth' => $depth_guide, 'title' => $forum_data['name'], 'id' => $forum_data['id'] ); + + if ( isset($this->registry->class_forums->forum_cache[ $forum_data['id'] ]) AND is_array($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) ) + { + $depth_guide++; + + foreach($this->registry->class_forums->forum_cache[ $forum_data['id'] ] as $forum_data ) + { + if ( $forum_data['redirect_on'] == 1 ) + { + continue; + } + + $links[] = array( 'depth' => $depth_guide, 'title' => $forum_data['name'], 'id' => $forum_data['id'] ); + + $links = $this->_getDataRecursively( $forum_data['id'], $links, $depth_guide ); + } + + $depth_guide--; + } + } + } + } + + return $links; + } + + /** + * Internal helper function for forumsForumJump + * + * @param integer $root_id + * @param array $links + * @param string $depth_guide + * @return string + */ + private function _getDataRecursively( $root_id, $links=array(), $depth_guide=0 ) + { + if ( isset( $this->registry->class_forums->forum_cache[ $root_id ] ) AND is_array($this->registry->class_forums->forum_cache[ $root_id ] ) ) + { + $depth_guide++; + + foreach($this->registry->class_forums->forum_cache[ $root_id ] as $forum_data ) + { + if ( $forum_data['redirect_on'] == 1 ) + { + continue; + } + + $links[] = array( 'depth' => $depth_guide, 'title' => $forum_data['name'], 'id' => $forum_data['id'] ); + + $links = $this->_getDataRecursively( $forum_data['id'], $links, $depth_guide ); + } + } + + return $links; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/sharelinks.php b/upload/admin/applications/core/modules_public/ajax/sharelinks.php index a384c639..2c92ef23 100644 --- a/upload/admin/applications/core/modules_public/ajax/sharelinks.php +++ b/upload/admin/applications/core/modules_public/ajax/sharelinks.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * AJAX Sharelinks
    - * Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-09-08 03:56:43 -0400 (Thu, 08 Sep 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Revision: 6997 $ + * @link http://hatynka.in + * @version $Revision: 9465 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -28,7 +28,7 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -56,16 +56,16 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand /** * Displays a form of facebook stuff. It's really that exciting. * - * @return void [Outputs HTML to browser AJAX call] + * @return @e void [Outputs HTML to browser AJAX call] */ - private function _facebookForm() + protected function _facebookForm() { /* Ensure we have a twitter account and that */ if ( $this->memberData['member_id'] AND $this->memberData['fb_uid'] AND $this->memberData['fb_token'] ) { /* Connect to the Facebook */ - require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' ); - $connect = new facebook_connect( $this->registry ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $connect = new $classToLoad( $this->registry ); try { @@ -80,22 +80,23 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand } else { - /* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */ - $this->returnHtml( 'x' ); + /* Oh go on then */ + $this->returnHtml( $this->registry->output->getTemplate('global_other')->facebookPop( array() ) ); } } /** * Go go Facebook go * - * @return void [Outputs HTML to browser AJAX call] + * @return @e void [Outputs HTML to browser AJAX call] */ - private function _facebookGo() + protected function _facebookGo() { /* INIT */ $comment = trim( urldecode( $_POST['comment'] ) ); $url = trim( urldecode( $_POST['url'] ) ); $title = trim( urldecode( $_POST['title'] ) ); + $comment = ( $comment == $this->lang->words['fb_share_default'] ) ? '' : $comment; /* Ensure title is correctly de-html-ized */ $title = IPSText::UNhtmlspecialchars( $title ); @@ -104,8 +105,8 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand if ( $this->memberData['member_id'] AND $this->memberData['fb_uid'] AND $this->memberData['fb_token'] ) { /* Connect to the Facebook */ - require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' ); - $connect = new facebook_connect( $this->registry ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $connect = new $classToLoad( $this->registry ); try { @@ -144,9 +145,9 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand /** * Go go twitter go * - * @return void [Outputs HTML to browser AJAX call] + * @return @e void [Outputs HTML to browser AJAX call] */ - private function _twitterGo() + protected function _twitterGo() { /* INIT */ $tweet = trim( urldecode( $_POST['tweet'] ) ); @@ -160,8 +161,8 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand if ( $this->memberData['member_id'] AND $this->memberData['twitter_id'] AND $this->memberData['twitter_token'] AND $this->memberData['twitter_secret'] ) { /* Connect to the twitter */ - require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' ); - $connect = new twitter_connect( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $connect = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); $user = $connect->fetchUserData(); if ( $user['id'] ) @@ -200,16 +201,16 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand /** * Displays a form of twitter stuff. It's really that exciting. * - * @return void [Outputs HTML to browser AJAX call] + * @return @e void [Outputs HTML to browser AJAX call] */ - private function _twitterForm() + protected function _twitterForm() { /* Ensure we have a twitter account and that */ if ( $this->memberData['member_id'] AND $this->memberData['twitter_id'] AND $this->memberData['twitter_token'] AND $this->memberData['twitter_secret'] ) { /* Connect to the twitter */ - require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' ); - $connect = new twitter_connect( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $connect = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); $user = $connect->fetchUserData(); if ( $user['id'] ) @@ -218,13 +219,13 @@ class public_core_ajax_sharelinks extends ipsAjaxCommand } else { - /* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */ - $this->returnHtml( '.' ); + /* Bog off */ + $this->returnHtml( 'x' ); } } else { - /* Bog off @todo probably grab the URL and doc title and forward to normal twitter.com/submit link */ + /* Bog off */ $this->returnHtml( 'x' ); } } diff --git a/upload/admin/applications/core/modules_public/ajax/skingen.php b/upload/admin/applications/core/modules_public/ajax/skingen.php new file mode 100644 index 00000000..2ee497d1 --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/skingen.php @@ -0,0 +1,79 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Like Ajax + * Last Updated: $LastChangedDate: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $ + * + * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Gallery + * @link http://hatynka.in + * @version $Rev: 8644 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_ajax_skingen extends ipsAjaxCommand +{ + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinGenerator.php' );/*noLibHook*/ + + $this->skinFunctions = new skinGenerator( $registry ); + + /* What to do? */ + switch( $this->request['do'] ) + { + case 'save': + $this->_save(); + break; + } + } + + /** + * Find tags + * + * @return @e void + */ + protected function _save() + { + /* Init */ + $storedClasses = json_decode( $_POST['storedClasses'], true ); + $storedSettings = json_decode( $_POST['storedSettings'], true ); + $css = $_POST['css']; + + /* Build it, ship it, wiggle your hips a bit */ + try + { + /* Apologies for the previous comment */ + $this->skinFunctions->resetMemberAndSwitchSkin( $this->memberData['member_id'] ); + + $this->skinFunctions->save( array( 'css' => $css, 'storedSettings' => $storedSettings, 'storedClasses' => $storedClasses ), $this->memberData['member_id'] ); + } + catch( Exception $e ) + { + return $this->returnJsonArray( array('status' => 'error', 'msg' => $e->getMessage() ) ); + } + + /* Done */ + return $this->returnJsonArray( array('status' => 'ok' ) ); + } + +} diff --git a/upload/admin/applications/core/modules_public/ajax/tags.php b/upload/admin/applications/core/modules_public/ajax/tags.php new file mode 100644 index 00000000..d1bed59d --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/tags.php @@ -0,0 +1,95 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Like Ajax + * Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $ + * + * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Gallery + * @link http://hatynka.in + * @version $Rev: 8644 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_ajax_tags extends ipsAjaxCommand +{ + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + /* What to do? */ + switch( $this->request['do'] ) + { + case 'find': + $this->_find(); + break; + } + } + + /** + * Find tags + * + * @return @e void + */ + protected function _find() + { + /* init */ + $app = $this->request['meta_app']; + $area = $this->request['meta_area']; + $parentId = intval( $this->request['meta_parent_id'] ); + $metaId = intval( $this->request['meta_id'] ); + $find = trim( $this->request['find'] ); + $tags = array(); + $sort = array(); + + /* Checks */ + if ( empty( $app ) OR empty( $area ) ) + { + return $this->returnJsonArray( array() ); + } + + /* Init tags */ + require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/ + $tagClass = classes_tags_bootstrap::run( $app, $area ); + + /* Get tags by whut */ + if ( ! empty( $metaId ) ) + { + $tags = $tagClass->getRawTagsByMetaId( $metaId, $find ); + } + else if ( ! empty( $parentId ) ) + { + $tags = $tagClass->getRawTagsByParentId( $parentId, $find ); + } + + /* format */ + if ( is_array( $tags ) && count( $tags ) ) + { + foreach( $tags as $id => $t ) + { + $sort[ strlen( $t['tag_text'] ) . '.' . md5( $t['tag_text'] ) ] = $t['tag_text']; + } + } + + ksort( $sort ); + + return $this->returnJsonArray( array_values( $sort ) ); + + } + +} diff --git a/upload/admin/applications/core/modules_public/ajax/templates.php b/upload/admin/applications/core/modules_public/ajax/templates.php new file mode 100644 index 00000000..c060241d --- /dev/null +++ b/upload/admin/applications/core/modules_public/ajax/templates.php @@ -0,0 +1,64 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class public_core_ajax_templates + * @brief Retrieve a template bit + * + */ +class public_core_ajax_templates extends ipsAjaxCommand +{ + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Fetch template bit + //----------------------------------------- + + $templateBit = trim($this->request['template_bit']); + $group = trim($this->request['template_group']); + $_lang = trim($this->request['lang_module']); + $_app = trim($this->request['lang_app']); + + if( !$templateBit OR !$group ) + { + $this->returnJsonError( $this->lang->words['missing_template_bit'] ); + } + + $templateBit = 'ajax__' . $templateBit; + + if( !is_object( $this->registry->output->getTemplate( $group ) ) OR !method_exists( $this->registry->output->getTemplate( $group ), $templateBit ) ) + { + $this->returnJsonError( $this->lang->words['missing_template_bit'] ); + } + + if( $_lang && $_app ) + { + $this->registry->class_localization->loadLanguageFile( array( 'public_' . $_lang ), $_app ); + } + + $this->returnJsonArray( array( 'html' => $this->registry->output->getTemplate( $group )->$templateBit() ), true ); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/usercp.php b/upload/admin/applications/core/modules_public/ajax/usercp.php index 04c7b610..6d950a25 100644 --- a/upload/admin/applications/core/modules_public/ajax/usercp.php +++ b/upload/admin/applications/core/modules_public/ajax/usercp.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Login handler abstraction : AJAX UserCP functions
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ * */ @@ -30,9 +30,8 @@ class public_core_ajax_usercp extends ipsAjaxCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -47,10 +46,9 @@ class public_core_ajax_usercp extends ipsAjaxCommand /** * Checks a display name * - * @access private - * @return void [Outputs JSON to browser AJAX call] + * @return @e void [Outputs JSON to browser AJAX call] */ - private function displayNameCheck() + protected function displayNameCheck() { //----------------------------------------- // INIT diff --git a/upload/admin/applications/core/modules_public/ajax/vkontakte.php b/upload/admin/applications/core/modules_public/ajax/vkontakte.php deleted file mode 100644 index 084d6f88..00000000 --- a/upload/admin/applications/core/modules_public/ajax/vkontakte.php +++ /dev/null @@ -1,121 +0,0 @@ -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_ajax_vkontakte extends ipsAjaxCommand -{ - /** - * Login handler object - * - * @access protected - * @var object - */ - protected $han_login; - - /** - * Flag : Logged in - * - * @access protected - * @var boolean - */ - protected $logged_in = false; - - /** - * Class entry point - * - * @access public - * @param object Registry reference - * @return void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - - /* What to do */ - switch( $this->request['do'] ) - { - case 'getUserByVkId': - $return = $this->_getUserByVkId(); - break; - } - - /* Output */ - $this->returnHtml( $return ); - } - - /** - * Main AJAX log in routine - * - * @access private - * @return void [Outputs JSON to browser AJAX call] - */ - private function _getUserByVkId() - { - require_once( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php' ); - $vk = new Vkontakte_Request_Validator( $this->settings['vk_api_id'], $this->settings['vk_secret'] ); - - //----------------------------------------- - // INIT - //----------------------------------------- - - $vkUid = is_numeric( $vk->mid ) ? $vk->mid : -1; - $member = array( 'member_id' => 0 ); - - if ( $vkUid ) - { - $_mid = $this->DB->buildAndFetch( array( 'select' => 'member_id', - 'from' => 'members', - 'where' => 'vk_uid=' . $vkUid ) ); - - if ( $_mid['member_id'] ) - { - $member = IPSMember::load( $_mid['member_id'], 'all' ); - } - } - - /* Create validating account for the member */ - $key = md5( uniqid( microtime() ) ); - $member['key'] = $key; - - if ( $vkUid == $this->request['id'] ) - { - - $this->DB->delete( 'vkontakte_connect', 'v_id = ' . $vkUid ); - - $name = IPSMember::getFunction()->cleanAndCheckName( $this->request['name'], array(), 'name' ); - - $photo = ''; - - if ( IPSText::xssCheckUrl( $this->request['photo'] ) && preg_match('~^http://.+?\.vkontakte\.ru/u' . $vkUid. '~is', $this->request['photo'])) - { - $photo = $this->request['photo']; - } - - $this->DB->insert( 'vkontakte_connect', array( 'v_key' => $key, - 'v_user' => $name['username'], - 'v_data' => $photo, - 'v_id' => $vkUid ) ); - - } - - $this->returnJsonArray( $member ); - } -} \ No newline at end of file diff --git a/upload/admin/applications/members/modules_public/ajax/warn.php b/upload/admin/applications/core/modules_public/ajax/warn.php similarity index 51% rename from upload/admin/applications/members/modules_public/ajax/warn.php rename to upload/admin/applications/core/modules_public/ajax/warn.php index 405b1b95..bf48ac21 100644 --- a/upload/admin/applications/members/modules_public/ajax/warn.php +++ b/upload/admin/applications/core/modules_public/ajax/warn.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Retrieve member warn log
    - * Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Members - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 7007 $ + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -23,23 +23,24 @@ if ( ! defined( 'IN_IPB' ) ) exit(); } -class public_members_ajax_warn extends ipsAjaxCommand +class public_core_ajax_warn extends ipsAjaxCommand { /** * Class entry point * * @param object Registry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { - ipsRegistry::getClass( 'class_localization')->loadLanguageFile( array( 'public_mod' ), 'forums' ); - - if ( ! $this->settings['warn_on'] ) + /* System disabled? */ + if ( !$this->settings['warn_on'] ) { + $this->lang->loadLanguageFile( array( 'public_profile' ), 'members' ); $this->returnJsonError( $this->lang->words['ajax_no_warn'] ); } + /* What to do? */ switch( $this->request['do'] ) { case 'view': @@ -51,24 +52,28 @@ class public_members_ajax_warn extends ipsAjaxCommand /** * Retieve warn logs and return them * - * @return void + * @return @e void */ - private function _viewWarnLogs() + protected function _viewWarnLogs() { - $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('members') . '/modules_public/warn/warn.php', 'public_members_warn_warn' ); - $warn = new $classToLoad(); + /* Get library and load */ + $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_public/modcp/editmember.php', 'public_core_modcp_editmember' ); + $warn = new $classToLoad(); $warn->makeRegistryShortcuts( $this->registry ); $warn->loadData(); - $warnHTML = $warn->viewLog(); + $this->lang->loadLanguageFile( array( 'public_modcp' ), 'core' ); - if ( !$warnHTML ) + $warnHTML = $warn->viewLog( true ); + + if ( $warnHTML ) { - $this->returnJsonError( $this->lang->words['ajax_bad_html'] ); + $this->returnHtml( $warnHTML ); } else { - $this->returnHtml( $this->registry->getClass('output')->getTemplate('mod')->warnLogsAjaxWrapper( $warnHTML ) ); + $this->lang->loadLanguageFile( array( 'public_profile' ), 'members' ); + $this->returnJsonError( $this->lang->words['ajax_bad_html'] ); } } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/attach/attach.php b/upload/admin/applications/core/modules_public/attach/attach.php index 9598e0bc..c0f3711a 100644 --- a/upload/admin/applications/core/modules_public/attach/attach.php +++ b/upload/admin/applications/core/modules_public/attach/attach.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Attachment Poster
    - * Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-09-07 14:34:13 -0400 (Wed, 07 Sep 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6997 $ + * @link http://hatynka.in + * @version $Rev: 9462 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -42,7 +42,7 @@ class public_core_attach_attach extends ipsCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -86,7 +86,7 @@ class public_core_attach_attach extends ipsCommand /** * View Post Attachment * - * @return void + * @return @e void */ public function showPostAttachment() { @@ -103,7 +103,7 @@ class public_core_attach_attach extends ipsCommand /** * Remove an upload * - * @return void + * @return @e void */ public function attachmentUploadRemove() { @@ -137,7 +137,7 @@ class public_core_attach_attach extends ipsCommand /** * Perform the actual upload * - * @return void + * @return @e void */ public function attachmentUploadProcess() { @@ -173,8 +173,8 @@ class public_core_attach_attach extends ipsCommand * @param string $msg * @param bool $is_error * @param integer $insert_id - * @return void - **/ + * @return @e void + */ public function attachmentUploadShow( $msg="ready", $is_error=0, $insert_id=0 ) { /* INIT JSON */ @@ -278,7 +278,7 @@ class public_core_attach_attach extends ipsCommand $JSON['attach_stats'] = $this->class_attach->attach_stats; /* Formatting nonsense for special char sets */ - array_walk_recursive( $JSON, create_function( '&$value, $key', '$value = IPSText::convertCharsets($value, "' . IPS_DOC_CHAR_SET . '", "UTF-8");' ) ); + array_walk_recursive( $JSON, array( 'IPSText', 'arrayWalkCallbackConvert' ) ); $result = json_encode( $JSON ); $result = IPSText::convertCharsets( $result, "UTF-8", IPS_DOC_CHAR_SET ); @@ -294,7 +294,7 @@ class public_core_attach_attach extends ipsCommand * @param string $msg * @param bool $is_error * @param integer $insert_id - * @return void + * @return @e void */ public function attachiFrame( $msg="ready", $is_error=0, $insert_id=0 ) { @@ -309,7 +309,7 @@ class public_core_attach_attach extends ipsCommand /** * Perform the actual upload * - * @return void + * @return @e void */ public function attachUploadiFrame() { diff --git a/upload/admin/applications/core/modules_public/attach/defaultSection.php b/upload/admin/applications/core/modules_public/attach/defaultSection.php index 580ab9c1..bbd060b0 100644 --- a/upload/admin/applications/core/modules_public/attach/defaultSection.php +++ b/upload/admin/applications/core/modules_public/attach/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default attachments section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'attach' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'attach'; \ No newline at end of file +$DEFAULT_SECTION = 'attach'; diff --git a/upload/admin/applications/core/modules_public/attach/index.html b/upload/admin/applications/core/modules_public/attach/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/attach/index.html +++ b/upload/admin/applications/core/modules_public/attach/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/captcha.php b/upload/admin/applications/core/modules_public/global/captcha.php index eeb1b786..9c989f16 100644 --- a/upload/admin/applications/core/modules_public/global/captcha.php +++ b/upload/admin/applications/core/modules_public/global/captcha.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Captcha
    - * Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 6997 $ + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -29,7 +29,7 @@ class public_core_global_captcha extends ipsCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -53,16 +53,13 @@ class public_core_global_captcha extends ipsCommand * Show the captcha image * Shows the captcha image. Good god, that was a waste of time * - * @return void + * @return @e void */ public function showImage() { /* INIT */ $captcha_unique_id = trim( $this->request['captcha_unique_id'] ); - /* GD installed? */ - $this->class_captcha->show_error_gd_img = TRUE; - /* Show Image... */ $this->class_captcha->showImage( $captcha_unique_id ); } @@ -71,7 +68,7 @@ class public_core_global_captcha extends ipsCommand * Show the captcha image * Refreshes the captcha image. * - * @return void + * @return @e void */ public function refreshImage() { diff --git a/upload/admin/applications/core/modules_public/global/comments.php b/upload/admin/applications/core/modules_public/global/comments.php index 2a92307a..4534d4d3 100644 --- a/upload/admin/applications/core/modules_public/global/comments.php +++ b/upload/admin/applications/core/modules_public/global/comments.php @@ -2,17 +2,17 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Image Ajax
    - * Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $
    + * Last Updated: $LastChangedDate: 2011-09-07 21:50:25 -0400 (Wed, 07 Sep 2011) $
      * 
    * - * @author $Author: matt $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Gallery - * @link http://www.invisionpower.com - * @version $Rev: 6767 $ + * @link http://hatynka.in + * @version $Rev: 9464 $ * */ @@ -27,17 +27,21 @@ class public_core_global_comments extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { /* From App */ $fromApp = trim( $this->request['fromApp'] ); + if( !$fromApp ) + { + $this->registry->output->showError( 'noappcomments', 100135.8 ); + } + /* Init some data */ - require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' ); + require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/ $this->_comments = classes_comments_bootstrap::controller( $fromApp ); /* What to do? */ @@ -73,8 +77,7 @@ class public_core_global_comments extends ipsCommand /** * Find last page of comments * - * @access protected - * @return void [Redirects] + * @return @e void [Redirects] */ protected function _findLastComment() { @@ -87,8 +90,7 @@ class public_core_global_comments extends ipsCommand /** * Find last page of comments * - * @access protected - * @return void [Redirects] + * @return @e void [Redirects] */ protected function _findComment() { @@ -102,8 +104,7 @@ class public_core_global_comments extends ipsCommand /** * Moderate * - * @access protected - * @return void + * @return @e void */ protected function _moderate() { @@ -129,8 +130,7 @@ class public_core_global_comments extends ipsCommand /** * Reply * - * @access public - * @return void + * @return @e void */ protected function _fetchReply() { @@ -153,16 +153,14 @@ class public_core_global_comments extends ipsCommand } catch ( Exception $error ) { - $this->returnString( 'Error ' . $error->getMessage() ); + $this->returnString( $error->getMessage() ); } } - /** * Deletes a comment * - * @access public - * @return void + * @return @e void */ protected function _delete() { @@ -198,8 +196,7 @@ class public_core_global_comments extends ipsCommand /** * Shows the edit box * - * @access public - * @return void + * @return @e void */ protected function _showEdit() { @@ -213,12 +210,12 @@ class public_core_global_comments extends ipsCommand $this->returnString( 'error' ); } - array( 'parent_id' => 'id', - 'parent_owner_id' => 'member_id', - 'parent_parent_id' => 'img_album_id', - 'parent_title' => 'caption', - 'parent_seo_title' => 'caption_seo', - 'parent_date' => 'idate' ); + array( 'parent_id' => 'id', + 'parent_owner_id' => 'member_id', + 'parent_parent_id' => 'img_album_id', + 'parent_title' => 'caption', + 'parent_seo_title' => 'caption_seo', + 'parent_date' => 'idate' ); # Get Edit form try @@ -229,10 +226,10 @@ class public_core_global_comments extends ipsCommand $parent = $this->_comments->remapFromLocal( $this->_comments->fetchParent( $parentId ), 'parent' ); /* Output */ - $this->registry->getClass('output')->setTitle( $this->title ); + $this->registry->getClass('output')->setTitle( $this->lang->words['edit_comment'] . ' ' . $parent['parent_title'] ); $this->registry->getClass('output')->addContent( $html ); - $this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] ); + $this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . ' ' . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] ); $this->registry->getClass('output')->sendOutput(); } @@ -242,11 +239,10 @@ class public_core_global_comments extends ipsCommand } } - /** + /** * Saves the post * - * @access public - * @return void + * @return @e void */ protected function _saveEdit() { @@ -283,8 +279,7 @@ class public_core_global_comments extends ipsCommand /** * Add a comment via the magic and mystery of NORMAL POSTING FOOL * - * @access protected - * @return void + * @return @e void */ protected function _add() { @@ -297,15 +292,25 @@ class public_core_global_comments extends ipsCommand { $this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_add-0', null, null, 403 ); } - + + /* If we are a guest, verify captcha */ + if( !$this->memberData['member_id'] AND $this->settings['guest_captcha'] ) + { + if ( !$this->registry->getClass('class_captcha')->validate() ) + { + $this->registry->getClass('output')->showError( 'posting_bad_captcha', '1-global-comments-_add-3', null, null, 403 ); + } + } + + /* Save the comment */ if ( $post AND $parentId ) { try { - $newCommentId = $this->_comments->add( $parentId, $_POST['Post'] ); + $newComment = $this->_comments->add( $parentId, $_POST['Post'] ); /* Redirect to find latest */ - $this->_comments->redirectToComment( 'last', $parentId ); + $this->_comments->redirectToComment( 'last', $parentId, $newComment['comment_approved'] ? false : true ); } catch( Exception $e ) { diff --git a/upload/admin/applications/core/modules_public/global/defaultSection.php b/upload/admin/applications/core/modules_public/global/defaultSection.php index 9d6a6500..240ce53a 100644 --- a/upload/admin/applications/core/modules_public/global/defaultSection.php +++ b/upload/admin/applications/core/modules_public/global/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default global section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'global' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'login'; \ No newline at end of file +$DEFAULT_SECTION = 'login'; diff --git a/upload/admin/applications/core/modules_public/global/favorites.php b/upload/admin/applications/core/modules_public/global/favorites.php deleted file mode 100644 index 2a92307a..00000000 --- a/upload/admin/applications/core/modules_public/global/favorites.php +++ /dev/null @@ -1,322 +0,0 @@ - - * Invision Power Services - * IP.Board v3.1.4 - * Image Ajax - * Last Updated: $LastChangedDate: 2010-08-18 16:55:30 +0100 (Wed, 18 Aug 2010) $ - * - * - * @author $Author: matt $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Gallery - * @link http://www.invisionpower.com - * @version $Rev: 6767 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_global_comments extends ipsCommand -{ - /** - * Main class entry point - * - * @access public - * @param object ipsRegistry reference - * @return void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - /* From App */ - $fromApp = trim( $this->request['fromApp'] ); - - /* Init some data */ - require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' ); - $this->_comments = classes_comments_bootstrap::controller( $fromApp ); - - /* What to do? */ - switch( $this->request['do'] ) - { - case 'add': - $this->_add(); - break; - case 'delete': - $this->_delete(); - break; - case 'showEdit': - $this->_showEdit(); - break; - case 'saveEdit': - $this->_saveEdit(); - break; - case 'fetchReply': - $this->_fetchReply(); - break; - case 'moderate': - $this->_moderate(); - break; - case 'findLastComment': - $this->_findLastComment(); - break; - case 'findComment': - $this->_findComment(); - break; - } - } - - /** - * Find last page of comments - * - * @access protected - * @return void [Redirects] - */ - protected function _findLastComment() - { - /* Init */ - $parentId = intval( $this->request['parentId'] ); - - $this->_comments->redirectToComment( 'last', $parentId ); - } - - /** - * Find last page of comments - * - * @access protected - * @return void [Redirects] - */ - protected function _findComment() - { - /* Init */ - $parentId = intval( $this->request['parentId'] ); - $comment_id = intval( $this->request['comment_id'] ); - - $this->_comments->redirectToComment( $comment_id, $parentId ); - } - - /** - * Moderate - * - * @access protected - * @return void - */ - protected function _moderate() - { - $parentId = intval( $this->request['parentId'] ); - $commentIds = ( is_array( $_POST['commentIds'] ) ) ? IPSLib::cleanIntArray( $_POST['commentIds'] ) : array(); - $modact = trim( $this->request['modact'] ); - - if ( count( $commentIds ) ) - { - try - { - $this->_comments->moderate( $modact, $parentId, $commentIds, $this->memberData ); - - $this->returnJsonArray( array( 'msg' => 'ok' ) ); - } - catch( Exception $error ) - { - $this->returnJsonError( 'Error ' . $error->getMessage() . ' line: ' . $error->getFile() . '.' . $error->getLine() ); - } - } - } - - /** - * Reply - * - * @access public - * @return void - */ - protected function _fetchReply() - { - /* INIT */ - $commentId = intval( $this->request['comment_id'] ); - $parentId = intval( $this->request['parentId'] ); - - /* Quick error checko */ - if ( ! $commentId OR ! $parentId ) - { - $this->returnString( 'error' ); - } - - # Get Edit form - try - { - $html = $this->_comments->fetchReply( $parentId, $commentId, $this->memberData ); - - $this->returnString( $html ); - } - catch ( Exception $error ) - { - $this->returnString( 'Error ' . $error->getMessage() ); - } - } - - - /** - * Deletes a comment - * - * @access public - * @return void - */ - protected function _delete() - { - /* INIT */ - $commentId = intval( $this->request['comment_id'] ); - $parentId = intval( $this->request['parentId'] ); - - /* Perm check (looks nice) */ - if ( $this->request['auth_key'] != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_delete-0', null, null, 403 ); - } - - /* Quick error checko */ - if ( ! $commentId OR ! $parentId ) - { - $this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 ); - } - - try - { - $this->_comments->delete( $parentId, $commentId, $this->memberData ); - - /* Redirect to find latest */ - $this->_comments->redirectToComment( 'last', $parentId ); - } - catch ( Exception $error ) - { - $this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_delete-2', null, null, 403 ); - } - } - - /** - * Shows the edit box - * - * @access public - * @return void - */ - protected function _showEdit() - { - /* INIT */ - $commentId = intval( $this->request['comment_id'] ); - $parentId = intval( $this->request['parentId'] ); - - /* Quick error checko */ - if ( ! $commentId OR ! $parentId ) - { - $this->returnString( 'error' ); - } - - array( 'parent_id' => 'id', - 'parent_owner_id' => 'member_id', - 'parent_parent_id' => 'img_album_id', - 'parent_title' => 'caption', - 'parent_seo_title' => 'caption_seo', - 'parent_date' => 'idate' ); - - # Get Edit form - try - { - $html = $this->_comments->displayEditForm( $parentId, $commentId, $this->memberData ); - - /* Get nav */ - $parent = $this->_comments->remapFromLocal( $this->_comments->fetchParent( $parentId ), 'parent' ); - - /* Output */ - $this->registry->getClass('output')->setTitle( $this->title ); - $this->registry->getClass('output')->addContent( $html ); - - $this->registry->getClass('output')->addNavigation( $this->lang->words['edit_comment'] . $parent['parent_title'], sprintf( $this->_comments->fetchSetting('urls-showParent'), $parentId ), $parent['parent_seo_title'] ); - - $this->registry->getClass('output')->sendOutput(); - } - catch ( Exception $error ) - { - $this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_showEdit-0', null, null, 403 ); - } - } - - /** - * Saves the post - * - * @access public - * @return void - */ - protected function _saveEdit() - { - /* INIT */ - $commentId = intval( $this->request['comment_id'] ); - $parentId = intval( $this->request['parentId'] ); - $post = IPSText::parseCleanValue( $_POST['Post'] ); - - /* Perm check (looks nice) */ - if ( $this->request['auth_key'] != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_saveEdit-0', null, null, 403 ); - } - - /* Quick error checko */ - if ( ! $parentId OR ! $commentId ) - { - $this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-1', null, null, 403 ); - } - - /* Edit */ - try - { - $this->_comments->edit( $parentId, $commentId, $_POST['Post'], $this->memberData ); - - $this->_comments->redirectToComment( $commentId, $parentId ); - } - catch ( Exception $error ) - { - $this->registry->getClass('output')->showError( 'no_permission', '1-global-comments-_saveEdit-2', null, null, 403 ); - } - } - - /** - * Add a comment via the magic and mystery of NORMAL POSTING FOOL - * - * @access protected - * @return void - */ - protected function _add() - { - /* init */ - $post = IPSText::parseCleanValue( $_POST['Post'] ); - $parentId = intval( $this->request['parentId'] ); - - /* Perm check (looks nice) */ - if ( $this->request['auth_key'] != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'posting_bad_auth_key', '1-global-comments-_add-0', null, null, 403 ); - } - - if ( $post AND $parentId ) - { - try - { - $newCommentId = $this->_comments->add( $parentId, $_POST['Post'] ); - - /* Redirect to find latest */ - $this->_comments->redirectToComment( 'last', $parentId ); - } - catch( Exception $e ) - { - $this->registry->output->showError( 'no_permission', '1-global-comments-_add-1', null, null, 403 ); - } - } - else - { - $this->registry->output->showError( 'no_permission', '1-global-comments-_add-2', null, null, 403 ); - } - } - - -} diff --git a/upload/admin/applications/core/modules_public/global/index.html b/upload/admin/applications/core/modules_public/global/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/global/index.html +++ b/upload/admin/applications/core/modules_public/global/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/like.php b/upload/admin/applications/core/modules_public/global/like.php new file mode 100644 index 00000000..9a5064df --- /dev/null +++ b/upload/admin/applications/core/modules_public/global/like.php @@ -0,0 +1,152 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class public_core_ajax_like + * @brief Provides ajax methods for the central like/follow class + */ +class public_core_global_like extends ipsCommand +{ + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Init some data */ + require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ + + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_like' ), 'core' ); + + /* What to do? */ + switch( $this->request['do'] ) + { + case 'unsubscribe': + $html = $this->_unsubscribe(); + break; + case 'doUnsubscribe': + $html = $this->_doUnsubscribe(); + break; + } + + /* Output */ + $this->registry->output->addContent( $html ); + $this->registry->output->sendOutput(); + } + + /** + * Perform the unsubscribe + * + * @return @e void + */ + protected function _doUnsubscribe() + { + $like_rel_id = trim( $this->request['like_rel_id'] ); + $like_area = trim( $this->request['like_area'] ); + $like_app = trim( $this->request['like_app'] ); + $like_id = trim( $this->request['like_id'] ); + + /* Member? */ + if ( ! $this->memberData['member_id'] ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-d-1' ); + } + + if ( $this->request['auth_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-d-2' ); + } + + /* Think we're safe... */ + $this->_like = classes_like::bootstrap( $like_app, $like_area ); + + /* Get data */ + $data = $this->_like->getDataByRelationshipId( $like_rel_id, false ); + + if ( $data[ $this->memberData['member_id'] ]['like_member_id'] != $this->memberData['member_id'] ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-d-3' ); + } + + /* Remove it */ + $this->_like->remove( $like_rel_id, $this->memberData['member_id'] ); + + /* Boing it */ + $this->registry->getClass('output')->redirectScreen( $this->lang->words['pg_unlike_done'], $this->registry->getClass('output')->buildUrl( 'app=core&module=search&do=followed', 'public' ) ); + } + + /** + * Show unsubscribe dialogue + * + * @return @e void + */ + protected function _unsubscribe() + { + /* Fetch data */ + $key = trim( IPSText::base64_decode_urlSafe( $this->request['key'] ) ); + + list( $app, $area, $relId, $likeMemberId, $memberId, $email ) = explode( ';', $key ); + + /* Member? */ + if ( ! $this->memberData['member_id'] ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-1' ); + } + + if ( ! $app || ! $area || ! $relId ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-1' ); + } + + if ( ( $memberId != $likeMemberId ) || ( $memberId != $this->memberData['member_id'] ) ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-2' ); + } + + if ( $email != $this->memberData['email'] ) + { + $this->registry->output->showError( 'no_permission', 'pcgl-3' ); + } + + /* Think we're safe... */ + $this->_like = classes_like::bootstrap( $app, $area ); + + /* Get data */ + $data = $this->_like->getDataByRelationshipId( $relId, false ); + + if ( ! is_array( $data[ $this->memberData['member_id'] ] ) ) + { + $this->registry->output->showError( $this->lang->words['pg_no_longer_following'], 'pcgl-4' ); + } + + /* Get meta */ + $meta = $this->_like->getMeta( $relId ); + + /* Display box, then */ + $this->registry->output->setTitle( $this->lang->words['pg_unfollow_title'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->registry->output->addNavigation( $this->lang->words['pg_unfollow_title'], '' ); + + return $this->registry->output->getTemplate('global_other')->followUnsubscribe( $data, $meta ); + } + + +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/login.php b/upload/admin/applications/core/modules_public/global/login.php index f617b5c5..c92ad011 100644 --- a/upload/admin/applications/core/modules_public/global/login.php +++ b/upload/admin/applications/core/modules_public/global/login.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Login handler abstraction
    - * Last Updated: $Date: 2010-10-07 18:12:54 -0400 (Thu, 07 Oct 2010) $
    + * Last Updated: $Date: 2011-09-16 17:49:58 -0400 (Fri, 16 Sep 2011) $
      * 
    * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 6954 $ + * @version $Revision: 9505 $ * */ @@ -30,7 +30,6 @@ class public_core_global_login extends ipsCommand /** * Login handler object * - * @access protected * @var object */ protected $han_login; @@ -38,16 +37,14 @@ class public_core_global_login extends ipsCommand /** * Facebook connect class * - * @access protected * @var object */ - private $_facebook; + protected $_facebook; /** * Initiate login handler * - * @access public - * @return void + * @return @e void */ public function initHanLogin() { @@ -59,9 +56,8 @@ class public_core_global_login extends ipsCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -117,7 +113,7 @@ class public_core_global_login extends ipsCommand } else { - $this->registry->getClass('output')->redirectScreen( $return[0], $return[1], 'false' ); + $this->registry->getClass('output')->redirectScreen( $return[0], $return[1] ); } break; @@ -133,7 +129,7 @@ class public_core_global_login extends ipsCommand } else { - $this->registry->getClass('output')->redirectScreen( $return[1], $return[2], 'false' ); + $this->registry->getClass('output')->redirectScreen( $return[1], $return[2] ); } break; @@ -163,7 +159,6 @@ class public_core_global_login extends ipsCommand /** * Attempt to automatically log a user in * - * @access public * @return array [0=Words to display,1=URL to send to] */ public function autoLogin() @@ -198,7 +193,7 @@ class public_core_global_login extends ipsCommand $method = 'show'; } - if( $this->memberData[ 'member_id' ] ) + if( $this->memberData['member_id'] ) { /* Member Sync */ IPSLib::runMemberSync( 'onLogin', $this->memberData ); @@ -233,7 +228,6 @@ class public_core_global_login extends ipsCommand /** * Delete a user's cookies * - * @access public * @param boolean Check the key * @return mixed Output error page if key checking fails, else boolean true */ @@ -288,7 +282,6 @@ class public_core_global_login extends ipsCommand /** * Show the login form * - * @access public * @param string Message to show on login form * @return string Login form HTML */ @@ -340,10 +333,13 @@ class public_core_global_login extends ipsCommand switch ($serviceClick) { case 'facebook': - $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/facebook/index.php?reg=1" ); + $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/facebook/index.php?_reg=1" ); break; case 'twitter': - $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/twitter/index.php?reg=1" ); + $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/twitter/index.php?_reg=1" ); + break; + case 'vkontakte': + $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/vkontakte/index.php?reg=1" ); break; } } @@ -380,7 +376,15 @@ class public_core_global_login extends ipsCommand } else { - $http_referrer = my_getenv('HTTP_REFERER'); + /* @link http://community.invisionpower.com/tracker/issue-32302-login-redirect-when-activating */ + if( strpos( my_getenv('HTTP_REFERER'), $this->settings['board_url'] ) === 0 ) + { + $http_referrer = my_getenv('HTTP_REFERER'); + } + else + { + $http_referrer = ''; + } } $facebookOpts = array(); @@ -429,14 +433,16 @@ class public_core_global_login extends ipsCommand /** * Verify login form submission and log user in * - * @access public * @return mixed array [0=Words to show, 1=URL to send to, 2=error array] */ public function doLogin() { - if ( $this->request['auth_key'] != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'login_no_authkey', 10193, null, null, 403 ); + if( !defined('IGNORE_AUTH_KEY') OR !IGNORE_AUTH_KEY ) + { + if ( $this->request['auth_key'] != $this->member->form_hash ) + { + $this->registry->getClass('output')->showError( 'login_no_authkey', 10193, null, null, 403 ); + } } return $this->han_login->verifyLogin(); @@ -445,7 +451,6 @@ class public_core_global_login extends ipsCommand /** * Log a user out * - * @access public * @param integer Flag to check md5 key * @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to] */ diff --git a/upload/admin/applications/core/modules_public/global/lostpass.php b/upload/admin/applications/core/modules_public/global/lostpass.php index 6fa72105..62e725d0 100644 --- a/upload/admin/applications/core/modules_public/global/lostpass.php +++ b/upload/admin/applications/core/modules_public/global/lostpass.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Recover Lost Password
    - * Last Updated: $Date: 2010-09-06 12:10:04 -0400 (Mon, 06 Sep 2010) $
    + * Last Updated: $Date: 2011-07-22 20:10:44 -0400 (Fri, 22 Jul 2011) $
      * 
    * * @author $Author $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 6832 $ + * @version $Rev: 9306 $ * */ @@ -29,9 +29,8 @@ class public_core_global_lostpass extends ipsCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -73,8 +72,7 @@ class public_core_global_lostpass extends ipsCommand /** * Validates a lost password request * - * @access public - * @return void + * @return @e void */ public function lostPasswordValidate() { @@ -149,7 +147,7 @@ class public_core_global_lostpass extends ipsCommand // Generate a new random password //----------------------------------------- - $new_pass = IPSLib::makePassword(); + $new_pass = IPSMember::makePassword(); //----------------------------------------- // Generate a new salt @@ -184,13 +182,16 @@ class public_core_global_lostpass extends ipsCommand $this->han_login->init(); $this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member ); - if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - { - $this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 ); - } + //if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + //{ + // $this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 ); + //} IPSMember::save( $member['member_id'], array( 'members' => $save_array ) ); + /* Password has been changed! */ + IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $new_pass ); + //----------------------------------------- // Send out the email... //----------------------------------------- @@ -199,9 +200,9 @@ class public_core_global_lostpass extends ipsCommand IPSText::getTextClass('email')->buildMessage( array( 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->settings['base_url'] . 'app=core&module=usercp&tab=core&area=password', + 'THE_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=usercp&tab=core&area=password', 'publicNoSession' ), 'PASSWORD' => $new_pass, - 'LOGIN' => $this->settings['base_url'] . 'app=core&module=global§ion=login', + 'LOGIN' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login', 'publicNoSession' ), 'USERNAME' => $member['name'], 'EMAIL' => $member['email'], 'ID' => $member['member_id'], @@ -265,24 +266,27 @@ class public_core_global_lostpass extends ipsCommand $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->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member ); + $this->han_login->changePass( $member['email'], $new_pass, $pass_a, $member ); //----------------------------------------- // We'll ignore any remote errors //----------------------------------------- - if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + /*if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) { // Pass not changed remotely - } + }*/ /* Update the member */ IPSMember::save( $member['member_id'], array( 'members' => $save_array ) ); + + /* Password has been changed! */ + IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $pass_a ); /* Remove "dead" validation */ $this->DB->delete( 'validating', "vid='{$validate['vid']}' OR (member_id={$member['member_id']} AND lost_pass=1)" ); - $this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=core&module=global§ion=login&do=autologin&frompass=1' ); + $this->registry->output->silentRedirect( $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login&do=autologin&frompass=1' ) ); } } } @@ -290,8 +294,7 @@ class public_core_global_lostpass extends ipsCommand /** * Completes the lost password request form * - * @access public - * @return void + * @return @e void */ public function lostPasswordEnd() { @@ -345,14 +348,13 @@ class public_core_global_lostpass extends ipsCommand $this->registry->output->showError( 'lostpass_no_mid', 2014 ); } - $validate_key = md5( IPSLib::makePassword() . uniqid( mt_rand(), TRUE ) ); + $validate_key = md5( IPSMember::makePassword() . uniqid( mt_rand(), TRUE ) ); /* Get rid of old entries for this member */ $this->DB->delete( 'validating', "member_id={$member['member_id']} AND lost_pass=1" ); /* Update the DB for this member. */ - $db_str = array( - 'vid' => $validate_key, + $db_str = array('vid' => $validate_key, 'member_id' => $member['member_id'], 'temp_group' => $member['member_group_id'], 'entry_date' => time(), @@ -374,8 +376,8 @@ class public_core_global_lostpass extends ipsCommand IPSText::getTextClass('email')->buildMessage( array( 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->settings['base_url']."app=core&module=global§ion=lostpass&do=sendform&uid=".$member['member_id']."&aid=".$validate_key, - 'MAN_LINK' => $this->settings['base_url']."app=core&module=global§ion=lostpass&do=sendform", + 'THE_LINK' => $this->registry->getClass('output')->buildUrl( "app=core&module=global§ion=lostpass&do=sendform&uid={$member['member_id']}&aid={$validate_key}", 'publicNoSession' ), + 'MAN_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=lostpass&do=sendform', 'publicNoSession' ), 'EMAIL' => $member['email'], 'ID' => $member['member_id'], 'CODE' => $validate_key, @@ -396,9 +398,8 @@ class public_core_global_lostpass extends ipsCommand /** * Displays the lost password form * - * @access public * @param string $errors - * @return void + * @return @e void */ public function lostPasswordForm( $errors="" ) { @@ -432,9 +433,8 @@ class public_core_global_lostpass extends ipsCommand /** * Shows the form for validating a lost password request * - * @access public * @param string $msg - * @return void + * @return @e void */ public function lostPasswordValidateForm( $msg='' ) { diff --git a/upload/admin/applications/core/modules_public/global/navigation.php b/upload/admin/applications/core/modules_public/global/navigation.php new file mode 100644 index 00000000..0c7a7035 --- /dev/null +++ b/upload/admin/applications/core/modules_public/global/navigation.php @@ -0,0 +1,50 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Captcha + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $ + * + * + * @author $Author $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Board + * @subpackage Core + * @link http://hatynka.in + * @since 20th February 2002 + * @version $Rev: 8644 $ + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_global_navigation extends ipsCommand +{ + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen/redirects] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Set up */ + $inapp = trim( $this->request['inapp'] ); + + /* Load navigation stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/navigation/build.php', 'classes_navigation_build' ); + $navigation = new $classToLoad( $inapp ); + + /* Return */ + $html = $this->registry->output->getTemplate( 'global_other' )->quickNavigationWrapper( $navigation->loadApplicationTabs(), $navigation->loadNavigationData(), $inapp ); + + $this->registry->getClass('output')->setTitle( $this->lang->words['navigation_title'] ); + $this->registry->getClass('output')->addContent( $html ); + $this->registry->getClass('output')->sendOutput(); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/register.php b/upload/admin/applications/core/modules_public/global/register.php index c3794b3f..65c2d9bf 100644 --- a/upload/admin/applications/core/modules_public/global/register.php +++ b/upload/admin/applications/core/modules_public/global/register.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Register
    - * Last Updated: $Date: 2010-10-05 21:26:08 -0400 (Tue, 05 Oct 2010) $
    + * Last Updated: $Date: 2011-09-02 09:58:08 -0400 (Fri, 02 Sep 2011) $
      * 
    * * @author $Author $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 6945 $ + * @version $Rev: 9447 $ * */ @@ -29,9 +29,8 @@ class public_core_global_register extends ipsCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -47,7 +46,22 @@ class public_core_global_register extends ipsCommand /* What to do */ switch( $this->request['do'] ) { + default: + case 'form': + if( $this->settings['no_reg'] > 0 ) + { + $this->registry->output->showError( 'registration_disabled', 10123, FALSE, '', 200 ); + } + + $this->registerForm(); + break; + case 'process_form': + if( $this->settings['no_reg'] > 0 ) + { + $this->registry->output->showError( 'registration_disabled', 2016, true ); + } + $this->registerProcessForm(); break; @@ -63,6 +77,10 @@ class public_core_global_register extends ipsCommand $this->registerCoppaPermsForm(); break; + //----------------------------------------- + // Validation (i.e. registration, pw change, etc.) + //----------------------------------------- + case '05': $this->_showManualForm(); break; @@ -70,7 +88,7 @@ class public_core_global_register extends ipsCommand case '07': $this->_showManualForm('newemail'); break; - + case 'reval': $this->_revalidateForm(); break; @@ -79,29 +97,16 @@ class public_core_global_register extends ipsCommand $this->_revalidateComplete(); break; + //----------------------------------------- + // Complete a partial login + //----------------------------------------- + case 'complete_login': $this->_completeRegistration(); break; case 'complete_login_do': $this->_completeRegistrationSave(); break; - - default: - case 'form': - if( $this->settings['no_reg'] > 0 ) - { - $this->registry->output->showError( 'registration_disabled', 10123, FALSE, '', 200 ); - } - - if( $this->settings['use_coppa'] == 1 and $this->request['coppa_pass'] != 1 ) - { - $this->registerCoppaStart(); - } - else - { - $this->registerForm(); - } - break; } /* Output */ @@ -109,14 +114,440 @@ class public_core_global_register extends ipsCommand $this->registry->output->sendOutput(); } + /** + * Reset a member if they are logged in + * + * @return @e void + */ + protected function _resetMember() + { + if( $this->memberData['member_id'] ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + + //----------------------------------------- + // Set some cookies + //----------------------------------------- + + IPSCookie::set( "member_id" , "0" ); + IPSCookie::set( "pass_hash" , "0" ); + IPSCookie::set( "anonlogin" , "-1" ); + + if ( is_array($_COOKIE) ) + { + foreach( $_COOKIE as $cookie => $value) + { + if ( stripos( $cookie, $this->settings['cookie_id']."ipbforum" ) !== false ) + { + IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ) , '-', -1 ); + } + } + } + + //----------------------------------------- + // Logout callbacks... + //----------------------------------------- + + $this->han_login->logoutCallback(); + + //----------------------------------------- + // Do it.. + //----------------------------------------- + + $this->member->sessionClass()->convertMemberToGuest(); + + list( $privacy, $loggedin ) = explode( '&', $this->memberData['login_anonymous'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'login_anonymous' => "{$privacy}&0", + 'last_activity' => time() ) ) ); + } + } + + /** + * Displays the registration form + * + * @param array $form_errors + * @return @e void + */ + public function registerForm( $form_errors=array() ) + { + //----------------------------------------- + // Init + //----------------------------------------- + + $final_errors = array(); + $coppa = IPSCookie::get( 'coppa' ); + $step = $this->request['step'] ? intval($this->request['step']) : 1; + + $this->settings['username_errormsg'] = str_replace( '{chars}', $this->settings['username_characters'], $this->settings['username_errormsg'] ); + + if( $coppa == 'yes' ) + { + $this->registry->output->showError( 'awaiting_coppa', 10124 ); + } + + $this->_resetMember(); + + //----------------------------------------- + // COPPA swapout + //----------------------------------------- + + if( $this->settings['use_coppa'] ) + { + $this->lang->words['confirm_over_thirteen'] = str_replace( "<#FORM_LINK#>", "{$this->settings['base_url']}app=core&module=global&section=register&do=12", $this->lang->words['confirm_over_thirteen'] ); + } + + //----------------------------------------- + // T & C + //----------------------------------------- + + $cache = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='reg_rules'" ) ); + $text = $cache['conf_value'] ? $cache['conf_value'] : $cache['conf_default']; + + IPSText::getTextClass( 'bbcode' )->parse_smilies = 1; + IPSText::getTextClass( 'bbcode' )->parse_html = 1; + IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1; + IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; + IPSText::getTextClass( 'bbcode' )->parsing_section = 'global'; + + $this->settings['_termsAndConditions'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $text ); + + //----------------------------------------- + // Page title / navigation + //----------------------------------------- + + $this->registry->output->setTitle( $this->lang->words['registration_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->registry->output->addNavigation( $this->lang->words['registration_form'], '' ); + + //----------------------------------------- + // If Nexus is installed, that is the first step + //----------------------------------------- + + if( IPSLib::appIsInstalled('nexus') AND $this->settings['nexus_reg_show'] AND $this->settings['nexus_store_online'] ) + { + //----------------------------------------- + // We just submitted the form + //----------------------------------------- + + if( $this->request['nexus_pass'] ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'nexus' ) . '/sources/hooks.php', 'nexusHooks', 'nexus' ); + $hookGateway = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Check for errors + //----------------------------------------- + + if ( $this->settings['nexus_reg_force'] and !IPSCookie::get( 'cm_reg' ) and empty( $this->request['cm_package'] ) ) + { + $nexusError = $this->lang->words['forceby_no_sel']; + } + + } + + //----------------------------------------- + // If no errors, create invoice and set cookie + //----------------------------------------- + + if ( !$nexusError and $this->request['nexus_pass'] ) + { + //----------------------------------------- + // Did we buy a package? + //----------------------------------------- + + $chosenPackages = ipsRegistry::$request['cm_package']; + + if ( !empty( $chosenPackages ) ) + { + // Get our package data + $imploded = implode( ',', ipsRegistry::$request['cm_package'] ); + $packages = array(); + ipsRegistry::DB()->build( array( 'select' => '*', 'from' => 'nexus_packages', 'where' => "p_id IN({$imploded})" ) ); + ipsRegistry::DB()->execute(); + while ( $row = ipsRegistry::DB()->fetch() ) + { + $packages[ $row['p_id'] ] = $row; + } + + // Bundle 'em all up + foreach ( $chosenPackages as $itemID ) + { + // Add title to the array + $titles[] = $packages[ $itemID ]['p_name']; + + // Process information + $shippingData = package::load( $itemID )->shippingData(); + $items[] = array( + 'act' => 'new', + 'app' => 'nexus', + 'type' => $packages[ $itemID ]['p_type'], + 'cost' => $packages[ $itemID ]['p_base_price'], + 'renew_term' => $packages[ $itemID ]['p_renewals'], + 'renew_units' => $packages[ $itemID ]['p_renewal_unit'], + 'renew_cost' => $packages[ $itemID ]['p_renewal_price'] ? $packages[ $itemID ]['p_renewal_price'] : $packages[ $itemID ]['p_base_price'], + 'itemName' => $packages[ $itemID ]['p_name'], + 'itemID' => $itemID, + 'physical' => is_null( $shippingData ) ? FALSE : TRUE, + 'shipping' => is_null( $shippingData ) ? array() : $shippingData['shipping'], + 'weight' => is_null( $shippingData ) ? 0 : $shippingData['weight'], + ); + } + + // What are we calling this invoice? + if ( count( $titles ) == 1 ) + { + $title = $titles[0]; + } + else + { + $title = implode( ', ', $titles ); + if ( strlen( $title ) > 50 ) + { + array_pop( $titles ); + $title = implode( ', ', $titles ); + while ( strlen( $title ) > 47 and count( $titles ) > 1 ) + { + array_pop( $titles ); + $title = implode( ', ', $titles ); + } + $title .= '...'; + } + } + + // Generate it + require_once( IPSLib::getAppDir('nexus') . '/sources/nexusApi.php' );/*noLibHook*/ + $invoiceID = nexusApi::generateInvoice( $title, $this->memberData['member_id'], $items ); + + IPSCookie::set( 'cm_reg', $invoiceID ); + } + } + else + { + //----------------------------------------- + // "step 1" if Nexus is set to show packages on registration + //----------------------------------------- + + require_once( IPSLib::getAppDir('nexus') . '/sources/packageCore.php' );/*noLibHook*/ + + $packages = array(); + $this->DB->build( array( 'select' => '*', 'from' => 'nexus_packages', 'where' => 'p_reg=1', 'order' => 'p_position' ) ); + $e = $this->DB->execute(); + while ( $row = $this->DB->fetch( $e ) ) + { + $packages[ $row['p_id'] ] = package::load( $row['p_id'] )->buildDisplayData(); + } + + if ( isset( $this->request['cm_package'] ) ) + { + foreach ( $this->request['cm_package'] as $packageID ) + { + $packages[ $packageID ]['checked'] = "checked='checked'"; + } + } + + $this->output .= $this->registry->output->getTemplate('nexus_payments')->regForm32( $packages, $nexusError ); + + return; + } + } + + //----------------------------------------- + // Send to an alternate registration URL? + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'login_methods', 'where' => 'login_enabled=1' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( $r['login_register_url'] ) + { + $this->registry->output->silentRedirect( $r['login_register_url'] ); + } + } + + //----------------------------------------- + // Adjust text as needed based on validation type + //----------------------------------------- + + if( $this->settings['reg_auth_type'] ) + { + if( $this->settings['reg_auth_type'] == 'admin_user' OR $this->settings['reg_auth_type'] == 'user' ) + { + $this->lang->words['std_text'] .= "
    " . $this->lang->words['email_validate_text']; + } + + /* User then admin? */ + if( $this->settings['reg_auth_type'] == 'admin_user' ) + { + $this->lang->words['std_text'] .= "
    " . $this->lang->words['user_admin_validation']; + } + + if( $this->settings['reg_auth_type'] == 'admin' ) + { + $this->lang->words['std_text'] .= "
    " . $this->lang->words['just_admin_validation']; + } + } + + //----------------------------------------- + // Captcha / Q&A + //----------------------------------------- + + $captchaHTML = ''; + $qandaHTML = ''; + + $question = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'question_and_answer', 'order' => $this->DB->buildRandomOrder(), 'limit' => array(1) ) ); + + if( $question AND count($question) ) + { + $qandaHTML = $this->registry->output->getTemplate('global_other')->questionAndAnswer( $question ); + } + + if( $this->settings['bot_antispam_type'] != 'none' ) + { + $captchaHTML = $this->registry->getClass('class_captcha')->getTemplate(); + } + + //----------------------------------------- + // Custom fields + //----------------------------------------- + + $custom_fields_out = array( 'required', 'optional' ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $custom_fields = new $classToLoad(); + + $custom_fields->member_data = $this->memberData; + $custom_fields->initData( 'edit' ); + $custom_fields->parseToEdit( 'register' ); + + if ( count( $custom_fields->out_fields ) ) + { + foreach( $custom_fields->out_fields as $id => $form_element ) + { + if ( $custom_fields->cache_data[ $id ]['pf_not_null'] == 1 ) + { + $ftype = 'required'; + } + else + { + $ftype = 'optional'; + } + + $custom_fields_out[$ftype][] = array( + 'name' => $custom_fields->field_names[ $id ], + 'desc' => $custom_fields->field_desc[ $id ], + 'field' => $form_element, + 'id' => $id, + 'error' => '', + 'type' => $custom_fields->cache_data[ $id ]['pf_type'] + ); + } + } + + //----------------------------------------- + // If Nexus is installed, also add billing information + //----------------------------------------- + + $nexusFields = array(); + $nexusStates = array(); + if( IPSLib::appIsInstalled('nexus') AND $this->settings['nexus_reg_show'] AND $this->settings['nexus_store_online'] ) + { + ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_countries' ), 'nexus' ); + + $fields = array(); + $_fields = ipsRegistry::cache()->getCache('customer_fields'); + + if( is_array($_fields) AND count($_fields) ) + { + foreach ( $_fields['reg'] as $k ) + { + $nexusFields[] = $_fields['fields'][ $k ]; + } + } + + $nexusStates = customer::generateStateDropdown( TRUE ); + } + + //----------------------------------------- + // Got errors to show? + //----------------------------------------- + + $final_errors = array( 'dname' => NULL, 'password' => NULL, 'email' => NULL, 'tos' => NULL ); + + foreach( array( 'dname', 'password', 'email', 'tos' ) as $thing ) + { + if ( isset($form_errors[ $thing ]) AND is_array( $form_errors[ $thing ] ) AND count( $form_errors[ $thing ] ) ) + { + $final_errors[ $thing ] = implode( "
    ", $form_errors[ $thing ] ); + } + } + + $this->request['PassWord'] = $this->request['PassWord'] ? $this->request['PassWord'] : '' ; + $this->request['EmailAddress'] = $this->request['EmailAddress'] ? $this->request['EmailAddress'] : '' ; + $this->request['EmailAddress_two'] = $this->request['EmailAddress_two'] ? $this->request['EmailAddress_two'] : '' ; + $this->request['PassWord_Check'] = $this->request['PassWord_Check'] ? $this->request['PassWord_Check'] : '' ; + $this->request['members_display_name'] = $this->request['members_display_name'] ? $this->request['members_display_name'] : '' ; + $this->request['time_offset'] = $this->request['time_offset'] ? $this->request['time_offset'] : '' ; + + //----------------------------------------- + // Create time zone dropdown array + //----------------------------------------- + + $this->registry->class_localization->loadLanguageFile( array( 'public_usercp' ), 'core' ); + + $time_select = array(); + + foreach( $this->lang->words as $k => $v ) + { + if( strpos( $k, "time_" ) === 0 ) + { + $k = str_replace( "time_", '', $k ); + + if( preg_match( '/^[\-\d\.]+$/', $k ) ) + { + $time_select[ $k ] = $v; + } + } + } + + ksort( $time_select ); + + $this->request['time_offset'] = ( $this->request['time_offset'] ) ? $this->request['time_offset'] : $this->settings['time_offset']; + + //----------------------------------------- + // Start output + //----------------------------------------- + + $this->output .= $this->registry->output->getTemplate('register')->registerForm( + $form_errors['general'], + array( + 'TEXT' => $this->lang->words['std_text'], + 'coppa_user' => $coppa, + 'captchaHTML' => $captchaHTML, + 'qandaHTML' => $qandaHTML, + 'showCOPPA' => $this->settings['use_coppa'] AND !(IPSLib::appIsInstalled('nexus') AND $this->settings['nexus_reg_show'] AND $this->settings['nexus_store_online']), + ), + $final_errors, + $time_select, + $custom_fields_out, + $nexusFields, + $nexusStates ); + + //----------------------------------------- + // Member sync module + //----------------------------------------- + + IPSLib::runMemberSync( 'onRegisterForm' ); + } /** * Save the data to complete the partial member record login/registration * - * @access private - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ - private function _completeRegistrationSave() + public function _completeRegistrationSave() { //----------------------------------------- // INIT @@ -197,7 +628,7 @@ class public_core_global_register extends ipsCommand } /* Are we trying to connect to an existing account */ - if ( $connectService AND $login_user AND $login_pass AND ( $this->settings['fb_realname'] == 'enforced' OR !$members_display_name ) ) + if ( $connectService AND $login_user AND $login_pass AND ( $this->settings['fb_realname'] == 'enforced' OR ! $members_display_name ) ) { /* Load Full Member */ $member = IPSMember::load( $mid, 'all' ); @@ -206,7 +637,7 @@ class public_core_global_register extends ipsCommand $han_login->setForceEmailCheck( TRUE ); /* Now attempt to authorize member */ - $return = $han_login->loginPasswordCheck( '', $login_user, $login_pass ); + $return = $han_login->loginPasswordCheck( $login_user, $login_user, $login_pass ); if ( $return !== TRUE ) { @@ -228,8 +659,8 @@ class public_core_global_register extends ipsCommand $form_errors['serviceLogIn'][] = sprintf( $this->lang->words['connect_already_linked'], $login_user, ucfirst( $connectService ) ); } - require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' ); - $facebook = new facebook_connect( $this->registry, $member['fb_token'], $member['fb_uid'] ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry, $member['fb_token'], $member['fb_uid'] ); if ( $facebook->finishNewConnection( $logInMember['member_id'], $member['member_id'] ) !== true ) { @@ -239,15 +670,15 @@ class public_core_global_register extends ipsCommand } else if ( $connectService == 'twitter' AND $member['twitter_id'] ) { - /* Already FBd? */ + /* Already Twitterd? */ if ( $logInMember['twitter_id'] AND ( $member['twitter_id'] != $logInMember['twitter_id'] ) ) { /* User already has facebook link */ $form_errors['serviceLogIn'][] = sprintf( $this->lang->words['connect_already_linked'], $login_user, ucfirst( $connectService ) ); } - require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' ); - $twitter = new twitter_connect( $this->registry, $member['twitter_token'], $member['twitter_secret'] ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $twitter = new $classToLoad( $this->registry, $member['twitter_token'], $member['twitter_secret'] ); if ( $twitter->finishNewConnection( $logInMember['member_id'], $member['member_id'] ) !== true ) { @@ -264,8 +695,8 @@ class public_core_global_register extends ipsCommand $form_errors['serviceLogIn'][] = sprintf( $this->lang->words['connect_already_linked'], $login_user, ucfirst( $connectService ) ); } - require_once( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php' ); - $vk = new vkontakte_connect( $this->registry, $key ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); + $vk = new $classToLoad( $this->registry, $key ); if ( $vk->finishNewConnection( $logInMember['member_id'], $member['member_id'] ) !== true ) { @@ -285,7 +716,7 @@ class public_core_global_register extends ipsCommand /* Boing */ if ( is_array( $r ) ) { - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=usercp§ion=register&tab=members&area=' . $connectService ); + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=usercp§ion=register&tab=core&area=' . $connectService ); } } } @@ -430,18 +861,13 @@ class public_core_global_register extends ipsCommand //----------------------------------------- $this->DB->delete( 'members_partial', 'partial_member_id=' . $mid ); - $this->DB->delete( 'vkontakte_connect', "v_key='" . $key . "'" ); //----------------------------------------- // Update: Profile fields //----------------------------------------- - $this->DB->force_data_type = array(); - - foreach( $custom_fields->out_fields as $_field => $_data ) - { - $this->DB->force_data_type[ $_field ] = 'string'; - } + $this->DB->resetDataTypes(); + $this->DB->setDataType( array_keys( $custom_fields->out_fields ), 'string' ); if ( is_array($custom_fields->out_fields) and count($custom_fields->out_fields) ) { @@ -452,6 +878,70 @@ class public_core_global_register extends ipsCommand // Pass twitter/facebook via spam service //----------------------------------------- + if ( $connectService AND ! $login_user AND $this->settings['spam_service_enabled'] ) + { + /* Load all member data */ + $member = IPSMember::load( $mid, 'all' ); + + /* Spam Service */ + $spamCode = 0; + $_spamFlag = 0; + + /* Query the service */ + $spamCode = IPSMember::querySpamService( $member['email'] ); + + /* Action to perform */ + $action = $this->settings[ 'spam_service_action_' . $spamCode ]; + + /* Perform Action */ + switch( $action ) + { + /* Proceed with registration */ + case 1: + break; + + /* Flag for admin approval */ + case 2: + $member['member_group_id'] = $this->settings['auth_group']; + $this->settings['reg_auth_type'] = 'admin'; + $_spamFlag = 1; + break; + + /* Approve the account, but ban it */ + case 3: + $member['member_banned'] = 1; + $member['member_group_id'] = $this->settings['banned_group']; + $member['bw_is_spammer'] = 1; + $this->settings['reg_auth_type'] = ''; + break; + } + + /* Update member */ + IPSMember::save( $member['member_id'], array( 'core' => array( 'member_group_id' => $member['member_group_id'], + 'member_banned' => intval( $member['member_banned'] ), + 'bw_is_spammer' => intval( $member['bw_is_spammer'] ) ) ) ); + + /* Did we put them in validating? */ + if ( $_spamFlag ) + { + $validate_key = md5( IPSMember::makePassword() . time() ); + $time = time(); + + $this->DB->insert( 'validating', array( 'vid' => $validate_key, + 'member_id' => $member['member_id'], + 'real_group' => $this->settings['member_group'], + 'temp_group' => $this->settings['auth_group'], + 'entry_date' => $time, + 'coppa_user' => 0, + 'new_reg' => 1, + 'ip_address' => $member['ip_address'], + 'spam_flag' => $_spamFlag ) ); + + $this->output = $this->registry->output->getTemplate('register')->showPreview( $member ); + return; #Goes back to doExecute which sends $this->output to output class + } + } + //----------------------------------------- // Send out admin email //----------------------------------------- @@ -468,7 +958,7 @@ class public_core_global_register extends ipsCommand 'IP' => $tmp_member['ip_address'], 'DISPLAY_NAME' => $members_display_name ) ); - IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email'] . $this->settings['board_name']; + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['new_registration_email'], $this->settings['board_name'] ); IPSText::getTextClass('email')->to = $this->settings['email_in']; IPSText::getTextClass('email')->sendMail(); } @@ -514,7 +1004,10 @@ class public_core_global_register extends ipsCommand $this->cache->setCache( 'stats', $cache, array( 'array' => 1 ) ); /* Complete account */ - IPSLib::runMemberSync( 'onCompleteAccount', IPSMember::load( $mid ) ); + $memberData = IPSMember::load( $mid ); + + IPSLib::runMemberSync( 'onCompleteAccount', $memberData ); + IPSLib::runMemberSync( 'onLogin', $memberData ); //----------------------------------------- // Go to the board index @@ -529,11 +1022,10 @@ class public_core_global_register extends ipsCommand * form upon first visit by member (usually immediately after login) to complete the * login/registration. * - * @access private * @param array Errors - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ - private function _completeRegistration( $form_errors=array() ) + protected function _completeRegistration( $form_errors=array() ) { //----------------------------------------- // INIT @@ -548,8 +1040,8 @@ class public_core_global_register extends ipsCommand //----------------------------------------- $reg = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'members_partial', - 'where' => "partial_member_id={$mid} AND partial_date={$key}" ) ); + 'from' => 'members_partial', + 'where' => "partial_member_id={$mid} AND partial_date={$key}" ) ); //----------------------------------------- // Got it? @@ -567,10 +1059,10 @@ class public_core_global_register extends ipsCommand if ( $member['fb_uid'] AND $member['fb_token'] ) { /* Attempt to fetch user details */ - require_once( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php' ); - $facebook = new facebook_connect( $this->registry, $member['fb_token'], $member['fb_uid'] ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry, $member['fb_token'], $member['fb_uid'] ); - $userData = $facebook->fetchUserData(); + $userData = $facebook->fetchUserData(); if ( $userData['id'] ) { @@ -608,10 +1100,10 @@ class public_core_global_register extends ipsCommand else if ( $member['twitter_id'] AND $member['twitter_token'] AND $member['twitter_secret'] ) { /* Attempt to fetch user details */ - require_once( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php' ); - $twitter = new twitter_connect( $this->registry, $member['twitter_token'], $member['twitter_secret'] ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $twitter = new $classToLoad( $this->registry, $member['twitter_token'], $member['twitter_secret'] ); - $userData = $twitter->fetchUserData(); + $userData = $twitter->fetchUserData(); if ( $userData['id'] ) { @@ -621,23 +1113,30 @@ class public_core_global_register extends ipsCommand $userData['_sImage'] = $this->settings['public_dir'] . 'style_status/twitter.png'; } } - else if ( $member['vk_uid'] ) + else if ( $member['vk_uid'] AND $member['vk_token'] ) { /* Attempt to fetch user details */ - require_once( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php' ); - $vk = new vkontakte_connect( $this->registry, $key ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); + $vk = new $classToLoad( $this->registry, $member['vk_token'], $member['vk_uid'] ); - $userData = $vk->fetchUserData(); + $userData = $vk->fetchUserData(); - if ( $userData['id'] ) + if ( $userData['uid'] ) { $userData['service'] = 'vkontakte'; - $userData['_name'] = $userData['name']; + $userData['_name'] = $userData['first_name'] . ' ' . $userData['last_name']; $userData['_pic'] = $userData['photo']; $userData['_sImage'] = $this->settings['public_dir'] . 'style_status/vkontakte.png'; } } - + else + { + /* Set defaults for any we have */ + $this->request['members_display_name'] = !empty($this->request['members_display_name']) ? $this->request['members_display_name'] : $member['members_display_name']; + $this->request['EmailAddress'] = !empty($this->request['EmailAddress']) ? $this->request['EmailAddress'] : $member['email']; + $this->request['EmailAddress_two'] = !empty($this->request['EmailAddress_two']) ? $this->request['EmailAddress_two'] : $member['email']; + } + /* Remote registrations disabled? */ if ( $this->settings['no_reg'] == 2 ) { @@ -647,8 +1146,7 @@ class public_core_global_register extends ipsCommand //----------------------------------------- // Custom profile fields stuff //----------------------------------------- - - /* Custom Profile Fields */ + $custom_fields_out = array( 'required', 'optional' ); $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); @@ -686,7 +1184,7 @@ class public_core_global_register extends ipsCommand // Other errors //----------------------------------------- - foreach( array( 'username', 'dname', 'password', 'email', 'general', 'serviceLogIn' ) as $thing ) + foreach( array( 'dname', 'password', 'email', 'general', 'serviceLogIn' ) as $thing ) { if ( is_array( $form_errors[ $thing ] ) AND count( $form_errors[ $thing ] ) ) { @@ -716,11 +1214,10 @@ class public_core_global_register extends ipsCommand /** * Show the form to request validation email to be resent * - * @access private * @param string Errors - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ - private function _revalidateForm( $errors="" ) + protected function _revalidateForm( $errors="" ) { $uses_name = false; $uses_email = false; @@ -762,10 +1259,9 @@ class public_core_global_register extends ipsCommand /** * Resend email validation request for lost password, email change and new registration * - * @access private - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ - private function _revalidateComplete() + protected function _revalidateComplete() { //----------------------------------------- // Check in the DB for entered member name @@ -847,7 +1343,7 @@ class public_core_global_register extends ipsCommand ) ); - IPSText::getTextClass('email')->subject = $this->lang->words['email_reg_subj'] . " " . $this->settings['board_name']; + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['email_reg_subj'], $this->settings['board_name'] ); IPSText::getTextClass('email')->to = $member['email']; IPSText::getTextClass('email')->sendMail(); @@ -865,7 +1361,7 @@ class public_core_global_register extends ipsCommand ) ); - IPSText::getTextClass('email')->subject = $this->lang->words['ne_subject'] . ' ' . $this->settings['board_name']; + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['ne_subject'], $this->settings['board_name'] ); IPSText::getTextClass('email')->to = $member['email']; IPSText::getTextClass('email')->sendMail(); @@ -885,12 +1381,11 @@ class public_core_global_register extends ipsCommand /** * Show the form to manually enter in validation info if auto-validation failed. * - * @access private * @param string Type of validation * @param string Error messages - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ - private function _showManualForm($type='reg', $errors="") + protected function _showManualForm($type='reg', $errors="") { //----------------------------------------- // In IPB3 this is handled by another section @@ -914,14 +1409,13 @@ class public_core_global_register extends ipsCommand /** * Show coppa form. This is the downloadable/printable form, and as such is just printed to the browser directly * - * @access private - * @return void + * @return @e void */ - private function registerCoppaPermsForm() + protected function registerCoppaPermsForm() { /* Keith said to strip these out - it's all his fault :( */ - $this->settings[ 'coppa_address'] = str_replace( array( '
    ', '
    ' ), '', $this->settings['coppa_address'] ); - $this->settings[ 'coppa_address'] = nl2br( $this->settings['coppa_address'] ); + $this->settings['coppa_address'] = str_replace( array( '
    ', '
    ' ), '', $this->settings['coppa_address'] ); + $this->settings['coppa_address'] = nl2br( $this->settings['coppa_address'] ); echo( $this->registry->output->getTemplate('register')->registerCoppaForm() ); exit(); @@ -932,27 +1426,18 @@ class public_core_global_register extends ipsCommand * we just continue with registration form. Otherwise we show the coppa validation required message with link * to download/print coppa compliance sheet for parents to fill in. * - * @access private - * @return void + * @return @e void */ - private function registerCoppaTwo() + protected function registerCoppaTwo() { - if( ! $this->request['m'] OR ! $this->request['d'] OR ! $this->request['y'] ) - { - $this->registry->output->showError( 'coppa_form_fill', 10119 ); - } - - $birthday = mktime( 0, 0, 0, intval( $this->request['m'] ), intval( $this->request['d'] ), intval( $this->request['y'] ) ); - $coppa = mktime( 0, 0, 0, date( "m" ), date ("d" ), date( "Y" ) - 13 ); - - if( $birthday <= $coppa ) + if( $this->request['coppa'] == 1 ) { + IPSCookie::set( 'coppa', 'no', 0, 1 ); $this->registerForm(); return; } IPSCookie::set( 'coppa', 'yes', 0, 1 ); - IPSCookie::set( 'coppabday', $this->request['m'] . '-' . $this->request['d'] . '-' . $this->request['y'], 0, 1 ); $this->lang->words['coppa_form_text'] = str_replace( "<#FORM_LINK#>", "" . $this->lang->words['coppa_link_form'] . "", $this->lang->words['coppa_form_text']); @@ -961,31 +1446,14 @@ class public_core_global_register extends ipsCommand $this->registry->output->setTitle( $this->lang->words['coppa_title'] . ' - ' . ipsRegistry::$settings['board_name']); $this->registry->output->addNavigation( $this->lang->words['coppa_title'], '' ); } - - /** - * First COPPA screen. Shows form for visitor to enter birthday in and then submits to registerCoppaTwo - * - * @access private - * @return void - */ - private function registerCoppaStart() - { - $this->lang->words['coppa_form_text'] = str_replace( "<#FORM_LINK#>", "{$this->lang->words['coppa_link_form']}", $this->lang->words['coppa_form_text']); - - $this->output .= $this->registry->output->getTemplate('register')->registerCoppaStart(); - - $this->registry->output->setTitle( $this->lang->words['coppa_title'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->registry->output->addNavigation( $this->lang->words['coppa_title'], '' ); - } - + /** * Validation completion. This is the action hit when a user clicks a validation link from their email for * lost password, email change and new registration. * - * @access private - * @return void + * @return @e void */ - private function _autoValidate() + protected function _autoValidate() { //----------------------------------------- // INIT @@ -1067,14 +1535,17 @@ class public_core_global_register extends ipsCommand if ( $validate['new_reg'] == 1 ) { + if( $member['member_group_id'] == $this->settings['auth_group'] ) + { if ( ! $validate['real_group'] ) { $validate['real_group'] = $this->settings['member_group']; } - else if( ! array_key_exists( $validate['real_group'], $this->caches['group_cache'] ) ) + else if( !isset( $this->caches['group_cache'][ $validate['real_group'] ] ) ) { $validate['real_group'] = $this->settings['member_group']; } + } //----------------------------------------- // SELF-VERIFICATION... @@ -1084,7 +1555,10 @@ class public_core_global_register extends ipsCommand if ( $this->settings['reg_auth_type'] == 'user' ) { + if( $member['member_group_id'] == $this->settings['auth_group'] ) + { IPSMember::save( $member['member_id'], array( 'members' => array( 'member_group_id' => $validate['real_group'] ) ) ); + } /* Reset newest member */ $stat_cache = $this->caches['stats']; @@ -1106,6 +1580,8 @@ class public_core_global_register extends ipsCommand $this->DB->delete( 'validating', "vid='" . $validate['vid'] . "'" ); + IPSLib::runMemberSync( 'onCompleteAccount', $member ); + $this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=core&module=global§ion=login&do=autologin&fromreg=1' ); } @@ -1147,7 +1623,7 @@ class public_core_global_register extends ipsCommand // Generate a new random password //----------------------------------------- - $new_pass = IPSLib::makePassword(); + $new_pass = IPSMember::makePassword(); //----------------------------------------- // Generate a new salt @@ -1230,7 +1706,7 @@ class public_core_global_register extends ipsCommand { $validate['real_group'] = $this->settings['member_group']; } - else if( !array_key_exists( $validate['real_group'], $this->caches['group_cache'] ) ) + else if( !isset( $this->caches['group_cache'][ $validate['real_group'] ] ) ) { $validate['real_group'] = $this->settings['member_group']; } @@ -1250,336 +1726,24 @@ class public_core_global_register extends ipsCommand } } - /** - * Displays the registration form - * - * @access public - * @param array $form_errors - * @return void - */ - public function registerForm( $form_errors=array() ) - { - /* INIT */ - $final_errors = array(); - - if( $this->settings['no_reg'] > 0 ) - { - $this->registry->output->showError( 'registration_disabled', 10123, FALSE, '', 200 ); - } - - $coppa = IPSCookie::get( 'coppa' ); - - if( $coppa == 'yes' ) - { - $this->registry->output->showError( 'awaiting_coppa', 10124 ); - } - - $this->settings[ 'username_errormsg'] = str_replace( '{chars}', $this->settings['username_characters'], $this->settings['username_errormsg'] ); - - /* Read T&Cs yet? */ - if( ! $this->request['termsread'] ) - { - if( $this->memberData['member_id'] ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - - //----------------------------------------- - // Set some cookies - //----------------------------------------- - - IPSCookie::set( "member_id" , "0" ); - IPSCookie::set( "pass_hash" , "0" ); - IPSCookie::set( "anonlogin" , "-1" ); - - if ( is_array($_COOKIE) ) - { - foreach( $_COOKIE as $cookie => $value) - { - if ( stripos( $cookie, $this->settings['cookie_id']."ipbforum" ) !== false ) - { - IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ) , '-', -1 ); - } - } - } - - //----------------------------------------- - // Logout callbacks... - //----------------------------------------- - - $this->han_login->logoutCallback(); - - //----------------------------------------- - // Do it.. - //----------------------------------------- - - $this->member->sessionClass()->convertMemberToGuest(); - - list( $privacy, $loggedin ) = explode( '&', $this->memberData['login_anonymous'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'login_anonymous' => "{$privacy}&0", - 'last_activity' => time() ) ) ); - } - - /* Continue */ - $cache = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='reg_rules'" ) ); - - $text = $cache['conf_value'] ? $cache['conf_value'] : $cache['conf_default']; - - /* Load the Parser */ - IPSText::getTextClass( 'bbcode' )->bypass_badwords = 1; - IPSText::getTextClass( 'bbcode' )->parse_smilies = 1; - IPSText::getTextClass( 'bbcode' )->parse_html = 1; - IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; - IPSText::getTextClass( 'bbcode' )->parsing_section = 'global'; - - $text = IPSText::getTextClass('bbcode')->preDbParse( $text ); - $text = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $text ); - - $this->registry->output->setTitle( $this->lang->words['registration_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->registry->output->addNavigation( $this->lang->words['registration_form'], '' ); - - $this->output .= $this->registry->output->getTemplate('register')->registerShowTerms( $text, $coppa ); - return; - } - else - { - /* Did we agree to the t&c? */ - if( ! $this->request['agree_to_terms'] ) - { - $this->registry->output->showError( 'must_agree_to_terms', 10125 ); - } - } - - /* Do we have another URL that one needs to visit to register? */ - $this->DB->build( array( 'select' => '*', 'from' => 'login_methods', 'where' => 'login_enabled=1' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( $r['login_register_url'] ) - { - $this->registry->output->silentRedirect( $r['login_register_url'] ); - exit(); - } - } - - /* Continue... */ - if( $this->settings['reg_auth_type'] ) - { - if( $this->settings['reg_auth_type'] == 'admin_user' OR $this->settings['reg_auth_type'] == 'user' ) - { - $this->lang->words['std_text'] .= "
    " . $this->lang->words['email_validate_text']; - } - - /* User then admin? */ - if( $this->settings['reg_auth_type'] == 'admin_user' ) - { - $this->lang->words['std_text'] .= "
    " . $this->lang->words['user_admin_validation']; - } - - if( $this->settings['reg_auth_type'] == 'admin' ) - { - $this->lang->words['std_text'] .= "
    " . $this->lang->words['just_admin_validation']; - } - } - - $captchaHTML = ''; - $qandaHTML = ''; - $this->cache->updateCacheWithoutSaving('_hasStep3', 0); - - /* Q and A Challenge */ - if( $this->settings['registration_qanda'] ) - { - // Grab a random question... - $question = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'question_and_answer', 'order' => $this->DB->buildRandomOrder(), 'limit' => array(1) ) ); - - if( count($question) ) - { - $qandaHTML = $this->registry->output->getTemplate('global_other')->questionAndAnswer( $question ); - } - } - - /* Custom Profile Fields */ - $custom_fields_out = array( 'required', 'optional' ); - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); - $custom_fields = new $classToLoad(); - - $custom_fields->member_data = $this->memberData; - $custom_fields->initData( 'edit' ); - $custom_fields->parseToEdit( 'register' ); - - if ( count( $custom_fields->out_fields ) ) - { - $this->cache->updateCacheWithoutSaving('_hasStep3', 1); - - foreach( $custom_fields->out_fields as $id => $form_element ) - { - if ( $custom_fields->cache_data[ $id ]['pf_not_null'] == 1 ) - { - $ftype = 'required'; - } - else - { - $ftype = 'optional'; - } - - $custom_fields_out[$ftype][] = array( - 'name' => $custom_fields->field_names[ $id ], - 'desc' => $custom_fields->field_desc[ $id ], - 'field' => $form_element, - 'id' => $id, - 'error' => '', - 'type' => $custom_fields->cache_data[ $id ]['pf_type'] - ); - } - } - - /* CAPTCHA */ - if( $this->settings['bot_antispam_type'] != 'none' ) - { - $captchaHTML = $this->registry->getClass('class_captcha')->getTemplate(); - } - - $this->registry->output->setTitle( $this->lang->words['registration_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->registry->output->addNavigation( $this->lang->words['registration_form'], '' ); - - /* Other errors */ - $final_errors = array( 'username' => NULL, 'dname' => NULL, 'password' => NULL, 'email' => NULL ); - - foreach( array( 'username', 'dname', 'password', 'email' ) as $thing ) - { - if ( isset($form_errors[ $thing ]) AND is_array( $form_errors[ $thing ] ) AND count( $form_errors[ $thing ] ) ) - { - $final_errors[ $thing ] = implode( "
    ", $form_errors[ $thing ] ); - } - } - - $this->request['UserName'] = $this->request['UserName'] ? $this->request['UserName'] : '' ; - $this->request['PassWord'] = $this->request['PassWord'] ? $this->request['PassWord'] : '' ; - $this->request['EmailAddress'] = $this->request['EmailAddress'] ? $this->request['EmailAddress'] : '' ; - $this->request['EmailAddress_two'] = $this->request['EmailAddress_two'] ? $this->request['EmailAddress_two'] : '' ; - $this->request['PassWord_Check'] = $this->request['PassWord_Check'] ? $this->request['PassWord_Check'] : '' ; - $this->request['members_display_name'] = $this->request['members_display_name'] ? $this->request['members_display_name'] : '' ; - $this->request['time_offset'] = $this->request['time_offset'] ? $this->request['time_offset'] : '' ; - $this->request['allow_member_mail'] = $this->request['allow_member_mail'] ? $this->request['allow_member_mail'] : '' ; - $this->request['dst'] = $this->request['dst'] ? $this->request['dst'] : '' ; - - /* Time zone... */ - $this->registry->class_localization->loadLanguageFile( array( 'public_usercp' ), 'core' ); - - $time_select = array(); - - foreach( $this->lang->words as $k => $v ) - { - if( strpos( $k, "time_" ) === 0 ) - { - $k = str_replace( "time_", '', $k ); - - if( preg_match( '/^[\-\d\.]+$/', $k ) ) - { - $time_select[ $k ] = $v; - } - } - } - - ksort( $time_select ); - - /* set default.. */ - $this->request['time_offset'] = ( $this->request['time_offset'] ) ? $this->request['time_offset'] : $this->settings['time_offset']; - - /* Need username? */ - $uses_name = false; - - foreach( $this->cache->getCache('login_methods') as $method ) - { - if( $method['login_user_id'] == 'username' ) - { - $uses_name = true; - } - } - - /* Get form HTML */ - $this->output .= $this->registry->output->getTemplate('register')->registerForm( - $form_errors['general'], - array( - 'TEXT' => $this->lang->words['std_text'], - 'coppa_user' => $coppa, - 'captchaHTML' => $captchaHTML, - 'qandaHTML' => $qandaHTML, - 'requireName' => $uses_name, - ), - $final_errors, - $time_select, - $custom_fields_out ); - - /* Run the member sync module */ - IPSLib::runMemberSync( 'onRegisterForm' ); - } - /** * Processes the registration form * - * @access public - * @return void + * @return @e void */ public function registerProcessForm() { - if( $this->memberData['member_id'] ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - - //----------------------------------------- - // Set some cookies - //----------------------------------------- - - IPSCookie::set( "member_id" , "0" ); - IPSCookie::set( "pass_hash" , "0" ); - IPSCookie::set( "anonlogin" , "-1" ); - - if ( is_array($_COOKIE) ) - { - foreach( $_COOKIE as $cookie => $value) - { - if ( stripos( $cookie, $this->settings['cookie_id']."ipbforum" ) !== false ) - { - IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ) , '-', -1 ); - } - } - } - - //----------------------------------------- - // Logout callbacks... - //----------------------------------------- - - $this->han_login->logoutCallback(); - - //----------------------------------------- - // Do it.. - //----------------------------------------- - - $this->member->sessionClass()->convertMemberToGuest(); - - list( $privacy, $loggedin ) = explode( '&', $this->memberData['login_anonymous'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'login_anonymous' => "{$privacy}&0", - 'last_activity' => time() ) ) ); - } + $this->_resetMember(); $form_errors = array(); $coppa = ( $this->request['coppa_user'] == 1 ) ? 1 : 0; $in_password = trim( $this->request['PassWord'] ); - $in_email = mb_strtolower( trim( $this->request['EmailAddress'] ) ); - $_SFS_FOUND = FALSE; + $in_email = strtolower( trim( $this->request['EmailAddress'] ) ); - /* Check */ - if( $this->settings['no_reg'] > 0 ) + /* Did we agree to the t&c? */ + if( ! $this->request['agree_tos'] ) { - $this->registry->output->showError( 'registration_disabled', 2016, true ); + $form_errors['tos'] = array( $this->lang->words['must_agree_to_terms'] ); } /* Custom profile field stuff */ @@ -1606,51 +1770,15 @@ class public_core_global_register extends ipsCommand $form_errors['password'][$this->lang->words['passwords_not_match']] = $this->lang->words['passwords_not_match']; } - /* Test email address */ - $this->request['EmailAddress_two'] = mb_strtolower( trim( $this->request['EmailAddress_two'] ) ); - $this->request['EmailAddress'] = mb_strtolower( trim( $this->request['EmailAddress'] ) ); - - if( !IPSText::checkEmailAddress( $this->request['EmailAddress_two'] ) ) - { - $form_errors['email'][$this->lang->words['reg_error_email_invalid']] = $this->lang->words['reg_error_email_invalid']; - } - else - { - if ( $in_email AND $this->request['EmailAddress_two'] != $in_email ) - { - $form_errors['email'][$this->lang->words['reg_error_email_nm']] = $this->lang->words['reg_error_email_nm']; - } - } - - /* Need username? */ - $uses_name = false; - - foreach( $this->cache->getCache('login_methods') as $method ) - { - if( $method['login_user_id'] == 'username' ) - { - $uses_name = true; - } - } - - if( !$uses_name ) - { - $_REQUEST['UserName'] = $_REQUEST['members_display_name']; - $this->request['UserName'] = $this->request['members_display_name']; - } - - /* Set the display name, if empty */ - $this->request['members_display_name'] = $this->request['members_display_name'] ? $this->request['members_display_name'] : $this->request['UserName']; - /* Check the username */ - $user_check = IPSMember::getFunction()->cleanAndCheckName( $this->request['UserName'], array(), 'name' ); + $user_check = IPSMember::getFunction()->cleanAndCheckName( $this->request['members_display_name'], array(), 'name' ); $disp_check = IPSMember::getFunction()->cleanAndCheckName( $this->request['members_display_name'], array(), 'members_display_name' ); if( is_array( $user_check['errors'] ) && count( $user_check['errors'] ) ) { foreach( $user_check['errors'] as $key => $error ) { - $form_errors[ $key ][] = isset($this->lang->words[ $error ]) ? $this->lang->words[ $error ] : $error; + $form_errors['dname'][ $error ] = isset($this->lang->words[ $error ]) ? $this->lang->words[ $error ] : $error; } } @@ -1658,12 +1786,8 @@ class public_core_global_register extends ipsCommand { foreach( $disp_check['errors'] as $key => $error ) { - if( !$this->settings['auth_allow_dnames'] AND !( is_array( $user_check['errors'] ) && count( $user_check['errors'] ) ) ) - { - $key = 'username'; - } - - $form_errors[ $key ][] = isset($this->lang->words[ $error ]) ? $this->lang->words[ $error ] : $error; + /* this duplicates username error above */ + //$form_errors['dname'][ $error ] = isset($this->lang->words[ $error ]) ? $this->lang->words[ $error ] : $error; } } @@ -1707,13 +1831,12 @@ class public_core_global_register extends ipsCommand } /* Check the Q and A */ - if( $this->settings['registration_qanda'] ) - { $qanda = intval($this->request['qanda_id']); - $pass = false; + $pass = true; if( $qanda ) { + $pass = false; $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'question_and_answer', 'where' => 'qa_id=' . $qanda ) ); if( $data['qa_id'] ) @@ -1724,7 +1847,9 @@ class public_core_global_register extends ipsCommand { foreach( $answers as $answer ) { - if( mb_strtolower($answer) == mb_strtolower($this->request['qa_answer']) ) + $answer = trim($answer); + + if( strlen($answer) AND strtolower($answer) == strtolower($this->request['qa_answer']) ) { $pass = true; break; @@ -1741,9 +1866,9 @@ class public_core_global_register extends ipsCommand $data = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as questions', 'from' => 'question_and_answer' ) ); - if( !$data['questions'] ) + if( $data['questions'] ) { - $pass = true; + $pass = false; } } @@ -1751,7 +1876,6 @@ class public_core_global_register extends ipsCommand { $form_errors['general'][$this->lang->words['err_q_and_a']] = $this->lang->words['err_q_and_a']; } - } /* CHECK 2: Any errors ? */ if ( count( $form_errors ) ) @@ -1775,24 +1899,55 @@ class public_core_global_register extends ipsCommand /* Create member */ $member = array( - 'name' => $this->request['UserName'], + 'name' => $this->request['members_display_name'], 'password' => $in_password, - 'members_display_name' => $this->settings['auth_allow_dnames'] ? $this->request['members_display_name'] : $this->request['UserName'], + 'members_display_name' => $this->request['members_display_name'], 'email' => $in_email, 'member_group_id' => $mem_group, 'joined' => time(), 'ip_address' => $this->member->ip_address, 'time_offset' => $this->request['time_offset'], 'coppa_user' => $coppa, - 'members_auto_dst' => intval($this->request['dst']), + 'members_auto_dst' => intval($this->settings['time_dst_auto_detection']), 'allow_admin_mails' => intval( $this->request['allow_admin_mail'] ), - 'hide_email' => $this->request['allow_member_mail'] ? 0 : 1, ); /* Spam Service */ $spamCode = 0; $_spamFlag = 0; - + + if( $this->settings['spam_service_enabled'] ) + { + /* Query the service */ + $spamCode = IPSMember::querySpamService( $in_email ); + + /* Action to perform */ + $action = $this->settings[ 'spam_service_action_' . $spamCode ]; + + /* Perform Action */ + switch( $action ) + { + /* Proceed with registration */ + case 1: + break; + + /* Flag for admin approval */ + case 2: + $member['member_group_id'] = $this->settings['auth_group']; + $this->settings['reg_auth_type'] = 'admin'; + $_spamFlag = 1; + break; + + /* Approve the account, but ban it */ + case 3: + $member['member_banned'] = 1; + $member['member_group_id'] = $this->settings['banned_group']; + $member['bw_is_spammer'] = 1; + $this->settings['reg_auth_type'] = ''; + break; + } + } + //----------------------------------------- // Create the account //----------------------------------------- @@ -1823,7 +1978,7 @@ class public_core_global_register extends ipsCommand // Validation //----------------------------------------- - $validate_key = md5( IPSLib::makePassword() . time() ); + $validate_key = md5( IPSMember::makePassword() . time() ); $time = time(); if( $coppa != 1 ) @@ -1839,7 +1994,7 @@ class public_core_global_register extends ipsCommand $this->DB->insert( 'validating', array( 'vid' => $validate_key, 'member_id' => $member['member_id'], - 'real_group' => /*$this->settings['subsm_enforce'] ? $this->settings['subsm_nopkg_group'] :*/ $this->settings['member_group'], + 'real_group' => $this->settings['member_group'], 'temp_group' => $this->settings['auth_group'], 'entry_date' => $time, 'coppa_user' => $coppa, @@ -1861,7 +2016,7 @@ class public_core_global_register extends ipsCommand 'CODE' => $validate_key, ) ); - IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email'] . $this->settings['board_name']; + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['new_registration_email'], $this->settings['board_name'] ); IPSText::getTextClass('email')->to = $member['email']; IPSText::getTextClass('email')->sendMail(); @@ -1874,7 +2029,8 @@ class public_core_global_register extends ipsCommand $this->output = $this->registry->output->getTemplate('register')->showPreview( $member ); } - if( $this->settings['new_reg_notify'] ) + /* Only send new registration email if the member wasn't banned */ + if( $this->settings['new_reg_notify'] AND $member['member_group_id'] != $this->settings['banned_group'] ) { $date = $this->registry->class_localization->getDate( time(), 'LONG', 1 ); @@ -1886,7 +2042,7 @@ class public_core_global_register extends ipsCommand 'IP' => $member['ip_address'], 'DISPLAY_NAME' => $member['members_display_name'] ) ); - IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email1'] . $this->settings['board_name']; + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['new_registration_email1'], $this->settings['board_name'] ); IPSText::getTextClass('email')->to = $this->settings['email_in']; IPSText::getTextClass('email')->sendMail(); } @@ -1910,7 +2066,8 @@ class public_core_global_register extends ipsCommand $this->cache->setCache( 'stats', $stat_cache, array( 'array' => 1 ) ); - if( $this->settings['new_reg_notify'] ) + /* Only send new registration email if the member wasn't banned */ + if( $this->settings['new_reg_notify'] AND $member['member_group_id'] != $this->settings['banned_group'] ) { $date = $this->registry->class_localization->getDate( time(), 'LONG', 1 ); @@ -1922,7 +2079,7 @@ class public_core_global_register extends ipsCommand 'IP' => $member['ip_address'], 'DISPLAY_NAME' => $member['members_display_name'] ) ); - IPSText::getTextClass('email')->subject = $this->lang->words['new_registration_email1'] . $this->settings['board_name']; + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['new_registration_email1'], $this->settings['board_name'] ); IPSText::getTextClass('email')->to = $this->settings['email_in']; IPSText::getTextClass('email')->sendMail(); } @@ -1946,6 +2103,8 @@ class public_core_global_register extends ipsCommand 'member_group' => $member['member_group_id'], 'login_type' => $privacy ) ); + IPSLib::runMemberSync( 'onCompleteAccount', $member ); + $this->registry->output->silentRedirect( $this->settings['base_url'] . '&app=core&module=global§ion=login&do=autologin&fromreg=1'); } } diff --git a/upload/admin/applications/core/modules_public/global/reputation.php b/upload/admin/applications/core/modules_public/global/reputation.php index 3ce09fde..b7d68a73 100644 --- a/upload/admin/applications/core/modules_public/global/reputation.php +++ b/upload/admin/applications/core/modules_public/global/reputation.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Reputation
    - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-10-14 10:30:53 -0400 (Fri, 14 Oct 2011) $
      * 
    * * @author $Author $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 5713 $ + * @link http://hatynka.in + * @version $Rev: 9620 $ * */ @@ -28,9 +28,8 @@ class public_core_global_reputation extends ipsCommand /** * Class entry point * - * @access public * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -46,8 +45,7 @@ class public_core_global_reputation extends ipsCommand /** * Adds a rating to the index * - * @access public - * @return void + * @return @e void */ public function doRating() { @@ -60,13 +58,13 @@ class public_core_global_reputation extends ipsCommand /* Check */ if( ! $app || ! $type || ! $type_id || ! $rating ) { - $this->registry->output->showError( 'reputation_missing_data', 10126 ); + $this->registry->output->showError( 'reputation_missing_data', 10126, false, false, 403 ); } /* Check the secure key. Needed here to prevent direct URLs from increasing reps */ if ( $this->request['secure_key'] != $this->member->form_hash ) { - $this->registry->output->showError( 'reputation_missing_data', 10126 ); + $this->registry->output->showError( 'reputation_missing_data', 10126, false, false, 403 ); } /* Get the rep library */ @@ -76,14 +74,14 @@ class public_core_global_reputation extends ipsCommand /* Add the rating */ if( ! $repCache->addRate( $type, $type_id, $rating, '', 0, $app ) ) { - $this->registry->output->showError( $repCache->error_message, 10127 ); + $this->registry->output->showError( $repCache->error_message, 10127, false, false, 403 ); } else { /* Redirect to */ $return_url = ''; - if( isset( $this->request['post_return'] ) && $this->request['post_return'] ) + if( !empty( $this->request['post_return'] ) ) { $return_url = $this->settings['base_url'] . 'app=forums&module=forums§ion=findpost&pid=' . intval( $this->request['post_return'] ); } diff --git a/upload/admin/applications/core/modules_public/global/rss.php b/upload/admin/applications/core/modules_public/global/rss.php index 549ecc28..417f0c99 100644 --- a/upload/admin/applications/core/modules_public/global/rss.php +++ b/upload/admin/applications/core/modules_public/global/rss.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * RSS output functionality
    - * Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 18th March 2005 - * @version $Revision: 7003 $ + * @version $Revision: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -30,13 +30,13 @@ class public_core_global_rss extends ipsCommand * * @var string XML document content */ - private $to_print = ''; + protected $to_print = ''; /** * Class entry point * * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -78,7 +78,7 @@ class public_core_global_rss extends ipsCommand { if( IPSLib::appIsInstalled( IPSText::alphanumericalClean( $this->request['type'] ) ) ) { - if( file_exists( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) ) + if( is_file( IPSLib::getAppDir( IPSText::alphanumericalClean( $this->request['type'] ) ) . '/extensions/rssOutput.php' ) ) { $type = IPSText::alphanumericalClean( $this->request['type'] ); } @@ -91,8 +91,8 @@ class public_core_global_rss extends ipsCommand if( IPSLib::appIsInstalled($type) ) { - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $type ) . '/extensions/rssOutput.php', 'rss_output_'.$type, $type ); - $rss_library = new $classToLoad( $this->registry ); + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $type ) . '/extensions/rssOutput.php', 'rss_output_'.$type, $type ); + $rss_library = new $classToLoad( $this->registry ); $this->to_print = $rss_library->returnRSSDocument(); $expires = $rss_library->grabExpiryDate(); diff --git a/upload/admin/applications/core/modules_public/global/share.php b/upload/admin/applications/core/modules_public/global/share.php index e06ef60b..174e3a03 100644 --- a/upload/admin/applications/core/modules_public/global/share.php +++ b/upload/admin/applications/core/modules_public/global/share.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Captcha
    - * Last Updated: $Date: 2010-01-15 15:18:44 +0000 (Fri, 15 Jan 2010) $
    + * Last Updated: $Date: 2011-06-02 18:58:10 -0400 (Thu, 02 Jun 2011) $
      * 
    * * @author $Author $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 20th February 2002 - * @version $Rev: 5713 $ + * @version $Rev: 8954 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -29,10 +29,22 @@ class public_core_global_share extends ipsCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { + /* Disabled? */ + if ( ! $this->settings['sl_enable'] ) + { + $this->registry->output->showError( 'no_permission', 100234.1, false, null, 403 ); + } + + /* Disable for bots */ + if( $this->member->is_not_human ) + { + $this->registry->output->showError( 'no_permission', 100234.2, false, null, 403 ); + } + $url = IPSText::base64_decode_urlSafe( $this->request['url'] ); $title = IPSText::base64_decode_urlSafe( $this->request['title'] ); $key = trim( $this->request['key'] ); diff --git a/upload/admin/applications/core/modules_public/help/defaultSection.php b/upload/admin/applications/core/modules_public/help/defaultSection.php index 4a082572..adcead3c 100644 --- a/upload/admin/applications/core/modules_public/help/defaultSection.php +++ b/upload/admin/applications/core/modules_public/help/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default help section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'help' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'help'; \ No newline at end of file +$DEFAULT_SECTION = 'help'; diff --git a/upload/admin/applications/core/modules_public/help/help.php b/upload/admin/applications/core/modules_public/help/help.php index c3ed85f3..317e59b5 100644 --- a/upload/admin/applications/core/modules_public/help/help.php +++ b/upload/admin/applications/core/modules_public/help/help.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Help File System
    - * Last Updated: $Date: 2010-10-19 11:56:25 -0400 (Tue, 19 Oct 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6997 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -35,7 +35,7 @@ class public_core_help_help extends ipsCommand * Class entry point * * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -62,7 +62,7 @@ class public_core_help_help extends ipsCommand /** * Show help topics * - * @return void + * @return @e void */ public function helpShowTitles() { @@ -71,7 +71,7 @@ class public_core_help_help extends ipsCommand /* Query the help topics */ - $this->DB->build( array( 'select' => 'id, title, description', 'from' => 'faq', 'order' => 'position ASC' ) ); + $this->DB->build( array( 'select' => 'id, title, description, app', 'from' => 'faq', 'order' => 'position ASC' ) ); $this->DB->execute(); /* Loop through topics */ @@ -79,6 +79,11 @@ class public_core_help_help extends ipsCommand while( $row = $this->DB->fetch() ) { + if( !IPSLib::appIsInstalled( $row['app'] ) ) + { + continue; + } + if( isset( $seen[ $row['title'] ] ) ) { continue; @@ -93,7 +98,7 @@ class public_core_help_help extends ipsCommand } /* Output */ - $this->output .= $this->registry->output->getTemplate( 'help' )->helpShowTopics( + $this->output .= $this->registry->output->getTemplate('help')->helpShowTopics( $this->lang->words['page_title'], $this->lang->words['help_txt'], $this->lang->words['choose_file'], @@ -108,7 +113,7 @@ class public_core_help_help extends ipsCommand /** * Displays a help file * - * @return void + * @return @e void */ public function helpShowSection() { @@ -128,18 +133,17 @@ class public_core_help_help extends ipsCommand { $this->registry->output->showError( 'help_no_id', 10128 ); } - - /* Load the Parser */ - IPSText::getTextClass( 'bbcode' )->bypass_badwords = 1; - IPSText::getTextClass( 'bbcode' )->parse_smilies = 1; - IPSText::getTextClass( 'bbcode' )->parse_html = 1; - IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; - IPSText::getTextClass( 'bbcode' )->parsing_section = 'help'; - - $topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] ); - + /* Parse out board URL */ $topic['text'] = str_replace( '{board_url}', $this->settings['base_url'], $topic['text'] ); + + IPSText::getTextClass( 'bbcode' )->parse_smilies = 1; + IPSText::getTextClass( 'bbcode' )->parse_html = 1; + IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1; + IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; + IPSText::getTextClass( 'bbcode' )->parsing_section = 'global'; + + $topic['text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $topic['text'] ); if ( $this->request['hl'] ) { diff --git a/upload/admin/applications/core/modules_public/help/index.html b/upload/admin/applications/core/modules_public/help/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/help/index.html +++ b/upload/admin/applications/core/modules_public/help/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/index.html b/upload/admin/applications/core/modules_public/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/index.html +++ b/upload/admin/applications/core/modules_public/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/modcp/defaultSection.php b/upload/admin/applications/core/modules_public/modcp/defaultSection.php new file mode 100644 index 00000000..1b447f47 --- /dev/null +++ b/upload/admin/applications/core/modules_public/modcp/defaultSection.php @@ -0,0 +1,14 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class public_core_modcp_editmember + * @brief Moderator ability to edit members + * + */ +class public_core_modcp_editmember extends ipsCommand +{ + /** + * Temporary stored output HTML + * + * @var string + */ + public $output; + + /** + * Editor engine + * + * @var object + */ + protected $editor; + + /** + * Moderator information + * + * @var array + */ + protected $moderator = array(); + + /** + * Can ban member from warn panel + * + * @var bool + */ + protected $canSuspend = 0; + + /** + * Can mod queue member from warn panel + * + * @var bool + */ + protected $canModQueue = 0; + + /** + * Can remove posting rights from member from warn panel + * + * @var bool + */ + protected $canRemovePostAbility = 0; + + /** + * Number of times per day member can be warned + * + * @var integer + */ + protected $restrictWarnsPerDay = 0; + + /** + * Type of member + * + * @var string + */ + protected $type = 'mod'; + + /** + * Data for the member being warned + * + * @var array + */ + protected $warn_member = array(); + + /** + * Error message + * + * @var string + */ + protected $_error = ''; + + /** + * Class entry point + * + * @param object $registry Registry reference + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Init + //----------------------------------------- + + if( $this->request['do'] != 'setAsSpammer' ) + { + $this->loadData(); + } + + $this->lang->loadLanguageFile( array( 'public_modcp' ) ); + + //----------------------------------------- + // Bouncy, bouncy! + //----------------------------------------- + + switch( $this->request['do'] ) + { + default: + case 'index': + $this->_moderatorIndex(); + break; + + case 'doeditmember': + $this->_doEditMember(); + break; + + case 'setAsSpammer': + $this->_setAsSpammer(); + break; + + case 'dowarn': + $this->_doWarn(); + break; + + case 'add_note': + $this->_addNoteform(); + $this->registry->output->addNavigation( $this->lang->words['w_title'], '' ); + break; + + case 'save_note': + $this->_saveNote(); + break; + + case 'view': + $this->viewLog(); + $this->registry->output->addNavigation( $this->lang->words['w_title'], '' ); + break; + } + + $this->registry->output->addContent( $this->output ); + + if( $this->request['popup'] ) + { + $this->registry->getClass('output')->popUpWindow( $this->output ); + } + else + { + $this->registry->output->sendOutput(); + } + } + + /** + * Index page to moderator controls + * + * @return @e void + */ + protected function _moderatorIndex() + { + //----------------------------------------- + // Get tab contents + //----------------------------------------- + + $editMember = ''; + $warnForm = ''; + $logs = ''; + $noteForm = ''; + + if ( $this->memberData['g_is_supmod'] ) + { + $editMember = $this->_editMember(); + } + + if ( $this->settings['warn_on'] ) + { + $warnForm = $this->_showForm(); + $logs = $this->viewLog( true ); + $noteForm = $this->_addNoteForm( true ); + } + + if( !$editMember AND !$warnForm AND !$logs AND !$noteForm ) + { + $this->registry->output->showError( 'warn_no_access', 2025.1, null, null, 403 ); + } + + //----------------------------------------- + // Figure out return URL stuff + //----------------------------------------- + + $return = array(); + + if( $this->request['pf'] ) + { + $return = $this->warn_member; + } + else if( $this->request['t'] ) + { + $return = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title', 'from' => 'topics', 'where' => 'tid=' . intval($this->request['t']) ) ); + } + + if ( !$return['members_display_name'] ) + { + $return['members_display_name'] = $this->warn_member['members_display_name']; + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->output .= $this->registry->getClass('output')->getTemplate('modcp')->modControls( $editMember, $warnForm, $logs, $noteForm, $return ); + + $this->registry->getClass('output')->setTitle( $this->lang->words['cp_em_title'] . ' - ' . $this->settings['board_name'] ); + $this->registry->getClass('output')->addNavigation( sprintf( $this->lang->words['cp_vp_title'], $this->warn_member['members_display_name'] ), "showuser={$this->warn_member['member_id']}", $this->warn_member['members_seo_name'], 'showuser' ); + $this->registry->getClass('output')->addNavigation( $this->lang->words['cp_em_title'], '' ); + } + + /** + * Load all necessary properties + * + * @return @e void + */ + public function loadData() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $this->settings['warn_min'] = $this->settings['warn_min'] ? $this->settings['warn_min'] : 0; + $this->settings['warn_max'] = $this->settings['warn_max'] ? $this->settings['warn_max'] : 10; + + //----------------------------------------- + // Get forum libraries + //----------------------------------------- + + ipsRegistry::getAppClass( 'forums' ); + + //----------------------------------------- + // Make sure we're a moderator... + //----------------------------------------- + + $pass = 0; + + if( $this->memberData['member_id'] ) + { + if( $this->memberData['g_is_supmod'] == 1 ) + { + $pass = 1; + $this->canSuspend = $this->settings['warn_gmod_ban']; + $this->canModQueue = $this->settings['warn_gmod_modq']; + $this->canRemovePostAbility = $this->settings['warn_gmod_post']; + $this->restrictWarnsPerDay = intval($this->settings['warn_gmod_day']); + $this->canApprovePosts = 1; + $this->canApproveTopics = 1; + $this->canDeletePosts = 1; + $this->canDeleteTopics = 1; + $this->type = 'supmod'; + } + else if( $this->memberData['is_mod'] ) + { + $other_mgroups = array(); + $_other_mgroups = IPSText::cleanPermString( $this->memberData['mgroup_others'] ); + + if( $_other_mgroups ) + { + $other_mgroups = explode( ",", $_other_mgroups ); + } + + $other_mgroups[] = $this->memberData['member_group_id']; + + $this->DB->build( array( + 'select' => '*', + 'from' => 'moderators', + 'where' => "(member_id='" . $this->memberData['member_id'] . "' OR (is_group=1 AND group_id IN(" . implode( ",", $other_mgroups ) . ")))" + ) ); + + $this->DB->execute(); + + while ( $this->moderator = $this->DB->fetch() ) + { + if ( $this->moderator['allow_warn'] ) + { + $pass = 1; + $this->canSuspend = $this->settings['warn_mod_ban']; + $this->canModQueue = $this->settings['warn_mod_modq']; + $this->canRemovePostAbility = $this->settings['warn_mod_post']; + $this->restrictWarnsPerDay = intval($this->settings['warn_mod_day']); + $this->canApprovePosts = $this->moderator['post_q']; + $this->canApproveTopics = $this->moderator['topic_q']; + $this->canDeletePosts = $this->moderator['delete_post']; + $this->canDeleteTopics = $this->moderator['delete_topic']; + $this->type = 'mod'; + } + } + } + + if( $this->settings['warn_show_own'] and $this->memberData['member_id'] == $this->request['mid'] and !$pass ) + { + $pass = 1; + $this->canSuspend = 0; + $this->canModQueue = 0; + $this->canRemovePostAbility = 0; + $this->restrictWarnsPerDay = 0; + $this->canApprovePosts = 0; + $this->canApproveTopics = 0; + $this->canDeletePosts = 0; + $this->canDeleteTopics = 0; + $this->type = 'member'; + } + } + + if ( !$pass ) + { + $this->registry->output->showError( 'warn_no_access', 2025, null, null, 403 ); + } + + //----------------------------------------- + // Ensure we have a valid member + //----------------------------------------- + + $mid = intval($this->request['mid']); + + if ( $mid < 1 ) + { + $this->registry->output->showError( 'warn_no_user', 10249, null, null, 404 ); + } + + $this->warn_member = IPSMember::load( $mid, 'all' ); + + if ( ! $this->warn_member['member_id'] ) + { + $this->registry->output->showError( 'warn_no_user', 10250, null, null, 404 ); + } + + //----------------------------------------- + // Get editor + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + } + + /** + * View the warn logs + * + * @param bool $return Return output instead of printing + * @return @e mixed + */ + public function viewLog( $return=false ) + { + $perpage = 50; + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + $row = $this->DB->buildAndFetch( array( 'select' => 'count(*) as cnt', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['member_id']}" ) ); + $rows = array(); + $match = array(); + + if( $this->request['do'] == 'view' ) + { + $url = "app=core&module=modcp&section=editmember&do=view&mid={$this->warn_member['member_id']}"; + } + else + { + $url = "app=core&module=modcp&section=editmember&_tab=warnlogs&mid={$this->warn_member['member_id']}"; + } + + $links = $this->registry->output->generatePagination( array( + 'totalItems' => $row['cnt'], + 'itemsPerPage' => $perpage, + 'currentStartValue' => $start, + 'baseUrl' => $url, + ) ); + + if ( $row['cnt'] > 0 ) + { + $this->DB->build( array( + 'select' => 'l.*', + 'from' => array( 'warn_logs' => 'l' ), + 'where' => 'l.wlog_mid=' . $this->warn_member['member_id'], + 'order' => 'l.wlog_date DESC ', + 'limit' => array( $start, $perpage ), + 'add_join' => array( + array( + 'select' => 'p.member_id as punisher_id, p.members_display_name as punisher_name, p.members_seo_name, p.member_group_id, p.mgroup_others', + 'from' => array( 'members' => 'p' ), + 'where' => 'p.member_id=l.wlog_addedby', + 'type' => 'left', + ) + ) + ) ); + $q =$this->DB->execute(); + + while ( $r = $this->DB->fetch( $q ) ) + { + if ( strstr( $r['wlog_notes'], '' ) ) + { + preg_match( "#(.+?)#is", $r['wlog_notes'], $match ); + } + else + { + $_array = unserialize( $r['wlog_notes'] ); + + if ( is_array( $_array ) AND $_array['content'] ) + { + $match[1] = $_array['content']; + } + } + + IPSText::getTextClass( 'bbcode' )->parse_smilies = 1; + IPSText::getTextClass( 'bbcode' )->parse_html = 0; + IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; + IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn'; + IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $r['member_group_id']; + IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $r['mgroup_others']; + + $r['content'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $match[1] ); + + $rows[] = $r; + } + } + + $this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] . ' - ' . ipsRegistry::$settings['board_name'] ); + + if( $return ) + { + return $this->registry->getClass('output')->getTemplate('modcp')->warn_view_log( $this->warn_member, $rows, $links ); + } + else + { + $this->output .= $this->registry->getClass('output')->getTemplate('modcp')->warn_view_log( $this->warn_member, $rows, $links ); + } + } + + /** + * Form to add a new note + * + * @param bool $return Return output instead of printing + * @return @e mixed + */ + protected function _addNoteForm( $return=false ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if ( $this->type == 'member' ) + { + if( $return ) + { + return false; + } + + $this->registry->output->showError( 'warn_member_notes', 2027, null, null, 403 ); + } + + //----------------------------------------- + // Output + //----------------------------------------- + + if( $return ) + { + return $this->registry->getClass('output')->getTemplate('modcp')->warn_add_note_form( $this->warn_member ); + } + + $this->registry->getClass('output')->setTitle( $this->lang->words['warn_popup_title'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->registry->getClass('output')->popUpWindow( $this->registry->getClass('output')->getTemplate('modcp')->warn_add_note_form( $this->warn_member ) ); + } + + /** + * Save a new note + * + * @return @e void + */ + protected function _saveNote() + { + //----------------------------------------- + // Init + //----------------------------------------- + + if ( $this->type == 'member' ) + { + $this->registry->output->showError( 'warn_member_notes', 2026, null, null, 403 ); + } + + if ( $this->request['auth_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'no_permission', 3021, null, null, 403 ); + } + + $content = ''; + $note = trim( $this->request['note'] ); + $save = array(); + + if ( $note ) + { + //----------------------------------------- + // Ready to save? + //----------------------------------------- + + $save['wlog_notes'] = "{$note}"; + $save['wlog_notes'] .= ""; + $save['wlog_notes'] .= ""; + $save['wlog_notes'] .= ""; + + $save['wlog_mid'] = $this->warn_member['member_id']; + $save['wlog_addedby'] = $this->memberData['member_id']; + $save['wlog_type'] = 'note'; + $save['wlog_date'] = time(); + + //----------------------------------------- + // Anything to add? + //----------------------------------------- + + IPSLib::doDataHooks( $save , 'warnLogs' ); + + //----------------------------------------- + // Enter into warn loggy poos (eeew - poo) + //----------------------------------------- + + $this->DB->insert( 'warn_logs', $save ); + } + + //----------------------------------------- + // Done... + //----------------------------------------- + + $popup = $this->request['popup'] ? '&popup=1' : ''; + + $this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=modcp&section=editmember&mid={$this->warn_member['member_id']}" . $popup ); + } + + /** + * Show the add new warn form + * + * @return @e string + */ + protected function _showForm() + { + //----------------------------------------- + // Check permissions + //----------------------------------------- + + if ( ! $this->settings['warn_on'] ) + { + return ''; + } + + if ( $this->type == 'member' ) + { + $this->registry->output->showError( 'warn_member_notes', 10255, null, null, 403 ); + } + + //----------------------------------------- + // Editor + //----------------------------------------- + + $this->editor->setAllowBbcode( true ); + $this->editor->setAllowSmilies( true ); + $this->editor->setAllowHtml( true ); + $this->editor->setContent( $this->request['contact'], 'warn' ); + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->warn_member['warn_level'] = intval($this->warn_member['warn_level']); + $this->request['contact'] = $this->request['contact'] ? IPSText::getTextClass( 'bbcode' )->preEditParse( $this->request['contact'] ) : ''; + + return $this->registry->getClass('output')->getTemplate('modcp')->warnForm( IPSMember::buildDisplayData( $this->warn_member, '__all__' ), + $this->_error ? $this->lang->words[ $this->_error ] : '', + $this->canModQueue, + $this->canRemovePostAbility, + $this->canSuspend, + $this->editor->show( 'contact' ) ); + } + + /** + * Checking method access + * + * @return @e void + */ + protected function _checkAccess() + { + //----------------------------------------- + // I've already warned you!! + //----------------------------------------- + + if ( $this->restrictWarnsPerDay > 0 ) + { + $time_to_check = time() - 86400; + + $check = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as warn_times', 'from' => 'warn_logs', 'where' => "wlog_mid={$this->warn_member['member_id']} AND wlog_date > {$time_to_check}" ) ); + + if ( $check['warn_times'] >= $this->restrictWarnsPerDay ) + { + $this->registry->output->showError( 'warned_already', 10257, null, null, 403 ); + } + } + } + + /** + * Add a new arn entry + * + * @return @e void + */ + protected function _doWarn() + { + //----------------------------------------- + // Enabled? + //----------------------------------------- + + if ( ! $this->settings['warn_on'] ) + { + $this->registry->output->showError( 'warn_system_off', 10248 ); + } + + //----------------------------------------- + // INIT + //----------------------------------------- + + $save = array(); + $err = 0; + $topicPosts_type = trim( $this->request['topicPosts_type'] ); + $topicPosts_topics = intval( $this->request['topicPosts_topics'] ); + $topicPosts_replies = intval( $this->request['topicPosts_replies'] ); + $topicPosts_lastx = intval( $this->request['topicPosts_lastx'] ); + $topicPosts_lastxunits = trim( $this->request['topicPosts_lastxunits'] ); + $level_custom = intval( $this->request['level_custom'] ); + $ban_indef = intval( $this->request['ban_indef'] ); + $member_banned = intval( $this->warn_member['member_banned'] ); + $warn_level = intval( $this->warn_member['warn_level']) ; + + $this->request['_tab'] = 'warn'; + + //----------------------------------------- + // Protected member? Really? o_O + //----------------------------------------- + + if ( strstr( ',' . $this->settings['warn_protected'] . ',', ',' . $this->warn_member['member_group_id'] . ',' ) ) + { + $this->registry->output->showError( 'warn_protected_member', 10256, null, null, 403 ); + } + + //-------------------------------------- + // Are we allowed to do this? + //-------------------------------------- + + if ( $this->request['level'] == 'add' or ( $this->request['level'] == 'custom' and $level_custom > $warn_level ) ) + { + $this->_checkAccess(); + } + + if ( $this->type == 'member' ) + { + $this->registry->output->showError( 'warn_member_notes', 2028, null, null, 403 ); + } + + if ( $this->request['key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'warn_bad_key', 3020, null, null, 403 ); + } + + //----------------------------------------- + // As Celine Dion once squawked, "Show me the reason" + //----------------------------------------- + + if ( trim($this->request['reason']) == "" ) + { + $this->_error = 'we_no_reason'; + $this->_moderatorIndex(); + return; + } + + //----------------------------------------- + // Other checks + //----------------------------------------- + + if ( ! $this->settings['warn_past_max'] && $this->request['level'] != 'nochange' ) + { + if ( $this->request['level'] == 'custom' ) + { + if ( $level_custom > $this->settings['warn_max'] ) + { + $err = 1; + } + else if( $level_custom < $this->settings['warn_min'] ) + { + $err = 2; + } + } + else if ( $this->request['level'] == 'add' ) + { + if ( $warn_level >= $this->settings['warn_max'] ) + { + $err = 1; + } + } + else + { + if ( $warn_level <= $this->settings['warn_min'] ) + { + $err = 2; + } + } + + if ( $err ) + { + $this->registry->output->showError( $err == 1 ? 'warn_past_max_high' : 'warn_past_max_low', 10251 ); + } + } + + //----------------------------------------- + // Load Mod Squad + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' ); + $moderatorLibrary = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Plussy - minussy? + //----------------------------------------- + + if( $this->request['level'] == 'nochange' ) + { + $save['wlog_type'] = 'nochan'; + } + else + { + $save['wlog_type'] = ( $this->request['level'] == 'custom' ) ? 'custom' : ( ( $this->request['level'] == 'add' ) ? 'neg' : 'pos' ); + } + + $save['wlog_date'] = time(); + + //----------------------------------------- + // Contacting the member? + //----------------------------------------- + + $test_content = trim( IPSText::br2nl( $_POST['contact'] ) ) ; + + if ( $test_content != "" ) + { + if ( trim($this->request['subject']) == "" ) + { + $this->_error = 'we_no_subject'; + $this->_moderatorIndex(); + return; + } + + unset($test_content); + + $contact = $this->editor->process( $_POST['contact'] ); + + IPSText::getTextClass('bbcode')->parse_smilies = 1; + IPSText::getTextClass('bbcode')->parse_html = 0; + IPSText::getTextClass('bbcode')->parse_bbcode = 1; + IPSText::getTextClass('bbcode')->parsing_section = 'warn'; + IPSText::getTextClass('bbcode')->parsing_mgroup = $this->memberData['member_group_id']; + IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->memberData['mgroup_others']; + + $contact = IPSText::getTextClass( 'bbcode' )->preDbParse( $contact ); + + $save['wlog_contact'] = $this->request['contactmethod']; + $save['wlog_contact_content'] = "" . $this->request['subject'] . "" . $contact . ""; + + if ( $this->request['contactmethod'] == 'email' ) + { + IPSText::getTextClass( 'bbcode' )->parse_smilies = 0; + IPSText::getTextClass( 'bbcode' )->parse_html = 1; + IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1; + IPSText::getTextClass( 'bbcode' )->parsing_section = 'warn'; + IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id']; + IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others']; + + $contact = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $contact ); + + //----------------------------------------- + // Send the email + //----------------------------------------- + + IPSText::getTextClass( 'email' )->getTemplate("email_member"); + + IPSText::getTextClass( 'email' )->buildMessage( array( + 'MESSAGE' => $contact, + 'MEMBER_NAME' => $this->warn_member['members_display_name'], + 'FROM_NAME' => $this->memberData['members_display_name'] + ) + ); + + IPSText::getTextClass( 'email' )->subject = $this->request['subject']; + IPSText::getTextClass( 'email' )->to = $this->warn_member['email']; + IPSText::getTextClass( 'email' )->from = $this->settings['email_out']; + IPSText::getTextClass( 'email' )->sendMail(); + } + else + { + //----------------------------------------- + // Grab PM class + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' ); + $messengerFunctions = new $classToLoad( $this->registry ); + + try + { + $messengerFunctions->sendNewPersonalTopic( $this->warn_member['member_id'], + $this->memberData['member_id'], + array(), + $this->request['subject'], + $contact, + array( 'forcePm' => 1 ) + ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + $toMember = IPSMember::load( $this->warn_member['member_id'], 'core' ); + + if ( strstr( $msg, 'BBCODE_' ) ) + { + $msg = str_replace( 'BBCODE_', '', $msg ); + + $this->registry->output->showError( $msg, 10252 ); + } + else if ( isset($this->lang->words[ 'err_' . $msg ]) ) + { + $this->lang->words[ 'err_' . $msg ] = $this->lang->words[ 'err_' . $msg ]; + $this->lang->words[ 'err_' . $msg ] = str_replace( '#NAMES#' , implode( ",", $messengerFunctions->exceptionData ), $this->lang->words[ 'err_' . $msg ] ); + $this->lang->words[ 'err_' . $msg ] = str_replace( '#TONAME#' , $toMember['members_display_name'] , $this->lang->words[ 'err_' . $msg ] ); + $this->lang->words[ 'err_' . $msg ] = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $this->lang->words[ 'err_' . $msg ] ); + + $this->registry->output->showError( 'err_' . $msg, 10253 ); + } + else if( $msg != 'CANT_SEND_TO_SELF' ) + { + $_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg; + $this->registry->output->showError( $_msgString, 10254 ); + } + } + } + } + else + { + unset($test_content); + } + + //----------------------------------------- + // Right - is we banned or wha? + //----------------------------------------- + + $restrict_post = ''; + $mod_queue = ''; + $susp = ''; + $_notes = array(); + $_notes['content'] = $this->request['reason']; + $_notes['mod'] = $this->request['mod_value']; + $_notes['mod_unit'] = $this->request['mod_unit']; + $_notes['mod_indef'] = $this->request['mod_indef']; + $_notes['post'] = $this->request['post_value']; + $_notes['post_unit'] = $this->request['post_unit']; + $_notes['post_indef'] = $this->request['post_indef']; + $_notes['susp'] = $this->request['susp_value']; + $_notes['susp_unit'] = $this->request['susp_unit']; + $_notes['ban'] = $ban_indef; + $_notes['topicPosts_type'] = $topicPosts_type; + $_notes['topicPosts_topics'] = $topicPosts_topics; + $_notes['topicPosts_replies'] = $topicPosts_replies; + $_notes['topicPosts_lastx'] = $topicPosts_lastx; + $_notes['topicPosts_lastxunits'] = $topicPosts_lastxunits; + + $save['wlog_notes'] = serialize( $_notes ); + + //----------------------------------------- + // Member Content + //----------------------------------------- + + if ( $topicPosts_type == 'unapprove' OR $topicPosts_type == 'approve' ) + { + $time = ( $topicPosts_lastxunits == 'd' ) ? ( $topicPosts_lastx * 24 ) : $topicPosts_lastx; + $approve = ( $topicPosts_type == 'approve' ) ? TRUE : FALSE; + + if ( ( $topicPosts_topics AND $this->canApproveTopics ) AND ( $topicPosts_replies AND $this->canApprovePosts ) ) + { + $moderatorLibrary->toggleApproveMemberContent( $this->warn_member['member_id'], $approve, 'all', $time ); + } + else if ( $topicPosts_topics AND $this->canApproveTopics ) + { + $moderatorLibrary->toggleApproveMemberContent( $this->warn_member['member_id'], $approve, 'topics', $time ); + } + else if ( $topicPosts_replies AND $this->canApprovePosts ) + { + $moderatorLibrary->toggleApproveMemberContent( $this->warn_member['member_id'], $approve, 'replies', $time ); + } + } + else if ( $topicPosts_type == 'delete') + { + $time = ( $topicPosts_lastxunits == 'd' ) ? ( $topicPosts_lastx * 24 ) : $topicPosts_lastx; + + if ( ( $topicPosts_topics AND $this->canDeleteTopics ) AND ( $topicPosts_replies AND $this->canDeletePosts ) ) + { + $moderatorLibrary->deleteMemberContent( $this->warn_member['member_id'], 'all', $time ); + } + else if ( $topicPosts_topics AND $this->canDeleteTopics ) + { + $moderatorLibrary->deleteMemberContent( $this->warn_member['member_id'], 'topics', $time ); + } + else if ( $topicPosts_replies AND $this->canDeletePosts ) + { + $moderatorLibrary->deleteMemberContent( $this->warn_member['member_id'], 'replies', $time ); + } + } + + //----------------------------------------- + // Member Suspension + //----------------------------------------- + + if ( $this->canModQueue ) + { + if ( $this->request['mod_indef'] == 1 ) + { + $mod_queue = 1; + } + elseif ( $this->request['mod_value'] > 0 ) + { + $mod_queue = IPSMember::processBanEntry( array( 'timespan' => intval($this->request['mod_value']), 'unit' => $this->request['mod_unit'] ) ); + } + } + + if ( $this->canRemovePostAbility ) + { + if ( $this->request['post_indef'] == 1 ) + { + $restrict_post = 1; + } + elseif ( $this->request['post_value'] > 0 ) + { + $restrict_post = IPSMember::processBanEntry( array( 'timespan' => intval($this->request['post_value']), 'unit' => $this->request['post_unit'] ) ); + } + } + + if ( $this->canSuspend ) + { + if ( $ban_indef ) + { + $member_banned = 1; + } + else if ( $this->request['susp_value'] > 0 ) + { + $susp = IPSMember::processBanEntry( array( 'timespan' => intval($this->request['susp_value']), 'unit' => $this->request['susp_unit'] ) ); + } + + //----------------------------------------- + // Removing ban? + //----------------------------------------- + + if ( ! $ban_indef AND $member_banned ) + { + $member_banned = 0; + } + } + + $save['wlog_mid'] = $this->warn_member['member_id']; + $save['wlog_addedby'] = $this->memberData['member_id']; + + //----------------------------------------- + // Anything to add? + //----------------------------------------- + + IPSLib::doDataHooks( $save , 'warnLogs' ); + + //----------------------------------------- + // Enter into warn loggy poos (eeew - poo) + //----------------------------------------- + + $this->DB->insert( 'warn_logs', $save ); + + //----------------------------------------- + // Update member + //----------------------------------------- + + if( $this->request['level'] != 'nochange' ) + { + if ( $this->request['level'] == 'custom' ) + { + $warn_level = $level_custom; + } + else if ( $this->request['level'] == 'add' ) + { + $warn_level++; + } + else + { + $warn_level--; + } + + if ( $warn_level > $this->settings['warn_max'] ) + { + $warn_level = $this->settings['warn_max']; + } + + if ( $warn_level < intval($this->settings['warn_min']) ) + { + $warn_level = intval($this->settings['warn_min']); + } + } + + IPSMember::save( $this->warn_member['member_id'], array( 'core' => array( 'mod_posts' => $mod_queue, + 'restrict_post' => $restrict_post, + 'temp_ban' => $susp, + 'member_banned' => $member_banned, + 'warn_level' => $warn_level, + 'warn_lastwarn' => time() ) ) ); + + //----------------------------------------- + // Redirect + //----------------------------------------- + + $this->_redirect( sprintf( $this->lang->words['w_done_te'], $this->warn_member['members_display_name'] ) ); + } + + /** + * Flag a user account as a spammer + * + * @return @e void + */ + protected function _setAsSpammer() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $member_id = intval( $this->request['member_id'] ); + $toSave = array( 'core' => array( 'bw_is_spammer' => 1 ) ); + $topicId = intval($this->request['t']); + $topic = array(); + + if( $topicId ) + { + $topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, forum_id', 'from' => 'topics', 'where' => 'tid=' . $topicId ) ); + } + + //----------------------------------------- + // Load member + //----------------------------------------- + + $member = IPSMember::load( $member_id ); + + if ( ! $member['member_id'] ) + { + $this->registry->output->showError( 'moderate_no_permission', 10311900, true, null, 404 ); + } + + //----------------------------------------- + // Check permissions + //----------------------------------------- + + if( !$this->memberData['g_is_supmod'] AND !$this->memberData['forumsModeratorData'][ $topic['forum_id'] ]['bw_flag_spammers'] ) + { + $this->registry->output->showError( 'moderate_no_permission', 103119, true, null, 403 ); + } + + if ( strstr( ',' . $this->settings['warn_protected'] . ',', ',' . $member['member_group_id'] . ',' ) ) + { + $this->registry->output->showError( 'moderate_no_permission', 10311901, true, null, 403 ); + } + + //----------------------------------------- + // How to treat + //----------------------------------------- + + if ( $this->settings['spm_option'] ) + { + switch( $this->settings['spm_option'] ) + { + case 'disable': + $toSave['core']['restrict_post'] = 1; + $toSave['core']['members_disable_pm'] = 2; + break; + + case 'unapprove': + $toSave['core']['restrict_post'] = 1; + $toSave['core']['members_disable_pm'] = 2; + + //----------------------------------------- + // Unapprove posts and topics + //----------------------------------------- + + $this->getModLibrary()->toggleApproveMemberContent( $member_id, FALSE, 'all', intval( $this->settings['spm_post_days'] ) * 24 ); + break; + + case 'ban': + //----------------------------------------- + // Unapprove posts and topics + //----------------------------------------- + + $this->getModLibrary()->toggleApproveMemberContent( $member_id, FALSE, 'all', intval( $this->settings['spm_post_days'] ) * 24 ); + + $toSave = array( + 'core' => array( + 'member_banned' => 1, + 'title' => '', + 'bw_is_spammer' => 1, + ), + 'extendedProfile' => array( + 'signature' => '', + 'pp_about_me' => '', + ) + ); + + //----------------------------------------- + // Photo + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' ); + $photos = new $classToLoad( $this->registry ); + $photos->remove( $member['member_id'] ); + + //----------------------------------------- + // Profile fields + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + $fields->member_data = $member; + $fields->initData( 'edit' ); + $fields->parseToSave( array() ); + + if ( count( $fields->out_fields ) ) + { + $toSave['customFields'] = $fields->out_fields; + } + + //----------------------------------------- + // Update signature content cache + //----------------------------------------- + + IPSContentCache::update( $member['member_id'], 'sig', '' ); + break; + } + } + + //----------------------------------------- + // Shut off status imports + //----------------------------------------- + + $bwOptions = IPSBWOptions::thaw( $member['tc_bwoptions'], 'twitter' ); + $bwOptions['tc_si_status'] = 0; + $twitter = IPSBWOptions::freeze( $bwOptions, 'twitter' ); + + $bwOptions = IPSBWOptions::thaw( $member['fb_bwoptions'], 'facebook' ); + $bwOptions['fbc_si_status'] = 0; + $facebook = IPSBWOptions::freeze( $bwOptions, 'facebook' ); + + $toSave['extendedProfile']['tc_bwoptions'] = $twitter; + $toSave['extendedProfile']['fb_bwoptions'] = $facebook; + + //----------------------------------------- + // Send email if configured to do so + //----------------------------------------- + + if ( $this->settings['spm_notify'] AND ( $this->settings['email_in'] != $this->memberData['email'] ) ) + { + IPSText::getTextClass('email')->getTemplate( 'possibleSpammer' ); + + IPSText::getTextClass('email')->buildMessage( array( 'DATE' => $this->registry->class_localization->getDate( $member['joined'], 'LONG', 1 ), + 'MEMBER_NAME' => $member['members_display_name'], + 'IP' => $member['ip_address'], + 'EMAIL' => $member['email'], + 'LINK' => $this->registry->getClass('output')->buildSEOUrl( "showuser=" . $member['member_id'], 'public', $member['members_seo_name'], 'showuser') ) ); + + IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['new_registration_email_spammer'], $this->settings['board_name'] ); + IPSText::getTextClass('email')->to = $this->settings['email_in']; + IPSText::getTextClass('email')->sendMail(); + } + + //----------------------------------------- + // Save member + //----------------------------------------- + + IPSMember::save( $member_id, $toSave ); + + //----------------------------------------- + // Notify spam service + //----------------------------------------- + + if( $this->settings['spam_service_send_to_ips'] ) + { + IPSMember::querySpamService( $member['email'], $member['ip_address'], 'markspam' ); + } + + //----------------------------------------- + // Member sync + //----------------------------------------- + + IPSLib::runMemberSync( 'onSetAsSpammer', $member ); + + //----------------------------------------- + // Mod log + //----------------------------------------- + + $this->getModLibrary()->addModerateLog( 0, 0, 0, 0, $this->lang->words['flag_spam_done'] . ': ' . $member['member_id'] . ' - ' . $member['email'] ); + + //----------------------------------------- + // Redirect + //----------------------------------------- + + if( $topicId ) + { + $this->registry->output->redirectScreen( $this->lang->words['flag_spam_done'], $this->settings['base_url'] . "showtopic=" . $topic['tid'] . "&st=" . intval($this->request['st']), $topic['title_seo'], 'showtopic' ); + } + else + { + $this->registry->output->redirectScreen( $this->lang->words['flag_spam_done'], $this->settings['base_url'] . "showuser=" . $member['member_id'], $member['members_seo_name'], 'showuser' ); + } + } + + /** + * Save the member updates + * + * @return @e void + * @todo [Future] Determine what items should be editable and allow moderators to edit them + */ + protected function _doEditMember() + { + //----------------------------------------- + // Check permissions + //----------------------------------------- + + if ( ! $this->memberData['g_is_supmod'] ) + { + $this->registry->output->showError( 'mod_only_supermods', 10370, true, null, 403 ); + } + + if ( ! $this->memberData['g_access_cp'] AND $this->warn_member['g_access_cp'] ) + { + $this->registry->output->showError( 'mod_admin_edit', 3032, true, null, 403 ); + } + + if ( $this->request['auth_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'no_permission', 3032.1, null, null, 403 ); + } + + //----------------------------------------- + // Init + //----------------------------------------- + + $editable = array(); + + //----------------------------------------- + // Signature and about me + //----------------------------------------- + + $signature = $this->editor->process( $_POST['Post'] ); + $aboutme = $this->editor->process( $_POST['aboutme'] ); + + //----------------------------------------- + // Parse signature + //----------------------------------------- + + IPSText::getTextClass('bbcode')->parse_smilies = 0; + IPSText::getTextClass('bbcode')->parse_html = $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml']; + IPSText::getTextClass('bbcode')->parse_bbcode = 1; + IPSText::getTextClass('bbcode')->parsing_section = 'signatures'; + IPSText::getTextClass('bbcode')->parsing_mgroup = $this->warn_member['member_group_id']; + IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->warn_member['mgroup_others']; + + $signature = IPSText::getTextClass('bbcode')->preDbParse( $signature ); + $signatureCache = IPSText::getTextClass('bbcode')->preDisplayParse( $signature ); + + //----------------------------------------- + // Parse about me + //----------------------------------------- + + IPSText::getTextClass('bbcode')->parse_smilies = 0; + IPSText::getTextClass('bbcode')->parse_html = $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml']; + IPSText::getTextClass('bbcode')->parse_bbcode = 1; + IPSText::getTextClass('bbcode')->parsing_section = 'aboutme'; + IPSText::getTextClass('bbcode')->parsing_mgroup = $this->warn_member['member_group_id']; + IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->warn_member['mgroup_others']; + + $aboutme = IPSText::getTextClass('bbcode')->preDbParse( $aboutme ); + + //----------------------------------------- + // Add to array to save + //----------------------------------------- + + $save['extendedProfile'] = array( 'signature' => $signature, 'pp_about_me' => $aboutme ); + $save['members'] = array( 'title' => $this->request['title'] ); + + if ( $this->request['photo'] == 1 ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' ); + $photos = new $classToLoad( $this->registry ); + $photos->remove( $this->warn_member['member_id'] ); + } + + //----------------------------------------- + // Profile fields + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + $fields->member_data = $this->warn_member; + $fields->initData( 'edit' ); + $fields->parseToSave( $_POST ); + + if ( count( $fields->out_fields ) ) + { + $save['customFields'] = $fields->out_fields; + } + + //----------------------------------------- + // Write it to the DB. + //----------------------------------------- + + IPSMember::save( $this->warn_member['member_id'], $save ); + + //----------------------------------------- + // Update signature content cache + //----------------------------------------- + + IPSContentCache::update( $this->warn_member['member_id'], 'sig', $signatureCache ); + + //----------------------------------------- + // Add a mod log entry and redirect + //----------------------------------------- + + $this->getModLibrary()->addModerateLog( 0, 0, 0, 0, $this->lang->words['acp_edited_profile'] . " " . $this->warn_member['members_display_name'] ); + + $this->_redirect( $this->lang->words['acp_edited_profile'] . " " . $this->warn_member['members_display_name'] ); + } + + /** + * Redirect back to where we came from + * + * @param string $message Redirect message + * @return @e void + */ + protected function _redirect( $message ) + { + if( $this->request['pf'] ) + { + $this->registry->output->redirectScreen( $message, $this->settings['base_url'] . "showuser=" . $this->warn_member['member_id'], $this->warn_member['members_seo_name'], 'showuser' ); + } + else if( $this->request['t'] ) + { + $topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo', 'from' => 'topics', 'where' => 'tid=' . intval($this->request['t']) ) ); + + $this->registry->output->redirectScreen( $message, $this->settings['base_url'] . "showtopic=" . $topic['tid'] . '&st=' . $this->request['_st'], $topic['title_seo'], 'showtopic' ); + } + else + { + $this->registry->output->redirectScreen( $message, $this->settings['base_url'] . "app=core&module=modcp" ); + } + } + + /** + * Form to edit a member + * + * @return @e void + * @todo [Future] Determine what items should be editable and allow moderators to edit them + */ + protected function _editMember() + { + //----------------------------------------- + // Check permissions + //----------------------------------------- + + if ( ! $this->memberData['g_is_supmod'] ) + { + return ''; + } + + if ( ! $this->memberData['g_access_cp'] AND $this->warn_member['g_access_cp'] ) + { + return ''; + } + + //----------------------------------------- + // Init + //----------------------------------------- + + $editable = array(); + + //----------------------------------------- + // Show about me and signature editors + //----------------------------------------- + + $this->editor->setAllowBbcode( true ); + $this->editor->setAllowSmilies( false ); + $this->editor->setAllowHtml( $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml'] ); + $this->editor->setContent( $this->warn_member['signature'], 'signatures' ); + $editable['signature'] = $this->editor->show( 'Post', array( 'noSmilies' => true ) ); + + $this->editor->setAllowBbcode( true ); + $this->editor->setAllowSmilies( false ); + $this->editor->setAllowHtml( $this->caches['group_cache'][ $this->warn_member['member_group_id'] ]['g_dohtml'] ); + $this->editor->setContent( $this->warn_member['pp_about_me'], 'aboutme' ); + $editable['aboutme'] = $this->editor->show( 'aboutme', array( 'noSmilies' => true ) ); + + //----------------------------------------- + // Other fields + //----------------------------------------- + + $editable['member_id'] = $this->warn_member['member_id']; + $editable['members_display_name'] = $this->warn_member['members_display_name']; + $editable['title'] = $this->warn_member['title']; + + //----------------------------------------- + // Profile fields + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + $fields->member_data = $this->warn_member; + $fields->initData( 'edit' ); + $fields->parseToEdit(); + + $editable['_parsedMember'] = IPSMember::buildDisplayData( $this->warn_member ); + + //----------------------------------------- + // Return the HTML + //----------------------------------------- + + return $this->registry->getClass('output')->getTemplate('modcp')->editUserForm( $editable, $fields ); + } + + /** + * Get the moderator library and return it + * + * @return @e object + */ + protected function getModLibrary() + { + static $modLibrary = null; + + if( !$modLibrary ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' ); + $modLibrary = new $classToLoad( $this->registry ); + $modLibrary->init( array() ); + } + + return $modLibrary; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/modcp/index.html b/upload/admin/applications/core/modules_public/modcp/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/modules_public/modcp/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/modcp/modcp.php b/upload/admin/applications/core/modules_public/modcp/modcp.php new file mode 100644 index 00000000..f0192925 --- /dev/null +++ b/upload/admin/applications/core/modules_public/modcp/modcp.php @@ -0,0 +1,176 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +/** + * + * @class public_core_modcp_modcp + * @brief Moderator control panel + * + */ +class public_core_modcp_modcp extends ipsCommand +{ + /** + * Main function executed automatically by the controller + * + * @param object $registry Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Load basic things + //----------------------------------------- + + $this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) ); + + $this->registry->output->setTitle( $this->lang->words['modcp_page_title'] ); + + //----------------------------------------- + // Which road are we going to take? + //----------------------------------------- + + switch( $this->request['do'] ) + { + default: + case 'index': + $this->_indexPage(); + break; + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->registry->getClass('output')->addNavigation( $this->lang->words['modcp_navbar'], "app=core&module=modcp" ); + $this->registry->getClass('output')->addContent( $this->output ); + $this->registry->output->sendOutput(); + } + + /** + * Show the mod CP portal + * + * @return @e void + */ + protected function _indexPage() + { + //----------------------------------------- + // Init + //----------------------------------------- + + ipsRegistry::getAppClass('forums'); + $this->request['tab'] = empty($this->request['tab']) ? 'index' : trim($this->request['tab']); + $this->request['fromapp'] = empty($this->request['fromapp']) ? 'index' : trim($this->request['fromapp']); + + $_plugins = array(); + $_tabs = array(); + $_activeNav = array( 'primary' => 'index', 'secondary' => 'index' ); + $_output = ''; + $moderator = $this->registry->class_forums->getModerator(); + $tab = $this->request['tab']; + $app = $this->request['fromapp']; + + /** + * Loop through all apps and get plugins + * + * @note When updating this code below remember to update also the core in public_core_reports_reports + */ + foreach( IPSLib::getEnabledApplications() as $appDir => $appData ) + { + if( is_dir( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) ) + { + try + { + foreach( new DirectoryIterator( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) as $file ) + { + if( ! $file->isDot() && $file->isFile() ) + { + if( preg_match( "/^plugin_(.+?)\.php$/", $file->getFileName(), $matches ) ) + { + //----------------------------------------- + // We load each plugin so it can determine + // if it should show based on permissions + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $appDir . '_' . $matches[1], $appDir ); + $_plugins[ $appDir ][ $matches[1] ] = new $classToLoad( $this->registry ); + + if( $_plugins[ $appDir ][ $matches[1] ]->canView( $moderator ) ) + { + //----------------------------------------- + // Hacky solution - we want forum plugins to + // come first as they're the most used + //----------------------------------------- + + if( $appDir == 'forums' AND !empty($_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ]) ) + { + array_unshift( $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ], array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ) ); + } + else + { + $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ][] = array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ); + } + + /* Sort active tab */ + if ( $appDir == $app && $tab == $matches[1] ) + { + $_activeNav = array( 'primary' => $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab(), 'secondary' => $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab() ); + } + } + } + } + } + } catch ( Exception $e ) {} + } + } + + //----------------------------------------- + // If we can't view any tabs, show an error + //----------------------------------------- + + if( !count($_tabs) ) + { + $this->registry->output->showError( $this->lang->words['modcp_no_access'], 10194.12, false, null, 403 ); + } + + //----------------------------------------- + // Pass the necessary template variables into the plugin + //----------------------------------------- + + $this->registry->output->getTemplate('modcp')->templateVars['tabs'] = $_tabs; + $this->registry->output->getTemplate('modcp')->templateVars['activeNav'] = $_activeNav; + + //----------------------------------------- + // Get appropriate content to show + //----------------------------------------- + + if( $tab AND $app AND isset($_plugins[ $app ][ $tab ]) ) + { + $_output = $_plugins[ $app ][ $tab ]->executePlugin( $moderator ); + } + else + { + $_output = $this->registry->output->getTemplate('modcp')->memberLookup(); + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->output .= $this->registry->output->getTemplate('modcp')->portalPage( $_output, $_tabs, $_activeNav ); + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/reports/defaultSection.php b/upload/admin/applications/core/modules_public/reports/defaultSection.php index a9d8d636..0bcc9a21 100644 --- a/upload/admin/applications/core/modules_public/reports/defaultSection.php +++ b/upload/admin/applications/core/modules_public/reports/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default reports section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'reports' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'reports'; \ No newline at end of file +$DEFAULT_SECTION = 'reports'; diff --git a/upload/admin/applications/core/modules_public/reports/index.html b/upload/admin/applications/core/modules_public/reports/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/reports/index.html +++ b/upload/admin/applications/core/modules_public/reports/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/reports/reports.php b/upload/admin/applications/core/modules_public/reports/reports.php index 6baf63b5..9b99e3bc 100644 --- a/upload/admin/applications/core/modules_public/reports/reports.php +++ b/upload/admin/applications/core/modules_public/reports/reports.php @@ -1,21 +1,15 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Reports content central management - * Last Updated: $LastChangedDate: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $ - * - * - * @author $Author: bfarber $ + * @file reports.php Reports content central management + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @author Based on original "Report Center" by Luke Scott - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6925 $ - * + * @since - + * $LastChangedDate: 2011-09-26 15:52:07 -0400 (Mon, 26 Sep 2011) $ + * @version v3.2.3 + * $Revision: 9550 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -24,14 +18,18 @@ if ( ! defined( 'IN_IPB' ) ) exit(); } +/** + * + * @class public_core_reports_reports + * @brief Reports content central management + */ class public_core_reports_reports extends ipsCommand { /** - * Execute selected method + * Main function executed automatically by the controller * - * @access public - * @param object Registry object - * @return void + * @param object $registry Registry object + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -49,22 +47,8 @@ class public_core_reports_reports extends ipsCommand //----------------------------------------- // Check permissions... //----------------------------------------- - - $showReportCenter = false; - - $this->member_group_ids = array( $this->memberData['member_group_id'] ); - $this->member_group_ids = array_diff( array_merge( $this->member_group_ids, explode( ',', $this->memberData['mgroup_others'] ) ), array('') ); - $report_center = array_diff( explode( ',', $this->settings['report_mod_group_access'] ), array('') ); - foreach( $report_center as $groupId ) - { - if( in_array( $groupId, $this->member_group_ids ) ) - { - $showReportCenter = true; - } - } - - if( ($this->request['do'] AND $this->request['do'] != 'report') AND !$showReportCenter ) + if( $this->request['do'] AND $this->request['do'] != 'report' AND !IPSMember::isInGroup( $this->memberData, explode( ',', IPSText::cleanPermString( $this->settings['report_mod_group_access'] ) ) ) ) { $this->registry->output->showError( 'no_reports_permission', 2018, true, null, 403 ); } @@ -80,31 +64,87 @@ class public_core_reports_reports extends ipsCommand default: case 'report': $this->_initReportForm(); - break; + break; case 'showMessage': $this->_viewReportedMessage(); - break; + break; case 'index': $this->_displayReportCenter(); - break; + break; case 'process': $this->_processReports(); - break; + break; case 'findfirst': $this->findFirstReport(); - break; + break; case 'show_report': $this->_displayReport(); - break; + break; + } + + if( $this->request['do'] AND $this->request['do'] != 'report' ) + { + /* Init some data */ + $_tabs = array(); + $_activeNav = array( 'primary' => 'reported_content', 'secondary' => 'reports' ); + $moderator = $this->registry->class_forums->getModerator(); - case 'save_comment': - $this->_saveComment(); - break; + $this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ), 'core' ); + + /** + * Loop through all apps and get plugins + * + * @note When updating this code below remember to update also the core in public_core_modcp_modcp + */ + foreach( IPSLib::getEnabledApplications() as $appDir => $appData ) + { + if( is_dir( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) ) + { + try + { + foreach( new DirectoryIterator( IPSLib::getAppDir( $appDir ) . '/extensions/modcp' ) as $file ) + { + if( ! $file->isDot() && $file->isFile() ) + { + if( preg_match( "/^plugin_(.+?)\.php$/", $file->getFileName(), $matches ) ) + { + //----------------------------------------- + // We load each plugin so it can determine + // if it should show based on permissions + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( $file->getPathName(), 'plugin_' . $appDir . '_' . $matches[1], $appDir ); + $_plugins[ $appDir ][ $matches[1] ] = new $classToLoad( $this->registry ); + + if( $_plugins[ $appDir ][ $matches[1] ]->canView( $moderator ) ) + { + //----------------------------------------- + // Hacky solution - we want forum plugins to + // come first as they're the most used + //----------------------------------------- + + if( $appDir == 'forums' AND !empty($_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ]) ) + { + array_unshift( $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ], array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ) ); + } + else + { + $_tabs[ $_plugins[ $appDir ][ $matches[1] ]->getPrimaryTab() ][] = array( $_plugins[ $appDir ][ $matches[1] ]->getSecondaryTab(), $appDir, $matches[1] ); + } + } + } + } + } + } catch ( Exception $e ) {} + } + } + + $this->output = $this->registry->output->getTemplate('modcp')->portalPage( $this->output, $_tabs, $_activeNav ); } //----------------------------------------- @@ -118,10 +158,9 @@ class public_core_reports_reports extends ipsCommand /** * View a reported private message as it shows in the messenger * - * @access private - * @return void + * @return @e void */ - private function _viewReportedMessage() + public function _viewReportedMessage() { //----------------------------------------- // Do we have permission? @@ -129,7 +168,7 @@ class public_core_reports_reports extends ipsCommand $this->registry->getClass('reportLibrary')->buildQueryPermissions(); - if( !in_array( $this->memberData['member_group_id'], explode( ',', $this->registry->getClass('reportLibrary')->plugins['messages']->_extra['plugi_messages_add'] ) ) ) + if( !IPSMember::isInGroup( $this->memberData, explode( ',', $this->registry->getClass('reportLibrary')->plugins['messages']->_extra['plugi_messages_add'] ) ) ) { $this->registry->getClass('output')->showError( 'no_permission_addreport', 20115, null, null, 403 ); } @@ -207,10 +246,9 @@ class public_core_reports_reports extends ipsCommand /** * Main function for displaying reports in a list * - * @access private - * @return void + * @return @e void */ - private function _displayReportCenter() + public function _displayReportCenter() { //----------------------------------------- // Check for rss key and if none make one @@ -230,48 +268,94 @@ class public_core_reports_reports extends ipsCommand $COM_PERM = $this->registry->getClass('reportLibrary')->buildQueryPermissions(); - $reports = array(); + $reports = array(); + + //----------------------------------------- + // By default we will only show active reports. + // If there are no active reports, show all instead. + // Alternatively, user can click a show all link we need to honor. + //----------------------------------------- + + $_where = $COM_PERM . ' AND stat.is_active=1'; + + if( $this->request['showall'] ) + { + $_where = $COM_PERM; + } //----------------------------------------- // Show me the money! err.. Reports! //----------------------------------------- $total = $this->DB->buildAndFetch( array( - 'select' => 'COUNT(*) as reports', - 'from' => array( 'rc_reports_index' => 'rep' ), - 'where' => $COM_PERM, - 'add_join' => array( - array( - 'from' => array( 'rc_classes' => 'rcl' ), - 'where' => 'rcl.com_id=rep.rc_class' - ) + 'select' => 'COUNT(*) as reports', + 'from' => array( 'rc_reports_index' => 'rep' ), + 'where' => $_where, + 'add_join' => array( + array( + 'from' => array( 'rc_classes' => 'rcl' ), + 'where' => 'rcl.com_id=rep.rc_class' + ), + array( + 'from' => array( 'rc_status' => 'stat' ), + 'where' => 'stat.status=rep.status' + ) + ) + ) ); + + if( !$total['reports'] AND !$this->request['showall'] ) + { + $this->request['showall'] = 1; + + $_where = $COM_PERM; + $total = $this->DB->buildAndFetch( array( + 'select' => 'COUNT(*) as reports', + 'from' => array( 'rc_reports_index' => 'rep' ), + 'where' => $_where, + 'add_join' => array( + array( + 'from' => array( 'rc_classes' => 'rcl' ), + 'where' => 'rcl.com_id=rep.rc_class' + ), + array( + 'from' => array( 'rc_status' => 'stat' ), + 'where' => 'stat.status=rep.status' ) - ) ); - - + ) + ) ); + } - $this->DB->buildFromCache( 'reports_index', array( 'WHERE' => $COM_PERM, 'START' => intval($this->request['st']), 'LIMIT' => 10 ), 'report_sql_queries' ); + $this->DB->buildFromCache( 'reports_index', array( 'WHERE' => $_where, 'START' => intval($this->request['st']), 'LIMIT' => 10 ), 'report_sql_queries' ); $res = $this->DB->execute(); while( $row = $this->DB->fetch($res) ) { + $row['_isRead'] = $this->registry->classItemMarking->isRead( array( 'forumID' => 0, 'itemID' => $row['id'], 'itemLastUpdate' => $row['date_updated'] ), 'core' ); $sec_data = $this->registry->getClass('reportLibrary')->plugins[$row['my_class']]->giveSectionLinkTitle( $row ); $sec_data['url'] = $this->registry->getClass('reportLibrary')->processUrl( $sec_data['url'], $sec_data['seo_title'], $sec_data['seo_template'] ); $row['points'] = isset( $row['points'] ) ? $row['points'] : $this->settings['_tmpPoints'][ $row['id'] ]; $row['section'] = $sec_data; - $row['status_icon'] = $this->_buildStatusIcon( $row ); + $row['status_icon'] = $this->registry->getClass('reportLibrary')->buildStatusIcon( $row ); $reports[ $row['id'] ] = $row; + + $members_to_load[] = $row['updated_by']; + } + + $members = IPSMember::load( $members_to_load ); + + foreach( $reports as $id => $data ) + { + $reports[ $id ]['member'] = IPSMember::buildDisplayData( $members[ $data['updated_by'] ] ); } //----------------------------------------- - // Statuses + // Manually build status array without severities //----------------------------------------- $stats = array(); $_tmp = $this->registry->getClass('reportLibrary')->flag_cache; - - // Manually build array get just the statuses, not severities + foreach( $_tmp as $sid => $sta ) { if( is_array( $sta ) && count( $sta ) ) @@ -292,23 +376,29 @@ class public_core_reports_reports extends ipsCommand // Display Page Navigation //----------------------------------------- - $pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['reports'], - 'itemsPerPage' => 10, - 'currentStartValue' => $this->request['st'], - 'baseUrl' => 'app=core&module=reports&do=index' + $_url = 'app=core&module=reports&do=index'; + + if( $this->request['showall'] ) + { + $_url .= '&showall=1'; + } + + $pages = $this->registry->output->generatePagination( array( 'totalItems' => $total['reports'], + 'itemsPerPage' => 10, + 'currentStartValue' => $this->request['st'], + 'baseUrl' => $_url ) ); - $this->output .= $this->registry->getClass('output')->getTemplate('reports')->reportsIndex( $reports, $this->registry->getClass('reportLibrary')->buildStatuses(), $pages, $this->_getStats( 1 ), $stats ); + $this->output .= $this->registry->getClass('output')->getTemplate('reports')->reportsIndex( $reports, $this->registry->getClass('reportLibrary')->buildStatuses(), $pages, $stats ); } /** * Basic functions for processing actions on 'Report Index' page (Drop Down) * - * @access private - * @return void + * @return @e void */ - private function _processReports() + public function _processReports() { //----------------------------------------- // Check form key @@ -339,11 +429,11 @@ class public_core_reports_reports extends ipsCommand if( $total_pruned ) { - $this->registry->output->redirectScreen( $this->lang->words['report_prune_message_done'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] ); + $this->registry->output->redirectScreen( $this->lang->words['report_prune_message_done'], $this->settings['base_url'] . "app=core&module=reports&do=index" ); } else { - $this->registry->output->redirectScreen( $this->lang->words['report_prune_message_none'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] ); + $this->registry->output->redirectScreen( $this->lang->words['report_prune_message_none'], $this->settings['base_url'] . "app=core&module=reports&do=index" ); } } @@ -371,7 +461,7 @@ class public_core_reports_reports extends ipsCommand $this->_deleteReports( $ids, true ); $this->registry->getClass('reportLibrary')->updateCacheTime(); - $this->registry->output->redirectScreen( $this->lang->words['redirect_delete_report'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] ); + $this->registry->output->redirectScreen( $this->lang->words['redirect_delete_report'], $this->settings['base_url'] . "app=core&module=reports&do=index" ); } else { @@ -389,7 +479,7 @@ class public_core_reports_reports extends ipsCommand $this->registry->getClass('reportLibrary')->updateCacheTime(); - $this->registry->output->redirectScreen( $this->lang->words['redirect_mark_status'], $this->settings['base_url'] . "app=core&module=reports&do=index&st=" . $this->request['st'] ); + $this->registry->output->redirectScreen( $this->lang->words['redirect_mark_status'], $this->settings['base_url'] . "app=core&module=reports&do=index" ); } } } @@ -411,8 +501,7 @@ class public_core_reports_reports extends ipsCommand /** * Finds first post reported using topic-id * - * @access public - * @return void + * @return @e void */ public function findFirstReport() { @@ -439,10 +528,9 @@ class public_core_reports_reports extends ipsCommand /** * Main function for making reports and uses the custom plugins * - * @access private - * @return void + * @return @e void */ - private function _initReportForm() + public function _initReportForm() { //----------------------------------------- // Make sure we have an rcom @@ -459,7 +547,7 @@ class public_core_reports_reports extends ipsCommand // Request plugin info from database //----------------------------------------- - $row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'rc_classes', 'where' => "my_class='{$rcom}' AND onoff=1" ) ); + $row = $this->caches['report_plugins'][ $rcom ]; if( !$row['com_id'] ) { @@ -471,7 +559,7 @@ class public_core_reports_reports extends ipsCommand // Can this group report this type of page? //----------------------------------------- - if( $row['my_class'] == '' || count( array_diff($this->member_group_ids, explode(',', $row['group_can_report'])) ) >= count( $this->member_group_ids ) ) + if( !$row['my_class'] OR !IPSMember::isInGroup( $this->memberData, explode( ',', IPSText::cleanPermString( $row['group_can_report'] ) ) ) ) { $this->registry->output->showError( 'reports_cant_report', 10136, null, null, 403 ); } @@ -544,7 +632,7 @@ class public_core_reports_reports extends ipsCommand //----------------------------------------- // Send out notfications... //----------------------------------------- - + $notify->initNotify( $this->registry->getClass('reportLibrary')->plugins[ $row['my_class'] ]->getNotificationList( IPSText::cleanPermString( $row['mod_group_perm'] ), $report_data ), $report_data ); $notify->sendNotifications(); @@ -558,21 +646,18 @@ class public_core_reports_reports extends ipsCommand } /** - * Handles ajax/non-ajax window for reports and comments linked from reports + * Displays a report * - * @access private - * @return boolean + * @return @e void */ - private function _displayReport() + public function _displayReport() { //----------------------------------------- // Lets make sure this report exists... //----------------------------------------- $rid = intval($this->request['rid']); - $options = array( - 'rid' => $rid - ); + $options = array( 'rid' => $rid ); $reports = array(); $comments = array(); @@ -592,7 +677,7 @@ class public_core_reports_reports extends ipsCommand $this->registry->output->addNavigation( $this->lang->words['main_title'], 'app=core&module=reports&do=index' ); $this->registry->output->addNavigation( $report_index['title'], '' ); - if( $this->DB->getTotalRows() == 0 ) + if ( !$report_index['id'] ) { $this->registry->output->showError( 'reports_no_rid', 10138 ); } @@ -636,15 +721,10 @@ class public_core_reports_reports extends ipsCommand $options['title'] = $row['title']; $options['status_id'] = $row['status']; - - if( !$options['image'] && $row['img_preview'] ) - { - $options['image'] = $this->registry->getClass('reportLibrary')->processUrl( $row['img_preview'], $row['seoname'], $row['seotemplate'] ); - } - + if( !$options['status_icon'] ) { - $options['status_icon'] = $this->_buildStatusIcon( $row ); + $options['status_icon'] = $this->registry->getClass('reportLibrary')->buildStatusIcon( $row ); $options['status_text'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['title']; } @@ -656,7 +736,6 @@ class public_core_reports_reports extends ipsCommand $row['title'] = $row['_title']; $row['report'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['report'] ); - $row['report'] = IPSText::getTextClass( 'bbcode' )->memberViewImages( $row['report'] ); $reports[] = $row; } @@ -688,57 +767,19 @@ class public_core_reports_reports extends ipsCommand //----------------------------------------- // Get comments //----------------------------------------- - - $ids = array( 0 => 0 ); - - $this->DB->build( array( 'select' => 'id', - 'from' => 'rc_comments', - 'where' => 'rid=' . $rid, - 'group' => 'id' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $ids[ $row['id'] ] = $row['id']; - } - - $this->DB->build( array( - 'select' => 'comm.*', - 'from' => array( 'rc_comments' => 'comm' ), - 'where' => 'comm.id IN (' . implode( ',', $ids ) . ')', - 'order' => 'comm.comment_date ASC', - 'add_join' => array( - array( - 'select' => 'mem.*', - 'from' => array( 'members' => 'mem' ), - 'where' => 'mem.member_id=comm.comment_by', - ), - array( - 'select' => 'grop.*,grop.g_is_supmod as iscop', - 'from' => array( 'groups' => 'grop' ), - 'where' => 'grop.g_id=mem.member_group_id', - ), - array( - 'select' => 'pp.*', - 'from' => array( 'profile_portal' => 'pp' ), - 'where' => 'pp.pp_member_id=mem.member_id', - ), - ) - ) ); - $outer = $this->DB->execute(); - while($row = $this->DB->fetch($outer)) - { - IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id']; - IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others']; + require_once( IPS_ROOT_PATH . 'sources/classes/comments/bootstrap.php' );/*noLibHook*/ + $this->_comments = classes_comments_bootstrap::controller( 'core-reports' ); + + $comments = array( 'html' => $this->_comments->fetchFormatted( $report_index, array( 'offset' => intval( $this->request['st'] ) ) ), + 'count' => $this->_comments->count( $report_index ), + ); - $row['author'] = IPSMember::buildDisplayData( $row['member_id'] ); - $row['comment'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment'] ); - $row['comment'] = IPSText::getTextClass( 'bbcode' )->memberViewImages( $row['comment'] ); - - $comments[ $row['id'] ] = $row; - } + //----------------------------------------- + // Mark as read + //----------------------------------------- + + $this->registry->classItemMarking->markRead( array( 'forumID' => 0, 'itemID' => $rid ), 'core' ); //----------------------------------------- // And output @@ -746,93 +787,35 @@ class public_core_reports_reports extends ipsCommand $this->output .= $this->registry->getClass('output')->getTemplate('reports')->viewReport( $options, $reports, $comments ); } - - /** - * Recieves comment, submits to database, and redirects user - * - * @access private - * @return void - */ - private function _saveComment() - { - //----------------------------------------- - // Make sure we have a report id... - //----------------------------------------- - - $rid = intval($this->request['rid']); - - if( $rid < 1 ) - { - $this->registry->output->showError( 'reports_no_comment', 10139 ); - } - - //----------------------------------------- - // Lets make sure we even have this report - //----------------------------------------- - - $report = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'rc_reports_index', 'where' => "id=" . $rid ) ); - - if( $report['id'] ) - { - $postContent = IPSText::getTextClass( 'editor' )->processRawPost( $_POST['comment'] ); - - IPSText::getTextClass('bbcode')->parse_bbcode = 1; - IPSText::getTextClass('bbcode')->parse_html = 0; - IPSText::getTextClass('bbcode')->parse_emoticons = 1; - IPSText::getTextClass('bbcode')->parse_nl2br = 1; - IPSText::getTextClass('bbcode')->parsing_section = 'reports'; - - $postContent = IPSText::getTextClass( 'bbcode' )->preDbParse( $postContent ); - - if( !trim( IPSText::br2nl($postContent) ) ) - { - $this->registry->output->showError( 'reports_no_comment_text', 10188 ); - } - - $build_comment = array( - 'rid' => $rid, - 'comment' => $postContent, - 'comment_by' => $this->memberData['member_id'], - 'comment_date' => time() - ); - - $this->DB->insert( 'rc_comments', $build_comment ); - $this->DB->update( 'rc_reports_index', array( 'num_comments' => $report['num_comments'] + 1, 'date_updated' => time(), 'updated_by' => $this->memberData['member_id'] ), "id=" . $report['id'] ); - } - - $this->registry->output->redirectScreen( $this->lang->words['report_comment_saved'], $this->settings['base_url'] . "app=core&module=reports&rid={$report['id']}&do=show_report" ); - } /** * Responsible for pruning reports. Uses the delete reports function to finish * - * @access private - * @param integer seconds used for pruning reports - * @return void + * @param integer $stamp Seconds used for pruning reports + * @return @e void */ - private function _pruneReports( $stamp ) + public function _pruneReports( $stamp ) { - $ids = array(); + $ids = array(); //-------------------------------------------------- // Let's grab a list of reports and check stuff... //-------------------------------------------------- - $this->DB->build( array( - 'select' => 'rep.id', - 'from' => array( 'rc_reports_index' => 'rep' ), - 'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND stat.is_complete=1 And rep.date_updated<' . $stamp, - 'add_join' => array( - array( - 'from' => array( 'rc_classes' => 'rcl' ), - 'where' => 'rcl.com_id=rep.rc_class' - ), - array( - 'from' => array( 'rc_status' => 'stat' ), - 'where' => 'stat.status=rep.status' - ), - ) - ) ); + $this->DB->build( array('select' => 'rep.id', + 'from' => array( 'rc_reports_index' => 'rep' ), + 'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND stat.is_complete=1 And rep.date_updated<' . $stamp, + 'add_join' => array( + array( + 'from' => array( 'rc_classes' => 'rcl' ), + 'where' => 'rcl.com_id=rep.rc_class' + ), + array( + 'from' => array( 'rc_status' => 'stat' ), + 'where' => 'stat.status=rep.status' + ), + ) + ) ); $this->DB->execute(); while( $row = $this->DB->fetch() ) @@ -855,12 +838,11 @@ class public_core_reports_reports extends ipsCommand /** * Responsible for deleting reports * - * @access private - * @param string Report IDS (#,#,#,...) - * @param boolean Security check? - * @return boolean + * @param string $rids Report IDS (#,#,#,...) + * @param boolean $toCheck Security check? + * @return @e boolean TRUE if all is fine otherwise FALSE */ - private function _deleteReports( $rids='', $toCheck=false ) + public function _deleteReports( $rids='', $toCheck=false ) { if( $this->memberData['g_access_cp'] != 1 ) { @@ -882,21 +864,14 @@ class public_core_reports_reports extends ipsCommand if( $toCheck == true ) { - $this->DB->build( array( - 'select' => 'rep.id, rep.status', - 'from' => array( 'rc_reports_index' => 'rep' ), - 'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND rep.id IN(' . $rids . ')', - 'add_join' => array( - array( - 'from' => array( 'rc_classes' => 'rcl' ), - 'where' => 'rcl.com_id=rep.rc_class' - ) - ) - ) ); - $res = $this->DB->execute(); - $num = $this->DB->getTotalRows(); + $num = $this->DB->buildAndFetch( array( 'select' => 'count(rep.id) as total', + 'from' => array( 'rc_reports_index' => 'rep' ), + 'where' => $this->registry->getClass('reportLibrary')->buildQueryPermissions() . ' AND rep.id IN(' . $rids . ')', + 'add_join' => array( array('from' => array( 'rc_classes' => 'rcl' ), + 'where' => 'rcl.com_id=rep.rc_class' ) ) + ) ); - if( count( explode( ',' , $rids ) ) != $this->DB->getTotalRows() ) + if( count( explode( ',' , $rids ) ) != intval($num['total']) ) { $this->registry->output->showError( 'reports_like_whoa', 20111, true ); } @@ -918,194 +893,4 @@ class public_core_reports_reports extends ipsCommand return true; } - - /** - * Returns the correct status icon / flag to display for a report row - * - * @access private - * @param array Report Row - * @return string - */ - private function _buildStatusIcon( $row ) - { - $this->registry->getClass('reportLibrary')->buildStatuses( true ); - - //----------------------------------------- - // Pick the right flag.. or else! - //----------------------------------------- - - $row['img'] = str_replace( '<#IMG_DIR#>', $this->registry->output->skin['set_image_dir'], $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['img'] ); - $row['width'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['width']; - $row['height'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['height']; - $row['is_png'] = $this->registry->getClass('reportLibrary')->flag_cache[ $row['status'] ][ $row['points'] ]['is_png']; - - //----------------------------------------- - // Image? PNG? Using 'Is-Evil' machine? - //----------------------------------------- - - if( $row['img'] != '' ) - { - return $this->registry->getClass('output')->getTemplate('reports')->statusIcon( $row['img'], $row['width'], $row['height'] ); - } - else - { - return ' '; - } - } - - /** - * Builds the "who's viewing" strip - * - * @access private - * @param integer Section ID - * @return string - */ - private function _getStats( $id=1 ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $ar_time = time(); - $cached = array(); - $guests = array(); - $active = array( 'guests' => 0, 'anon' => 0, 'members' => 0, 'names' => array() ); - $rows = array( $ar_time => array( 'login_type' => substr($this->memberData['login_anonymous'],0, 1), - 'running_time' => $ar_time, - 'id' => $this->member->session_id, - 'seo_name' => $this->memberData['members_seo_name'], - 'member_id' => $this->memberData['member_id'], - 'member_name' => $this->memberData['members_display_name'], - 'member_group' => $this->memberData['member_group_id'] ) ); - - //----------------------------------------- - // Process users active in this forum - //----------------------------------------- - - if ($this->settings['no_au_topic'] != 1) - { - //----------------------------------------- - // Get the users - //----------------------------------------- - - $cut_off = ($this->settings['au_cutoff'] != "") ? $this->settings['au_cutoff'] * 60 : 900; - - $this->DB->build( array( - 'select' => '*', - 'from' => 'sessions', - 'where' => "current_appcomponent='core' AND current_module='reports' AND running_time > " . $cut_off, - ) ); - $this->DB->execute(); - - //----------------------------------------- - // FETCH... - //----------------------------------------- - - while ($r = $this->DB->fetch() ) - { - $rows[ $r['running_time'].'.'.$r['id'] ] = $r; - } - - krsort( $rows ); - - //----------------------------------------- - // PRINT... - //----------------------------------------- - - foreach( $rows as $result ) - { - $result['member_name'] = IPSLib::makeNameFormatted( $result['member_name'], $result['member_group'] ); - - $last_date = $this->registry->class_localization->getTime( $result['running_time'] ); - - if ( $result['member_id'] == 0 OR ! $result['member_name'] ) - { - if ( in_array( $result['id'], $guests ) ) - { - continue; - } - - //----------------------------------------- - // Bot? - //----------------------------------------- - - if ( $result['uagent_type'] == 'search' ) - { - //----------------------------------------- - // Seen bot of this type yet? - //----------------------------------------- - - if ( ! $cached[ $result['member_name'] ] ) - { - if ( $this->settings['spider_anon'] ) - { - if ( $this->memberData['g_access_cp'] ) - { - $active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'], 'seo' => $result['seo_name'] ); - } - } - else - { - $active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'], 'seo' => $result['seo_name'] ); - } - - $cached[ $result['member_name'] ] = 1; - } - else - { - $active['guests']++; - $guests[] = $result['id']; - } - } - else - { - $active['guests']++; - $guests[] = $result['id']; - } - } - else - { - if (empty( $cached[ $result['member_id'] ] ) ) - { - $cached[ $result['member_id'] ] = 1; - - $p_start = ""; - $p_end = ""; - $p_title = sprintf( $this->lang->words['au_reading'], $last_date ); - - if ( strstr( $result['current_module'], 'post' ) and $result['member_id'] != $this->memberData['member_id'] ) - { - $p_start = ""; - $p_end = ""; - $p_title = sprintf( $this->lang->words['au_posting'], $last_date ); - } - - if ( ! $this->settings['disable_anonymous'] AND $result['login_type'] ) - { - if ( $this->memberData['g_access_cp'] and ($this->settings['disable_admin_anon'] != 1) ) - { - $active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'] . '*', 'p_start' => $p_start, 'p_title' => $p_title, 'p_end' => $p_end, 'seo' => $result['seo_name'] ); - $active['anon']++; - } - else - { - $active['anon']++; - } - } - else - { - $active['members']++; - $active['names'][] = array( 'id' => $result['member_id'], 'name' => $result['member_name'], 'p_start' => $p_start, 'p_title' => $p_title, 'p_end' => $p_end, 'seo' => $result['seo_name'] ); - } - } - } - } - - //$active['active_users_title'] = sprintf( $this->lang->words['active_users_title'] , ($active['members'] + $active['guests'] + $active['anon'] ) ); - //$active['active_users_detail'] = sprintf( $this->lang->words['active_users_detail'] , $active['guests'],$active['anon'] ); - $active['active_users_members'] = sprintf( $this->lang->words['active_users_members'], $active['members'] ); - - return $active; - } - } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/search/defaultSection.php b/upload/admin/applications/core/modules_public/search/defaultSection.php index d2a6005c..3d944e44 100644 --- a/upload/admin/applications/core/modules_public/search/defaultSection.php +++ b/upload/admin/applications/core/modules_public/search/defaultSection.php @@ -1,32 +1,14 @@ - * Invision Power Services - * IP.Board v3.1.4 - * Define the default section section - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com + * @file defaultSection.php Define the default section for the 'search' module + *~TERABYTE_DOC_READY~ + * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ + * $License: This is NULLED! + * $Author: ips_terabyte $ * @since 20th February 2002 - * @version $Rev: 5713 $ - * + * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ + * @version v3.2.3 + * $Revision: 8655 $ */ -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Very simply returns the default section if one is not -* passed in the URL -*/ - -$DEFAULT_SECTION = 'search'; \ No newline at end of file +$DEFAULT_SECTION = 'search'; diff --git a/upload/admin/applications/core/modules_public/search/index.html b/upload/admin/applications/core/modules_public/search/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/search/index.html +++ b/upload/admin/applications/core/modules_public/search/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/search/search.php b/upload/admin/applications/core/modules_public/search/search.php index 05191cbe..6772035c 100644 --- a/upload/admin/applications/core/modules_public/search/search.php +++ b/upload/admin/applications/core/modules_public/search/search.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Global Search
    - * Last Updated: $Date: 2010-11-17 03:11:07 -0500 (Wed, 17 Nov 2010) $
    + * Last Updated: $Date: 2011-09-21 16:54:20 -0400 (Wed, 21 Sep 2011) $
      * 
    * - * @author $Author: mmecham $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 7200 $ + * @link http://hatynka.in + * @version $Rev: 9532 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -29,43 +29,43 @@ class public_core_search_search extends ipsCommand * * @var string */ - private $output = ''; + protected $output = ''; /** * Page Title * * @var string */ - private $title = ''; + protected $title = ''; /** * Object to handle searches * * @var string */ - private $search_plugin = ''; + protected $search_plugin = ''; /** * Topics array * * @var array */ - private $_topicArray = array(); - private $_removedTerms = array(); + protected $_topicArray = array(); + protected $_removedTerms = array(); /** * Search controller * * @var obj */ - private $searchController; - private $_session; + protected $searchController; + protected $_session; /** * Class entry point * * @param object Registry reference - * @return void [Outputs to screen/redirects] + * @return @e void [Outputs to screen/redirects] */ public function doExecute( ipsRegistry $registry ) { @@ -76,6 +76,12 @@ class public_core_search_search extends ipsCommand /* Reset engine type */ $this->settings['search_method'] = ( $this->settings['search_method'] == 'traditional' ) ? 'sql' : $this->settings['search_method']; + /* Force SQL for view new content? */ + if ( ! empty( $this->settings['force_sql_vnc'] ) && $this->request['do'] == 'viewNewContent' ) + { + $this->settings['search_method'] = 'sql'; + } + /* Special consideration for contextual search */ if ( isset( $this->request['search_app'] ) AND strstr( $this->request['search_app'], ':' ) ) { @@ -104,7 +110,7 @@ class public_core_search_search extends ipsCommand /* Sanitzie */ if ( ! is_string( $this->request['search_app'] ) ) { - $this->request['search_app'] = ''; + $this->request['search_app'] = 'forums'; } try @@ -128,10 +134,16 @@ class public_core_search_search extends ipsCommand } } + /* Log type */ + IPSDebug::addMessage( "Search type: " . $this->settings['search_method'] ); + /* Set up some defaults */ + IPSSearchRegistry::set('opt.noPostPreview', false ); IPSSearchRegistry::set('in.start', intval( $this->request['st'] ) ); IPSSearchRegistry::set('opt.search_per_page', intval( $this->settings['search_per_page'] ) ? intval( $this->settings['search_per_page'] ) : 25 ); + $this->settings['search_ucontent_days'] = ( $this->settings['search_ucontent_days'] ) ? $this->settings['search_ucontent_days'] : 365; + /* Contextuals */ if ( isset( $this->request['cType'] ) ) { @@ -142,16 +154,14 @@ class public_core_search_search extends ipsCommand /* What to do */ switch( $this->request['do'] ) { - case 'active': - $this->activeContent(); - break; - case 'user_activity': $this->viewUserContent(); break; case 'new_posts': - $this->viewNewPosts(); + case 'viewNewContent': + case 'active': + $this->viewNewContent(); break; case 'search': @@ -159,6 +169,14 @@ class public_core_search_search extends ipsCommand $this->searchResults(); break; + case 'followed': + $this->viewFollowedContent(); + break; + + case 'manageFollowed': + $this->updateFollowedContent(); + break; + default: case 'search_form': $this->searchAdvancedForm(); @@ -174,11 +192,245 @@ class public_core_search_search extends ipsCommand $this->registry->output->sendOutput(); } + /** + * Moderate your list of liked content + * + * @author bfarber + * @return string HTML to display + */ + public function updateFollowedContent() + { + IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] ); + + //----------------------------------------- + // Get the likes we selected + //----------------------------------------- + + $_likes = array(); + + if( is_array($this->request['likes']) AND count($this->request['likes']) ) + { + foreach( $this->request['likes'] as $_like ) + { + $_thisLike = explode( '-', $_like ); + $_likes[] = array( + 'app' => $_thisLike[0], + 'area' => $_thisLike[1], + 'id' => $_thisLike[2], + ); + } + } + + //----------------------------------------- + // Got any? + //----------------------------------------- + + if( !count($_likes) OR !is_array($_likes) ) + { + return $this->viewFollowedContent( $this->lang->words['no_likes_for_del'] ); + } + + //----------------------------------------- + // Get like helper class + //----------------------------------------- + + $bootstraps = array(); + + require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ + + //----------------------------------------- + // Loop over and moderate + //----------------------------------------- + + foreach( $_likes as $_like ) + { + $_bootstrap = classes_like::bootstrap( $_like['app'], $_like['area'] ); + $_likeKey = classes_like_registry::getKey( $_like['id'], $this->memberData['member_id'] ); + $_frequencies = $_bootstrap->allowedFrequencies(); + + //----------------------------------------- + // What action to take? + //----------------------------------------- + + switch( $this->request['modaction'] ) + { + case 'delete': + $_bootstrap->remove( $_like['id'], $this->memberData['member_id'] ); + break; + + case 'change-donotify': + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + + case 'change-donotnotify': + $this->DB->update( 'core_like', array( 'like_notify_do' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + + case 'change-immediate': + if( in_array( 'immediate', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-offline': + if( in_array( 'offline', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'offline' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-daily': + if( in_array( 'daily', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'daily' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-weekly': + if( in_array( 'weekly', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'weekly' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-anon': + $this->DB->update( 'core_like', array( 'like_is_anon' => 1 ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + + case 'change-noanon': + $this->DB->update( 'core_like', array( 'like_is_anon' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + } + } + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=search&do=followed&search_app={$this->request['search_app']}&contentType={$this->request['contentType']}&confirm=1" ); + } + + /** + * View content you are following + * + * @author Brandon Farber + * @param string $error Error message + * @return @e void + */ + public function viewFollowedContent( $error='' ) + { + IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] ); + IPSSearchRegistry::set( 'opt.searchType', 'titles' ); + IPSSearchRegistry::set( 'opt.noPostPreview', true ); + + $results = array(); + $formatted = array(); + $count = 0; + + //----------------------------------------- + // Determine content type + //----------------------------------------- + + $contentTypes = IPSSearchRegistry::get('config.followContentTypes'); + + //----------------------------------------- + // Verify likes are available + //----------------------------------------- + + if( count( IPSLib::getEnabledApplications('like') ) AND count( $contentTypes ) ) + { + //----------------------------------------- + // What content type? + //----------------------------------------- + + $_type = ''; + + if( $this->request['contentType'] AND in_array( $this->request['contentType'], $contentTypes ) ) + { + $_type = $this->request['contentType']; + } + else + { + $_type = $contentTypes[0]; + } + + $this->request['contentType'] = $_type; + + IPSSearchRegistry::set( 'in.followContentType', $this->request['contentType'] ); + + /* Fetch like class */ + try + { + require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ + $this->_like = classes_like::bootstrap( IPSSearchRegistry::get('in.search_app'), $_type ); + } + catch ( Exception $e) + { + /* Fail safe... */ + $this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' ); + $this->title = $this->lang->words['followed_ct_title']; + $this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( array(), '', 0, $error, $contentTypes ); + } + + /* Get a count of likes */ + $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', + 'from' => 'core_like', + 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'" ) ); + $count = $count['er']; + + /* Do we have some custom join and sort data? */ + if ( method_exists( $this->_like, 'getSearchJoinAndSortBy' ) ) + { + $custom = $this->_like->getSearchJoinAndSortBy(); + + $this->DB->build( array( 'select' => 'l.*', + 'from' => array('core_like' => 'l'), + 'where' => 'l.like_member_id=' . $this->memberData['member_id'] . " AND l.like_visible=1 AND l.like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND l.like_area='" . $_type . "'", + 'add_join' => array( array( 'from' => $custom['from'], + 'where' => $custom['where'] ) ), + 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), + 'order' => $custom['order'] . ' DESC' ) ); + } + else + { + $this->DB->build( array( 'select' => '*', + 'from' => 'core_like', + 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'", + 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), + 'order' => 'like_added DESC' ) ); + } + + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $results[] = $r['like_rel_id']; + + $formatted[ $r['like_id'] ] = $r; + } + + /* Process */ + $results = $this->searchController->fetchFollowedContentOutput( $results, $formatted ); + + $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count, + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue' => IPSSearchRegistry::get('in.start'), + 'baseUrl' => "app=core&module=search&do=followed&search_app=" . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] ) ); + } + else + { + $count = 0; + $results = array(); + } + + /* Output */ + $this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' ); + $this->title = $this->lang->words['followed_ct_title']; + $this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( $results, $pages, $count, $error, $contentTypes ); + } + /** * Builds the advanced search form * * @param string Message - * @return void + * @return @e void */ public function searchAdvancedForm( $msg='', $removed_search_terms=array() ) { @@ -188,17 +440,18 @@ class public_core_search_search extends ipsCommand /* Get any application specific filters */ $appHtml = $this->searchController->getHtml(); $isBoolean = $this->searchController->isBoolean(); + $canTag = ( $this->settings['tags_enabled'] && IPSSearchRegistry::get( 'config.can_searchTags' ) ) ? true : false; /* Output */ $this->title = $this->lang->words['search_form']; $this->registry->output->addNavigation( $this->lang->words['search_form'], '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->searchAdvancedForm( $appHtml, $msg, $this->request['search_app'], $removed_search_terms, $isBoolean ); + $this->output .= $this->registry->output->getTemplate( 'search' )->searchAdvancedForm( $appHtml, $msg, $this->request['search_app'], $removed_search_terms, $isBoolean, $canTag ); } /** * Processes a search request * - * @return void + * @return @e void */ public function searchResults() { @@ -228,10 +481,11 @@ class public_core_search_search extends ipsCommand IPSSearchRegistry::set('in.search_app' , $this->request['search_app'] ); IPSSearchRegistry::set('in.raw_search_term' , trim( $this->request['search_term'] ) ); IPSSearchRegistry::set('in.clean_search_term', $search_term ); + IPSSearchRegistry::set('in.raw_search_tags' , str_replace( '&', '&', trim( IPSText::parseCleanValue( urldecode( $_REQUEST['search_tags'] ) ) ) ) ); IPSSearchRegistry::set('in.search_higlight' , str_replace( '.', '', $this->request['search_term'] ) ); IPSSearchRegistry::set('in.search_date_end' , ( $this->request['search_date_start'] && $this->request['search_date_end'] ) ? $this->request['search_date_end'] : 'now' ); IPSSearchRegistry::set('in.search_date_start', ( $this->request['search_date_start'] ) ? $this->request['search_date_start'] : '' ); - IPSSearchRegistry::set('in.search_author' , ( isset( $this->request['search_author'] ) && $this->request['search_author'] ) ? $this->request['search_author'] : '' ); + IPSSearchRegistry::set('in.search_author' , !empty( $this->request['search_author'] ) ? $this->request['search_author'] : '' ); /* Set sort filters */ $this->_setSortFilters(); @@ -242,8 +496,7 @@ class public_core_search_search extends ipsCommand IPSSearchRegistry::set('set.resultsAsForum' , false ); /* Are we option to show titles only / search in titles only */ - IPSSearchRegistry::set('opt.searchTitleOnly', ( isset( $this->request['content_title_only'] ) && $this->request['content_title_only'] ) ? true : false ); - IPSSearchRegistry::set('display.onlyTitles' , ( ( $this->request['show_as_titles'] AND $this->settings['enable_show_as_titles'] ) OR ( IPSSearchRegistry::get('opt.searchTitleOnly') ) ) ? true : false ); + IPSSearchRegistry::set('opt.searchType', ( !empty( $this->request['search_content'] ) AND in_array( $this->request['search_content'], array( 'both', 'titles', 'content' ) ) ) ? $this->request['search_content'] : 'both' ); /* Time check */ if ( IPSSearchRegistry::get('in.search_date_start') AND strtotime( IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_start')) ) > time() ) @@ -264,17 +517,22 @@ class public_core_search_search extends ipsCommand } /** - * Ok this is an upper limit. - * If you needed to change this, you could do so via conf_global.php by adding: - * $INFO['max_search_word'] = #####; + * Lower limit */ - if ( $this->settings['min_search_word'] && ! IPSSearchRegistry::get('in.search_author') ) + if ( $this->settings['min_search_word'] && ! IPSSearchRegistry::get('in.search_author') && ! IPSSearchRegistry::get('in.raw_search_tags') ) { - $_words = explode( ' ', IPSSearchRegistry::get('in.raw_search_term') ); - $_ok = true; - + $_words = explode( ' ', preg_replace( "#\"(.*?)\"#", '', $search_term ) ); + $_ok = $search_term ? true : false; + foreach( $_words as $_word ) { + $_word = preg_replace( '#^\+(.+?)$#', "\\1", $_word ); + + if( !$_word ) + { + continue; + } + if( strlen( $_word ) < $this->settings['min_search_word'] ) { $_ok = false; @@ -287,8 +545,13 @@ class public_core_search_search extends ipsCommand $this->searchAdvancedForm( sprintf( $this->lang->words['search_term_short'], $this->settings['min_search_word'] ), $removedTerms ); return; } - } + } + /** + * Ok this is an upper limit. + * If you needed to change this, you could do so via conf_global.php by adding: + * $INFO['max_search_word'] = #####; + */ if ( $this->settings['max_search_word'] && strlen( IPSSearchRegistry::get('in.raw_search_term') ) > $this->settings['max_search_word'] ) { $this->searchAdvancedForm( sprintf( $this->lang->words['search_term_long'], $this->settings['max_search_word'] ) ); @@ -327,10 +590,15 @@ class public_core_search_search extends ipsCommand } /* Clean search term for results view */ - $_search_term = trim( preg_replace( "#(^|\s)(\+|\-|\||\~)#", " ", $search_term ) ); + $_search_term = trim( preg_replace( '#(^|\s)(\+|\-|\||\~)#', " ", $search_term ) ); - /* Can we do this? */ - if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'search' ) ) + /* Got tag search only but app doesn't support tags */ + if ( IPSSearchRegistry::get('in.raw_search_tags') && ! IPSSearchRegistry::get( 'config.can_searchTags' ) && ! IPSSearchRegistry::get('in.raw_search_term') ) + { + $count = 0; + $results = array(); + } + else if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'search' ) ) { /* Perform the search */ $this->searchController->search(); @@ -346,21 +614,40 @@ class public_core_search_search extends ipsCommand /* Fetch sort details */ $sortDropDown = $this->searchController->fetchSortDropDown(); + + /* Set default sort option */ + $_a = IPSSearchRegistry::get('in.search_app'); + $_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : ''; + + if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown ); + } + else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown ); + } /* Fetch sort details */ $sortIn = $this->searchController->fetchSortIn(); /* Build pagination */ $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue' => IPSSearchRegistry::get('in.start'), - 'baseUrl' => $this->_buildURLString() . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '' ) ); + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue'=> IPSSearchRegistry::get('in.start'), + 'baseUrl' => $this->_buildURLString() . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '' ) ); /* Showing */ $showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ); /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 ); + $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); + + /* Check for sortIn */ + if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] ) + { + $this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0]; + } } else { @@ -370,7 +657,7 @@ class public_core_search_search extends ipsCommand /* Output */ $this->title = $this->lang->words['search_results']; - $this->output .= $this->registry->output->getTemplate( 'search' )->searchResultsWrapper( $results, $sortDropDown, $sortIn, $links, $count, $showing, $_search_term, $this->_buildURLString(), $this->request['search_app'], $removedTerms, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit') ); + $this->output .= $this->registry->output->getTemplate( 'search' )->searchResultsWrapper( $results, $sortDropDown, $sortIn, $links, $count, $showing, $_search_term, $this->_buildURLString(), $this->request['search_app'], $removedTerms, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), IPSSearchRegistry::get('in.raw_search_tags') ); } /** @@ -401,7 +688,7 @@ class public_core_search_search extends ipsCommand if ( isset( $this->_session['_session_data']['search_app_filters'] ) ) { - $this->request['search_app_filters'] = $this->_session['_session_data']['search_app_filters']; + $this->request['search_app_filters'] = is_array( $this->request['search_app_filters'] ) ? array_merge( $this->_session['_session_data']['search_app_filters'], $this->request['search_app_filters'] ) : $this->_session['_session_data']['search_app_filters']; } } @@ -457,7 +744,7 @@ class public_core_search_search extends ipsCommand /** * Set the search order and key * - * @return void + * @return @e void */ protected function _setSortFilters() { @@ -494,76 +781,41 @@ class public_core_search_search extends ipsCommand $dir = $this->request['search_sort_order']; } } - + /* Numeric? */ if ( is_numeric( $dir ) ) { $dir = ( $dir == 0 ) ? 'desc' : 'asc'; } + else + { + $dir = 'desc'; + } IPSSearchRegistry::set('in.search_sort_by' , trim( $key ) ); IPSSearchRegistry::set('in.search_sort_order', ( $dir != 'desc' ) ? 'asc' : 'desc' ); } - /** - * Displays the active topics screen - * - * @return void - */ - public function activeContent() - { - IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); - IPSSearchRegistry::set('in.period' , ( empty( $this->request['period'] ) ) ? 'today' : $this->request['period'] ); - - /* Can we do this? */ - if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'active' ) ) - { - /* Perform the search */ - $this->searchController->viewActiveContent(); - - /* Get count */ - $count = $this->searchController->getResultCount(); - - /* Get results which will be array of IDs */ - $results = $this->searchController->getResultSet(); - - /* Get templates to use */ - $template = $this->searchController->fetchTemplates(); - - /* Fetch sort details */ - $sortIn = $this->searchController->fetchSortIn(); - - /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 ); - - /* Build pagination */ - $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue' => IPSSearchRegistry::get('in.start'), - 'baseUrl' => 'app=core&module=search&do=active&period=' . IPSSearchRegistry::get('in.period') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] ) ); - } - else - { - $count = 0; - $results = array(); - } - - /* Output */ - $this->title = $this->lang->words['active_posts_title']; - $this->registry->output->addNavigation( $this->lang->words['active_posts_title'], '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->activePostsView( $results, $links, $count, $sortIn ); - } - /** * Displays latest user content * - * @return void + * @return @e void */ public function viewUserContent() { /* INIT */ $id = $this->request['mid'] ? intval( trim( $this->request['mid'] ) ) : $this->memberData['member_id']; - $member = IPSMember::load( $id, 'core' ); + + /* Save query if we are viewing our own content */ + if( $this->memberData['member_id'] AND $id == $this->memberData['member_id'] ) + { + $member = $this->memberData; + } + else + { + $member = IPSMember::load( $id, 'core' ); + } + $beginStamp = 0; if ( ! $member['member_id'] ) @@ -571,11 +823,16 @@ class public_core_search_search extends ipsCommand $this->registry->output->showError( 'search_invalid_id', 10147, null, null, 403 ); } + $this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : 'all'; + IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); - IPSSearchRegistry::set('in.userMode' , ( $this->request['userMode'] ) ? $this->request['userMode'] : 'all' ); + IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] ); + + /* Set sort filters */ + $this->_setSortFilters(); /* Can we do this? */ - if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'usercontent' ) ) + if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'usercontent' ) ) { /* Perform the search */ $this->searchController->viewUserContent( $member ); @@ -589,17 +846,38 @@ class public_core_search_search extends ipsCommand /* Get templates to use */ $template = $this->searchController->fetchTemplates(); + /* Fetch sort details */ + $sortDropDown = $this->searchController->fetchSortDropDown(); + + /* Set default sort option */ + $_a = IPSSearchRegistry::get('in.search_app'); + $_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : ''; + + if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown ); + } + else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown ); + } + /* Fetch sort details */ $sortIn = $this->searchController->fetchSortIn(); + /* Reset for template */ + $this->_resetRequestParameters(); + /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 ); + $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); /* Build pagination */ $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), 'currentStartValue' => IPSSearchRegistry::get('in.start'), - 'baseUrl' => 'app=core&module=search&do=user_activity&mid=' . $id . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&sid=' . $this->request['_sid'] ) ); + 'baseUrl' => 'app=core&module=search&do=user_activity&mid=' . $id . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&sid=' . $this->request['_sid'] . + '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey'] . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][sortKey]=' . + $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['sortKey'] . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][sortDir]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['sortDir'] ) ); } else { @@ -609,21 +887,67 @@ class public_core_search_search extends ipsCommand $this->title = sprintf( $this->lang->words['s_participation_title'], $member['members_display_name'] ); $this->registry->output->addNavigation( $this->title, '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->userPostsView( $results, $links, $count, $member, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), $beginStamp, $sortIn ); + $this->output .= $this->registry->output->getTemplate( 'search' )->userPostsView( $results, $links, $count, $member, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), $beginStamp, $sortIn, $sortDropDown ); } /** * View new posts since your last visit * - * @return void + * @return @e void */ - public function viewNewPosts() + public function viewNewContent() { IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); - /* Can we do this? */ - if ( IPSLib::appisSearchable( IPSSearchRegistry::get('in.search_app'), 'vnc' ) ) + /* Fetch member cache to see if we have a value set */ + $vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' ); + + /* Guests */ + if ( ! $this->memberData['member_id'] AND ( !$this->request['period'] OR $this->request['period'] == 'unread' ) ) { + $this->request['period'] = 'today'; + } + + /* In period */ + if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['period'] ) ) + { + $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] = ( ! empty( $this->request['period'] ) ) ? $this->request['period'] : $this->settings['default_vnc_method']; + } + + /* Follow filter enabled */ + if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['followedItemsOnly'] ) ) + { + $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] = ( ! empty( $this->request['followedItemsOnly'] ) ) ? 1 : 0; + } + + /* Filtering VNC by forum? */ + IPSSearchRegistry::set('forums.vncForumFilters', $vncPrefs['forums']['vnc_forum_filter'] ); + + /* Set period up */ + IPSSearchRegistry::set('in.period' , $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ); + IPSSearchRegistry::set('in.vncFollowFilterOn', $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] ); + + $this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : ''; + IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] ); + + /* Update member cache */ + if ( isset( $this->request['period'] ) ) + { + IPSMember::setToMemberCache( $this->memberData, array( 'vncPrefs' => $vncPrefs ) ); + } + + IPSDebug::addMessage( var_export( $vncPrefs, true ) ); + IPSDebug::addMessage( 'Using: ' . IPSSearchRegistry::get('in.period') ); + + /* Can we do this? */ + if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vnc' ) || IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'active' ) ) + { + /* Can't do a specific unread search, so */ + if ( IPSSearchRegistry::get('in.period') == 'unread' && ! IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vncWithUnreadContent' ) ) + { + IPSSearchRegistry::set( 'in.period', 'lastvisit' ); + } + /* Perform the search */ $this->searchController->viewNewContent(); @@ -642,14 +966,26 @@ class public_core_search_search extends ipsCommand /* Fetch sort details */ $sortIn = $this->searchController->fetchSortIn(); + /* Reset for template */ + $this->_resetRequestParameters(); + + if( IPSSearchRegistry::get('in.start') > 0 AND !count($results) ) + { + $new_url = 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid']; + $new_url .= '&st=' . ( IPSSearchRegistry::get('in.start') - IPSSearchRegistry::get('opt.search_per_page') ) . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey']; + + $this->registry->output->silentRedirect( $this->settings['base_url'] . $new_url ); + } + /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('display.onlyTitles') || IPSSearchRegistry::get( 'opt.noPostPreview') ) ? 1 : 0 ); + $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); /* Build pagination */ - $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue' => IPSSearchRegistry::get('in.start'), - 'baseUrl' => 'app=core&module=search&do=new_posts&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid= ' . $this->request['_sid'] ) ); + $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue' => IPSSearchRegistry::get('in.start'), + //'method' => 'nextPrevious', + 'baseUrl' => 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey'] ) ); /* Showing */ $showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ); @@ -660,10 +996,19 @@ class public_core_search_search extends ipsCommand $results = array(); } + /* Add Debug message */ + IPSDebug::addMessage( "View New Content Matches: " . $count ); + + /* Check for sortIn */ + if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] ) + { + $this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0]; + } + /* Output */ $this->title = $this->lang->words['new_posts_title']; $this->registry->output->addNavigation( $this->lang->words['new_posts_title'], '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->newPostsView( $results, $links, $count, $sortDropDown, $sortIn, IPSSearchRegistry::get('set.resultCutToDate') ); + $this->output .= $this->registry->output->getTemplate( 'search' )->newContentView( $results, $links, $count, $sortDropDown, $sortIn, IPSSearchRegistry::get('set.resultCutToDate') ); } @@ -679,27 +1024,31 @@ class public_core_search_search extends ipsCommand $url_string .= '&sid=' . $this->request['_sid']; /* Add author name */ - if( isset( $this->request['search_author'] ) AND $this->request['search_author'] ) + if( !empty( $this->request['search_author'] ) ) { $url_string .= "&search_author=" . urlencode($this->request['search_author']); } - - /* Add titles only */ - if( isset( $this->request['show_as_titles'] ) AND $this->request['show_as_titles'] ) - { - $url_string .= "&show_as_titles={$this->request['show_as_titles']}"; - } - + /* Search Range */ - if( isset( $this->request['search_date_start'] ) AND $this->request['search_date_start'] ) + if( !empty( $this->request['search_date_start'] ) ) { $url_string .= "&search_date_start={$this->request['search_date_start']}"; } - if( isset( $this->request['search_date_end'] ) AND $this->request['search_date_end'] ) + if( !empty( $this->request['search_date_end'] ) ) { $url_string .= "&search_date_end={$this->request['search_date_end']}"; } + + if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey'] ) ) + { + $url_string .= "&search_app_filters[{$this->request['search_app']}][sortKey]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey']; + } + + if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir'] ) ) + { + $url_string .= "&search_app_filters[{$this->request['search_app']}][sortDir]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir']; + } /* Contextual Type */ if ( IPSSearchRegistry::get('contextual.type') ) @@ -708,9 +1057,14 @@ class public_core_search_search extends ipsCommand } /* Content Only */ - if( isset( $this->request['content_title_only'] ) && $this->request['content_title_only'] ) + if( !empty( $this->request['search_content'] ) ) { - $url_string .= "&content_title_only=1"; + $url_string .= "&search_content=" . $this->request['search_content']; + } + + if ( IPSSearchRegistry::get('in.raw_search_tags') ) + { + $url_string .= "&search_tags=" . urlencode( IPSSearchRegistry::get('in.raw_search_tags') ); } /* Types */ @@ -724,6 +1078,30 @@ class public_core_search_search extends ipsCommand $url_string .= "&type_2={$this->request['type_2']}&type_id_2={$this->request['type_id_2']}"; } + if( isset($this->request['search_app_filters']) AND $this->request['search_app_filters'] ) + { + foreach( $this->request['search_app_filters'] as $app => $filters ) + { + if( $app == $this->request['search_app'] AND count($filters) ) + { + foreach( $filters as $_filterKey => $_filterValue ) + { + if( is_array($_filterValue) ) + { + foreach( $_filterValue as $_filterValueKey => $_filterValueValue ) + { + $url_string .= "&search_app_filters[{$app}][{$_filterKey}][{$_filterValueKey}]={$_filterValueValue}"; + } + } + else + { + $url_string .= "&search_app_filters[{$app}][{$_filterKey}]={$_filterValue}"; + } + } + } + } + } + /* Fix up the search term a bit */ $_search_term = str_replace( '&', '&', $this->request['search_term'] ); $_search_term = str_replace( '"', '"', $_search_term ); @@ -739,7 +1117,7 @@ class public_core_search_search extends ipsCommand /** * Checks to see if the logged in user is allowed to use the search system * - * @return void + * @return @e void */ protected function _canSearch() { @@ -772,5 +1150,17 @@ class public_core_search_search extends ipsCommand $this->registry->output->showError( 'no_permission_to_search', 10146, null, null, 403 ); } } - } + } + + /** + * Resets params for template + */ + protected function _resetRequestParameters() + { + $this->request['period'] = IPSSearchRegistry::get('in.period'); + $this->request['search_app'] = IPSSearchRegistry::get('in.search_app'); + $this->request['vncFollowFilterOn'] = IPSSearchRegistry::get('in.vncFollowFilterOn'); + $this->request['followedItemsOnly'] = IPSSearchRegistry::get('in.vncFollowFilterOn'); + } + } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/task/index.html b/upload/admin/applications/core/modules_public/task/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/task/index.html +++ b/upload/admin/applications/core/modules_public/task/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/task/manualResolver.php b/upload/admin/applications/core/modules_public/task/manualResolver.php index daedf07a..2389332f 100644 --- a/upload/admin/applications/core/modules_public/task/manualResolver.php +++ b/upload/admin/applications/core/modules_public/task/manualResolver.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * Task Manager
    - * Last Updated: $Date: 2010-07-12 18:26:09 -0400 (Mon, 12 Jul 2010) $
    + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 6635 $ + * @link http://hatynka.in + * @version $Rev: 8644 $ * */ @@ -28,9 +28,8 @@ class public_core_task_manualResolver extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -38,8 +37,8 @@ class public_core_task_manualResolver extends ipsCommand // Require and run //----------------------------------------- - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' ); - $functions = new $classToLoad( $registry ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_taskmanager.php', 'class_taskmanager' );/*noLibHook*/ + $functions = new $classToLoad( $registry ); //----------------------------------------- // Check shutdown functions diff --git a/upload/admin/applications/core/modules_public/usercp/index.html b/upload/admin/applications/core/modules_public/usercp/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/modules_public/usercp/index.html +++ b/upload/admin/applications/core/modules_public/usercp/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/usercp/manualResolver.php b/upload/admin/applications/core/modules_public/usercp/manualResolver.php index 9a593b76..0f955fad 100644 --- a/upload/admin/applications/core/modules_public/usercp/manualResolver.php +++ b/upload/admin/applications/core/modules_public/usercp/manualResolver.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * User control panel resolver
    - * Last Updated: $Date: 2010-10-21 14:02:34 -0400 (Thu, 21 Oct 2010) $
    + * Last Updated: $Date: 2011-06-09 18:03:22 -0400 (Thu, 09 Jun 2011) $
      * 
    * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since 1st march 2002 - * @version $Revision: 7011 $ + * @version $Revision: 9021 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -32,7 +32,6 @@ class public_core_usercp_manualResolver extends ipsCommand /** * Page Title set by sub classes * - * @access protected * @var string */ protected $_pageTitle; @@ -40,7 +39,6 @@ class public_core_usercp_manualResolver extends ipsCommand /** * Navigation array set by sub classes * - * @access protected * @var array */ protected $_nav = array(); @@ -48,9 +46,8 @@ class public_core_usercp_manualResolver extends ipsCommand /** * Main class entry point * - * @access public * @param object ipsRegistry reference - * @return void [Outputs to screen] + * @return @e void [Outputs to screen] */ public function doExecute( ipsRegistry $registry ) { @@ -101,9 +98,9 @@ class public_core_usercp_manualResolver extends ipsCommand IPSLib::loadInterface( 'interface_usercp.php' ); - $EXT_DIR = IPSLib::getAppDir( $_TAB ) . '/extensions'; + $EXT_DIR = IPSLib::getAppDir( $_TAB ) . '/extensions'; - if ( ! file_exists($EXT_DIR . '/usercpForms.php') ) + if ( ! is_file($EXT_DIR . '/usercpForms.php') ) { $this->registry->getClass('output')->showError( 'usercp_bad_tab', 10147 ); exit(); @@ -113,24 +110,25 @@ class public_core_usercp_manualResolver extends ipsCommand // Cycle through applications and load // usercpForm extensions //----------------------------------------- - foreach( ipsRegistry::$applications as $app_dir => $app_data ) + foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data ) { - // Check that the application is installed. - if ( !IPSLib::appIsInstalled( $app_dir ) ) - { - continue; - } - $ext_dir = IPSLib::getAppDir( $app_dir ) . '/extensions'; // Make sure the extension exists - if ( !file_exists( $ext_dir . '/usercpForms.php' ) ) + if ( !is_file( $ext_dir . '/usercpForms.php' ) ) { continue; } $__class = IPSLib::loadLibrary( $ext_dir . '/usercpForms.php', 'usercpForms_' . $app_dir, $app_dir ); $_usercp_module = new $__class(); + + /* Block based on version to prevent old files showing up/causing an error */ + if( !$_usercp_module->version OR $_usercp_module->version < 32 ) + { + continue; + } + $_usercp_module->makeRegistryShortcuts( $this->registry ); if ( is_callable( array( $_usercp_module, 'init' ) ) ) @@ -149,17 +147,21 @@ class public_core_usercp_manualResolver extends ipsCommand if ( is_callable( array( $_usercp_module, 'getLinks' ) ) ) { - $tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $app_dir ); $tabs[ $app_dir ]['_menu'] = $_usercp_module->getLinks(); - - if ( ! $tabs[ $app_dir ]['_menu'] ) + + /* Got any links? */ + if ( !is_array($tabs[ $app_dir ]['_menu']) || !count($tabs[ $app_dir ]['_menu']) ) { unset( $tabs[ $app_dir ] ); + continue; } - + + /* Get title */ + $tabs[ $app_dir ]['_name'] = $_usercp_module->tab_name ? $_usercp_module->tab_name : IPSLib::getAppTitle( $app_dir ); + /* Add in 'last' element */ $tabs[ $app_dir ]['_menu'][ count( $tabs[ $app_dir ]['_menu'] ) - 1 ]['last'] = 1; - + /* This nav? */ if ( ! count( $_thisNav ) AND $app_dir == $_TAB ) { @@ -276,7 +278,7 @@ class public_core_usercp_manualResolver extends ipsCommand // Pass to CP output hander //----------------------------------------- - $this->registry->getClass('output')->setTitle( ( $this->_pageTitle ) ? $this->settings['board_name'] . " {$this->lang->words['pagetitle_bit']} : " . $this->_pageTitle : $this->settings['board_name'] . " {$this->lang->words['pagetitle_bit']}" ); + $this->registry->getClass('output')->setTitle( ( $this->_pageTitle ) ? "{$this->lang->words['pagetitle_bit']} : " . $this->_pageTitle . ' - ' . $this->settings['board_name'] : "{$this->lang->words['pagetitle_bit']} - " . $this->settings['board_name'] ); $this->registry->getClass('output')->addContent( $template ); if ( is_array( $this->_nav ) AND count( $this->_nav ) ) diff --git a/upload/admin/applications/core/setup/index.html b/upload/admin/applications/core/setup/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/setup/index.html +++ b/upload/admin/applications/core/setup/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/index.html b/upload/admin/applications/core/setup/versions/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/setup/versions/index.html +++ b/upload/admin/applications/core/setup/versions/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/install/index.html b/upload/admin/applications/core/setup/versions/install/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/setup/versions/install/index.html +++ b/upload/admin/applications/core/setup/versions/install/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/install/knownSettings.php b/upload/admin/applications/core/setup/versions/install/knownSettings.php index 8e601775..9869b4e9 100644 --- a/upload/admin/applications/core/setup/versions/install/knownSettings.php +++ b/upload/admin/applications/core/setup/versions/install/knownSettings.php @@ -17,9 +17,16 @@ $knownSettings = array( 'email_in' => IPSSetUp::getSavedData('admin_email'), 'email_out' => IPSSetUp::getSavedData('admin_email'), 'base_dir' => IPSSetUp::getSavedData('install_dir'), - 'css_cache_url' => IPSSetUp::getSavedData('install_url') . '/public/style_images', + 'css_cache_url' => IPSSetUp::getSavedData('install_url') . PUBLIC_DIRECTORY . '/style_images', 'upload_url' => IPSSetUp::getSavedData('install_url') . '/uploads', 'upload_dir' => IPSSetUp::getSavedData('install_dir') . '/uploads', 'search_sql_method' => ipsRegistry::DB()->checkFulltextSupport() ? 'ftext' : 'man', 'safe_mode_skins' => ( @ini_get("safe_mode") ) ? 1 : 0, -); \ No newline at end of file + 'ipb_reg_number' => IPSSetUp::getSavedData('lkey'), +); + +/* Minify requires.. */ +if( !function_exists('gzencode') ) +{ + $knownSettings['use_minify'] = 0; +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/install/sql/core_mysql_fulltext.php b/upload/admin/applications/core/setup/versions/install/sql/core_mysql_fulltext.php deleted file mode 100644 index c6f3e7b7..00000000 --- a/upload/admin/applications/core/setup/versions/install/sql/core_mysql_fulltext.php +++ /dev/null @@ -1,5 +0,0 @@ - You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_10002/index.html b/upload/admin/applications/core/setup/versions/upg_10002/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_10002/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php b/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php index cca0b7d1..90b43b07 100644 --- a/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php +++ b/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php @@ -2,15 +2,15 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.1.2 +| IP.Board v3.2.3 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services -| http://www.invisionpower.com +| http://hatynka.in | ======================================== -| Web: http://www.invisionboard.com -| Email: matt@invisionpower.com -| Licence Info: http://www.invisionboard.com/?license +| Web: http://hatynka.in +| Email: info@hatynka.in +| Licence Info: This is NULLED! +--------------------------------------------------------------------------- | | > IPB UPGRADE 1.1 -> 2.0 SQL STUFF! @@ -25,17 +25,15 @@ class version_upgrade /** * Custom HTML to show * - * @access private * @var string */ - private $_output = ''; + protected $_output = ''; /** - * fetchs output - * - * @access public - * @return string - */ + * fetchs output + * + * @return string + */ public function fetchOutput() { return $this->_output; @@ -44,9 +42,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -143,7 +140,7 @@ class version_upgrade } if ( $this->request['workact'] ) { - IPSSetUp::getSavedData('vid', $this->install->current_version ); + IPSSetUp::setSavedData('vid', $this->install->current_version ); return false; } @@ -1065,7 +1062,7 @@ class version_upgrade 'rules_text' => $r['rules_text'], 'notify_modq_emails' => $r['notify_modq_emails'], 'permission_array' => $perm_array, - 'permission_showtopic' => '', + 'permission_showtopic' => 1, 'permission_custom_error' => '', ) ); } @@ -1179,7 +1176,6 @@ class version_upgrade 'attach_pid' => $r['pid'], 'attach_post_key' => $postkey, 'attach_member_id' => $r['author_id'], - 'attach_approved' => 1, 'attach_filesize' => @filesize( IPS_ROOT_PATH.'uploads/'.$r['attach_id'] ), ) ); @@ -1412,9 +1408,9 @@ class version_upgrade { // Reset loginkey - IPSSetUp::getSavedData('loginkey', $member_login_key ); + IPSSetUp::setSavedData('loginkey', $member_login_key ); $this->install->ipsclass->member['member_login_key'] = $member_login_key; - IPSSetUp::getSavedData('securekey', $this->install->ipsclass->return_md5_check() ); + IPSSetUp::setSavedData('securekey', $this->install->ipsclass->return_md5_check() ); } } @@ -1874,8 +1870,8 @@ class version_upgrade $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."cache_store (cs_key, cs_value, cs_extra, cs_array) VALUES ('calendar', 'a:0:{}', '', 1);"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (1, 'IPB Master Skin Set', '1', 0, 0, '0', -1, '', '', '', '', '', '', 1079109298, '', '', 'default');"; - //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; - $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; + //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; + $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."conf_settings_titles (conf_title_id, conf_title_title, conf_title_desc, conf_title_count) VALUES (1, 'General Configuration', 'These settings control the basics of the board such as URLs and paths.', 17);"; @@ -1906,7 +1902,7 @@ class version_upgrade $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (1, 'Registration benefits', 'To be able to use all the features on this board, the administrator will probably require that you register for a member account. Registration is free and only takes a moment to complete.\r
    \r
    During registration, the administrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering. If your e-mail does not arrive, then on the member bar at the top of the page, there will be a link that will allow you to re-send the validation e-mail. \r
    \r
    In some cases, the administrator will need to approve your registration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your personal messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', 'How to register and the added benefits of being a registered member.');"; - $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.test.ru/forums/index.php\' you would enter \'test.ru\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.test.ru/forums/index.php\' look for \'test.ru\' or \'www.test.ru\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.');"; + $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.invisionboard.com/forums/index.php\' you would enter \'invisionboard.com\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.invisionboard.com/forums/index.php\' look for \'invisionboard.com\' or \'www.invisionboard.com\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.');"; $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (3, 'Recovering lost or forgotten passwords', 'Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r
    This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r
    \r
    To do this, click on the Lost Password link found on the log in page.\r
    \r
    Further instruction is available from there.', 'How to reset your password if you\'ve forgotton it.');"; $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (4, 'Your Control Panel (My Controls)', 'Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Subscriptions\r
    \r
    This is where you manage your topic and forums subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Change Personal Photo\r
    \r
    This section will allow you to add a photograph to your profile. This will be displayed when a user clicks to view your profile, on the mini-profile screen and will also be linked to from the member list.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    Send a confirmation email when I receive a new private message, this will send you an e-mail notification to your registered e-mail address each time you receive a private message on the board.\r
    Enable \'Email Notification\' by default?, this will automatically subscribe you to any topic that you make a reply to. You may unsubscribe from the \'Subscriptions\' section of My Controls if you wish.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your time zone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and choose to show or hide the \'Fast Reply\' box where it is enabled.\r
    You are also able to choose display preferences for the number of topics/posts shown per page on the board.\r
    \r
    Skins and Languages\r
    \r
    If available, you can choose a skin style and language choice. This affects how the board is displayed so you may wish to preview the skin before submitting the form.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.', 'Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.');"; $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (5, 'Email Notification of new messages', 'This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r
    \r
    There are three ways to subscribe to a topic:\r
    \r
  • Click the \'Track This Topic\' link at the top of the topic that you wish to track\r
  • On the posting screen when replying to or creating a topic, check the \'Enable email notification of replies?\' checkbox\r
  • From the E-Mail settings section of your User CP (My Controls) check the \'Enable Email Notification by default?\' option, this will automatically subscribe you to any topic that you make a reply to\r
    \r
    Please note that to avoid multiple emails being sent to your email address, you will only get one e-mail for each topic you are subscribed to until the next time you visit the board.\r
    \r
    You are also able to subscribe to each individual forum on the board, to be notified when a new topic is created in that particular forum. To enable this, click the \'Subscribe to this forum\' link at the bottom of the forum that you wish to subscribe to.\r
    \r
    To unsubscribe from any forums or topics that you are subscribed to - just go to the \'Subscriptions\' section of \'My Controls\' and you can do this from there.', 'How to get emailed when a new reply is added to a topic.');"; diff --git a/upload/admin/applications/core/setup/versions/upg_10004/index.html b/upload/admin/applications/core/setup/versions/upg_10004/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_10004/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php b/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php index b4f7f4d1..187ea769 100644 --- a/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php +++ b/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php @@ -2,15 +2,15 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.1.2 +| IP.Board v3.2.3 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services -| http://www.invisionpower.com +| http://hatynka.in | ======================================== -| Web: http://www.invisionboard.com -| Email: matt@invisionpower.com -| Licence Info: http://www.invisionboard.com/?license +| Web: http://hatynka.in +| Email: info@hatynka.in +| Licence Info: This is NULLED! +--------------------------------------------------------------------------- | | > IPB UPGRADE 1.1 -> 2.0 SQL STUFF! @@ -25,17 +25,15 @@ class version_upgrade /** * Custom HTML to show * - * @access private * @var string */ - private $_output = ''; + protected $_output = ''; /** - * fetchs output - * - * @access public - * @return string - */ + * fetchs output + * + * @return string + */ public function fetchOutput() { return $this->_output; @@ -44,9 +42,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -826,7 +823,7 @@ class version_upgrade 'rules_text' => $r['rules_text'], 'notify_modq_emails' => $r['notify_modq_emails'], 'permission_array' => $perm_array, - 'permission_showtopic' => '', + 'permission_showtopic' => 1, 'permission_custom_error' => '', ) ); } @@ -940,7 +937,6 @@ class version_upgrade 'attach_pid' => $r['pid'], 'attach_post_key' => $postkey, 'attach_member_id' => $r['author_id'], - 'attach_approved' => 1, 'attach_filesize' => @filesize( DOC_IPS_ROOT_PATH.'uploads/'.$r['attach_id'] ), ) ); @@ -1660,8 +1656,8 @@ class version_upgrade $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."cache_store (cs_key, cs_value, cs_extra, cs_array) VALUES ('calendar', 'a:0:{}', '', 1);"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (1, 'IPB Master Skin Set', '1', 0, 0, '0', -1, '', '', '', '', '', '', 1079109298, '', '', 'default');"; - //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; - $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; + //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; + $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."conf_settings_titles (conf_title_id, conf_title_title, conf_title_desc, conf_title_count) VALUES (1, 'General Configuration', 'These settings control the basics of the board such as URLs and paths.', 17);"; diff --git a/upload/admin/applications/core/setup/versions/upg_20004/index.html b/upload/admin/applications/core/setup/versions/upg_20004/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_20004/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php index 86ef875d..8d661411 100644 --- a/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php @@ -2,15 +2,15 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.1.2 +| IP.Board v3.2.3 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services -| http://www.invisionpower.com +| http://hatynka.in | ======================================== -| Web: http://www.invisionboard.com -| Email: matt@invisionpower.com -| Licence Info: http://www.invisionboard.com/?license +| Web: http://hatynka.in +| Email: info@hatynka.in +| Licence Info: This is NULLED! +--------------------------------------------------------------------------- | | > IPB UPGRADE MODULE:: IPB 2.0.0 PDR1 -> PDR 2 diff --git a/upload/admin/applications/core/setup/versions/upg_20005/index.html b/upload/admin/applications/core/setup/versions/upg_20005/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_20005/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php index 44337dba..925397e4 100644 --- a/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php @@ -2,15 +2,15 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.1.2 +| IP.Board v3.2.3 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services -| http://www.invisionpower.com +| http://hatynka.in | ======================================== -| Web: http://www.invisionboard.com -| Email: matt@invisionpower.com -| Licence Info: http://www.invisionboard.com/?license +| Web: http://hatynka.in +| Email: info@hatynka.in +| Licence Info: This is NULLED! +--------------------------------------------------------------------------- | | > IPB UPGRADE MODULE:: IPB 2.0.0 PDR1 -> PDR 2 diff --git a/upload/admin/applications/core/setup/versions/upg_20007/index.html b/upload/admin/applications/core/setup/versions/upg_20007/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_20007/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php index 648394c0..d3d83a2a 100644 --- a/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php @@ -2,15 +2,15 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.1.2 +| IP.Board v3.2.3 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services -| http://www.invisionpower.com +| http://hatynka.in | ======================================== -| Web: http://www.invisionboard.com -| Email: matt@invisionpower.com -| Licence Info: http://www.invisionboard.com/?license +| Web: http://hatynka.in +| Email: info@hatynka.in +| Licence Info: This is NULLED! +--------------------------------------------------------------------------- | | > IPB UPGRADE MODULE:: IPB 2.0.0 PF1 -> PF 2 diff --git a/upload/admin/applications/core/setup/versions/upg_20009/index.html b/upload/admin/applications/core/setup/versions/upg_20009/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_20009/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php index b44f64aa..4af90c8a 100644 --- a/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php index 91e412b4..4731d9a2 100644 --- a/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php index af46de01..979cccf5 100644 --- a/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php @@ -1,30 +1,35 @@ checkForField( 'has_blog', 'members' ) ) +{ + $SQL[] = "ALTER TABLE members add has_blog TINYINT(1) NOT NULL default '0';"; +} # Efficiency -$SQL[] = "ALTER TABLE members_converge ADD INDEX converge_email(converge_email)"; -$SQL[] = "ALTER TABLE polls ADD INDEX tid(tid)"; +$SQL[] = "ALTER TABLE members_converge ADD INDEX converge_email(converge_email);"; +$SQL[] = "ALTER TABLE polls ADD INDEX tid(tid);"; diff --git a/upload/admin/applications/core/setup/versions/upg_21003/index.html b/upload/admin/applications/core/setup/versions/upg_21003/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_21003/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php index 3b9983e3..9e606d6c 100644 --- a/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php @@ -1,15 +1,15 @@ , '', 'a:3:{s:9:\"perm_read\";s:1:\"*\";s:9:\"perm_post\";s:3:\"4,3\";s:10:\"perm_nomod\";s:0:\"\";}');"; $SQL[] = "INSERT INTO login_methods (login_id, login_title, login_description, login_folder_name, login_maintain_url, login_register_url, login_type, login_alt_login_html, login_date, login_settings, login_enabled, login_safemode, login_installed, login_replace_form, login_allow_create) VALUES (1, 'IPB Internal', 'The standard method of authentication', 'internal', '', '', 'passthrough', '', <%time%>, 0, 1, 1, 1, 0, 1);"; $SQL[] = "INSERT INTO login_methods (login_id, login_title, login_description, login_folder_name, login_maintain_url, login_register_url, login_type, login_alt_login_html, login_date, login_settings, login_enabled, login_safemode, login_installed, login_replace_form, login_allow_create) VALUES (2, 'LDAP Authentication', 'LDAP / Active Directory Authentication', 'ldap', '', '', 'passthrough', '', <%time%>, 0, 0, 1, 0, 0, 1);"; $SQL[] = "INSERT INTO login_methods (login_id, login_title, login_description, login_folder_name, login_maintain_url, login_register_url, login_type, login_alt_login_html, login_date, login_settings, login_enabled, login_safemode, login_installed, login_replace_form, login_allow_create) VALUES (3, 'External Database', 'Authentication via an external database', 'external', '', '', 'passthrough', '', <%time%>, 0, 0, 1, 0, 0, 1);"; -$SQL[] = "INSERT INTO task_manager VALUES ('', 'Update Topic Views Counter', 'updateviews.php', <%time%>, -1, -1, 3, -1, 'ddce954b5ba1c163bc627ca20725b595', 0, 'Used when topic views are not incremented immediately', 1, 'updateviews', 0, 0);"; -$SQL[] = "INSERT INTO task_manager VALUES ('', 'Subscription Expiration Notification', 'expiresubs.php', <%time%>, -1, -1, 1, 0, '21fa5f52cf9122c6fe940e1c6dac0b5a', 1, 'Sends out an email to all members who have a subscription due to expire', 1, 'expiresubs', 0, 0);"; -$SQL[] = "INSERT INTO task_manager VALUES ('', 'RSS Import Update', 'rssimport.php', <%time%>, -1, -1, -1, 30, '8f17dc0ba334e5f18e762f154365a578', 0, 'Imports any new RSS articles', 1, 'rssimport', 1, 0);"; +$SQL[] = "INSERT INTO task_manager (task_title, task_file, task_next_run, task_week_day, task_month_day, task_hour, task_minute, task_cronkey, task_log, task_description, task_enabled, task_key, task_safemode) VALUES ('Update Topic Views Counter', 'updateviews.php', <%time%>, -1, -1, 3, -1, 'ddce954b5ba1c163bc627ca20725b595', 0, 'Used when topic views are not incremented immediately', 1, 'updateviews', 0);"; +$SQL[] = "INSERT INTO task_manager (task_title, task_file, task_next_run, task_week_day, task_month_day, task_hour, task_minute, task_cronkey, task_log, task_description, task_enabled, task_key, task_safemode) VALUES ('Subscription Expiration Notification', 'expiresubs.php', <%time%>, -1, -1, 1, 0, '21fa5f52cf9122c6fe940e1c6dac0b5a', 1, 'Sends out an email to all members who have a subscription due to expire', 1, 'expiresubs', 0);"; +$SQL[] = "INSERT INTO task_manager (task_title, task_file, task_next_run, task_week_day, task_month_day, task_hour, task_minute, task_cronkey, task_log, task_description, task_enabled, task_key, task_safemode) VALUES ('RSS Import Update', 'rssimport.php', <%time%>, -1, -1, -1, 30, '8f17dc0ba334e5f18e762f154365a578', 0, 'Imports any new RSS articles', 1, 'rssimport', 1);"; $SQL[] = "INSERT INTO task_manager (task_title, task_file, task_next_run, task_week_day, task_month_day, task_hour, task_minute, task_cronkey, task_log, task_description, task_enabled, task_key, task_safemode) VALUES ('Expire Paid Subscriptions', 'doexpiresubs.php', 1121212800, -1, -1, 0, 0, 'bb57399ea05eb9240b42d5d5f53575fb', 1, 'Unsubscribes members from their subscribed packages', 1, 'doexpiresubs', 1)"; -$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (1, 'Invision Gallery', 'Invision Power Services', '', '1.3.0', 1113309894, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 0, 1, 'gallery', 'gallery', 'Complete gallery system for your members', '{ipb.lang[\'gallery\']}', '{ipb.base_url}act=module&module=gallery', 1);"; -$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (2, 'Invision Community Blog', 'Invision Power Services', '', '1.1.2', 1113310263, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 0, 1, 'blog', 'blog', 'Blogging addition for your members', '{ipb.lang[\'blog\']}', '{ipb.base_url}automodule=blog', -1);"; -$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (3, 'Invision Chat (ParaChat)', 'Invision Power Services', '', '2.1', 1113313895, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 0, 1, 'chatpara', 'chatpara', 'Full real-time chat system for your members', '{ipb.lang[\'live_chat\']}', '{ipb.base_url}autocom=chatpara', 2);"; -$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (4, 'Invision Copyright Removal', 'Invision Power Services', '', '2.1', 1113314009, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 1, 1, 'copyright', 'copyright', 'Allows the copyright notices to be removed from the board\'s output', '', '', 3);"; +$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (1, 'Invision Gallery', 'Invision Power Services', 'http://www.invisiongallery.com', '1.3.0', 1113309894, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 0, 1, 'gallery', 'gallery', 'Complete gallery system for your members', '{ipb.lang[\'gallery\']}', '{ipb.base_url}act=module&module=gallery', 1);"; +$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (2, 'Invision Community Blog', 'Invision Power Services', 'http://www.invisionblog.com', '1.1.2', 1113310263, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 0, 1, 'blog', 'blog', 'Blogging addition for your members', '{ipb.lang[\'blog\']}', '{ipb.base_url}automodule=blog', -1);"; +$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (3, 'Invision Chat (ParaChat)', 'Invision Power Services', 'http://chat.invisionsitetools.com', '2.1', 1113313895, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 0, 1, 'chatpara', 'chatpara', 'Full real-time chat system for your members', '{ipb.lang[\'live_chat\']}', '{ipb.base_url}autocom=chatpara', 2);"; +$SQL[] = "INSERT INTO components (com_id, com_title, com_author, com_url, com_version, com_date_added, com_menu_data, com_enabled, com_safemode, com_section, com_filename, com_description, com_url_title, com_url_uri, com_position) VALUES (4, 'Invision Copyright Removal', 'Invision Power Services', 'http://www.invisionboard.com', '2.1', 1113314009, 'a:1:{i:1;a:5:{s:9:\"menu_text\";s:24:\"Purchase and Information\";s:8:\"menu_url\";s:9:\"code=show\";s:13:\"menu_redirect\";i:0;s:12:\"menu_permbit\";s:0:\"\";s:13:\"menu_permlang\";s:0:\"\";}}', 1, 1, 'copyright', 'copyright', 'Allows the copyright notices to be removed from the board\'s output', '', '', 3);"; $SQL[] = "DELETE FROM conf_settings WHERE conf_key IN ( 'csite_article_forum' , 'csite_article_max', 'csite_article_recent_on', 'csite_article_recent_max', 'csite_article_len', 'csite_discuss_on', @@ -43,12 +41,12 @@ $SQL[] = "DELETE FROM conf_settings WHERE conf_key IN ( 'csite_article_forum' 'csite_online_show', 'poll_disable_noreply' );"; # UPDATE KNOWN CONF_TITLE KEYS -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='general' WHERE conf_title_id=1"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='boardoffline' WHERE conf_title_id=15"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='calendar' WHERE conf_title_id=9"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='converge' WHERE conf_title_id=18"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='coppa' WHERE conf_title_id=8"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='cpusaving' WHERE conf_title_id=2"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='date' WHERE conf_title_id=3"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='email' WHERE conf_title_id=12"; -$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='searchsetup' WHERE conf_title_id=19"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='general' WHERE conf_title_id=1;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='boardoffline' WHERE conf_title_id=15;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='calendar' WHERE conf_title_id=9;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='converge' WHERE conf_title_id=18;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='coppa' WHERE conf_title_id=8;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='cpusaving' WHERE conf_title_id=2;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='date' WHERE conf_title_id=3;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='email' WHERE conf_title_id=12;"; +$SQL[] = "UPDATE conf_settings_titles SET conf_title_keyword='searchsetup' WHERE conf_title_id=19;"; diff --git a/upload/admin/applications/core/setup/versions/upg_21003/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_21003/version_upgrade.php index a562c3cb..a8867564 100644 --- a/upload/admin/applications/core/setup/versions/upg_21003/version_upgrade.php +++ b/upload/admin/applications/core/setup/versions/upg_21003/version_upgrade.php @@ -2,15 +2,15 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.1.2 +| IP.Board v3.2.3 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services -| http://www.invisionpower.com +| http://hatynka.in | ======================================== -| Web: http://www.invisionboard.com -| Email: matt@invisionpower.com -| Licence Info: http://www.invisionboard.com/?license +| Web: http://hatynka.in +| Email: info@hatynka.in +| Licence Info: This is NULLED! +--------------------------------------------------------------------------- | | > IPB UPGRADE MODULE:: IPB 2.0.2 -> IPB 2.0.3 @@ -32,17 +32,15 @@ class version_upgrade /** * Custom HTML to show * - * @access private * @var string */ - private $_output = ''; + protected $_output = ''; /** - * fetchs output - * - * @access public - * @return string - */ + * fetchs output + * + * @return string + */ public function fetchOutput() { return $this->_output; @@ -51,9 +49,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -126,9 +123,9 @@ class version_upgrade $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_21003/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; $prefix = $this->registry->dbFunctions()->getPrefix(); - if ( file_exists( $path ) ) + if ( is_file( $path ) ) { - require( $path ); + require( $path );/*noLibHook*/ $this->error = array(); $this->sqlcount = 0; @@ -458,12 +455,4 @@ class version_upgrade unset($this->request['workact']); return TRUE; } - - - - - -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21005/index.html b/upload/admin/applications/core/setup/versions/upg_21005/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_21005/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php index 6d1021bf..2f775d26 100644 --- a/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php index b56ffcfb..bb49f502 100644 --- a/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php @@ -1,15 +1,15 @@ _output; @@ -44,9 +42,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -84,7 +81,7 @@ class version_upgrade if ( count( $title_id_to_delete ) ) { - $this->DB->buildAndFetch( array( 'delete' => 'conf_settings_titles', 'where' => 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ) ); + $this->DB->delete( 'conf_settings_titles', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); } $title_deleted_count = intval( count($title_id_to_delete) ); @@ -93,9 +90,4 @@ class version_upgrade return true; } - - -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21008/index.html b/upload/admin/applications/core/setup/versions/upg_21008/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_21008/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php index 946e450f..49660b74 100644 --- a/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php index e1f04534..0af6fa2e 100644 --- a/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php @@ -1,15 +1,15 @@ \r
    During registration, the administrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering. If your e-mail does not arrive, then on the member bar at the top of the page, there will be a link that will allow you to re-send the validation e-mail. \r
    \r
    In some cases, the administrator will need to approve your registration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your personal messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', description='How to register and the added benefits of being a registered member.' WHERE id=1"; -$UPDATES[] = "UPDATE faq SET title='Cookies and cookie usage', text='Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.test.ru/forums/index.php\' you would enter \'test.ru\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.test.ru/forums/index.php\' look for \'test.ru\' or \'www.test.ru\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', description='The benefits of using cookies and how to remove cookies set by this board.' WHERE id=2"; +$UPDATES[] = "UPDATE faq SET title='Registration benefits', text='To be able to use all the features on this board, the administrator will probably require that you register for a member account. Registration is free and only takes a moment to complete.\r
    \r
    During registration, the administrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering. If your e-mail does not arrive, then on the member bar at the top of the page, there will be a link that will allow you to re-send the validation e-mail. \r
    \r
    In some cases, the administrator will need to approve your registration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your personal messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', description='How to register and the added benefits of being a registered member.' WHERE id=1";/*noLibHook*/ +$UPDATES[] = "UPDATE faq SET title='Cookies and cookie usage', text='Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.invisionboard.com/forums/index.php\' you would enter \'invisionboard.com\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.invisionboard.com/forums/index.php\' look for \'invisionboard.com\' or \'www.invisionboard.com\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', description='The benefits of using cookies and how to remove cookies set by this board.' WHERE id=2"; $UPDATES[] = "UPDATE faq SET title='Recovering lost or forgotten passwords', text='Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r
    This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r
    \r
    To do this, click on the Lost Password link found on the log in page.\r
    \r
    Further instruction is available from there.', description='How to reset your password if you\'ve forgotten it.' WHERE id=3"; -$UPDATES[] = "UPDATE faq SET title='Your Control Panel (My Controls)', text='Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Subscriptions\r
    \r
    This is where you manage your topic and forums subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Change Personal Photo\r
    \r
    This section will allow you to add a photograph to your profile. This will be displayed when a user clicks to view your profile, on the mini-profile screen and will also be linked to from the member list.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    Send a confirmation email when I receive a new private message, this will send you an e-mail notification to your registered e-mail address each time you receive a private message on the board.\r
    Enable \'Email Notification\' by default?, this will automatically subscribe you to any topic that you make a reply to. You may unsubscribe from the \'Subscriptions\' section of My Controls if you wish.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your time zone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and choose to show or hide the \'Fast Reply\' box where it is enabled.\r
    You are also able to choose display preferences for the number of topics/posts shown per page on the board.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.', description='Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.' WHERE id=4"; +$UPDATES[] = "UPDATE faq SET title='Your Control Panel (My Controls)', text='Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Subscriptions\r
    \r
    This is where you manage your topic and forums subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Change Personal Photo\r
    \r
    This section will allow you to add a photograph to your profile. This will be displayed when a user clicks to view your profile, on the mini-profile screen and will also be linked to from the member list.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    Send a confirmation email when I receive a new private message, this will send you an e-mail notification to your registered e-mail address each time you receive a private message on the board.\r
    Enable \'Email Notification\' by default?, this will automatically subscribe you to any topic that you make a reply to. You may unsubscribe from the \'Subscriptions\' section of My Controls if you wish.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your time zone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and choose to show or hide the \'Fast Reply\' box where it is enabled.\r
    You are also able to choose display preferences for the number of topics/posts shown per page on the board.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.', description='Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.' WHERE id=4";/*noLibHook*/ $UPDATES[] = "UPDATE faq SET title='Email Notification of new messages', text='This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r
    \r
    There are three ways to subscribe to a topic:\r
      \r
    • Click the \'Track This Topic\' link at the top of the topic that you wish to track
    • \r
    • On the posting screen when replying to or creating a topic, check the \'Enable email notification of replies?\' checkbox
    • \r
    • From the E-Mail settings section of your User CP (My Controls) check the \'Enable Email Notification by default?\' option, this will automatically subscribe you to any topic that you make a reply to
    • \r
    Please note that to avoid multiple emails being sent to your email address, you will only get one e-mail for each topic you are subscribed to until the next time you visit the board.\r
    \r
    You are also able to subscribe to each individual forum on the board, to be notified when a new topic is created in that particular forum. To enable this, click the \'Subscribe to this forum\' link at the bottom of the forum that you wish to subscribe to.\r
    \r
    To unsubscribe from any forums or topics that you are subscribed to - just go to the \'Subscriptions\' section of \'My Controls\' and you can do thi from there.', description='How to get emailed when a new reply is added to a topic.' WHERE id=5"; $UPDATES[] = "UPDATE faq SET title='Your Personal Messenger', text='Your personal messenger acts much like an email account in that you can send and receive messages and store messages in folders.\r
    \r
    Compose a New PM\r
    \r
    This will allow you to send a message to another member. If you have names in your contact list, you can choose a name from it - or you may choose to enter a name in the relevant form field. This will be automatically filled in if you clicked a \'PM\' button on the board (from the member list or a post). If allowed, you may also be able to enter in multiple names in the box provided, will need to add one username per line.\r
    If the administrator allows, you may use BB Code and HTML in your private message. If you choose to check the \'Add a copy of this message to you sent items folder\' box, a copy of the message will be saved for you for later reference. If you tick the \'Track this message?\' box, then the details of the message will be available in your \'Message Tracker\' where you will be able to see if/when it has been read.\r
    \r
    \r
    \r
    Your inbox is where all new messages are sent to. Clicking on the message title will show you the message in a similar format to the board topic view. You can also delete or move messages from your inbox.\r
    \r
    Empty PM Folders\r
    \r
    This option provides you with a quick and easy way to clear out all of your PM folders.\r
    \r
    Edit Storage Folders\r
    \r
    You may rename, add or remove folders to store messages is, allowing you to organise your messages to your preference. You cannot remove \'Sent Items\' or \'Inbox\'.\r
    \r
    PM Buddies/Block List\r
    \r
    You may add in users names in this section, or edit any saved entries. You can also use this as a ban list, denying the named member the ability to message you.\r
    Names entered in this section will appear in the drop down list when sending a new PM, allowing you to quickly choose the members name when sending a message.\r
    \r
    Archive Messages\r
    \r
    If your messenger folders are full and you are unable to receive new messages, you can archive them off. This compiles the messages into a single HTML page or Microsoft © Excel Format. This page is then emailed to your registered email address for your convenience.\r
    \r
    Saved (Unsent) PMs\r
    \r
    This area will allow you to go back to any PM\'s that you have chosen to save to be sent later.\r
    \r
    Message Tracker\r
    \r
    This is the page that any messages that you have chosen to track will appear. Details of if and when they have been read by the recipient will appear here. This also gives you the chance to delete any messages that you have sent and not yet been read by the intended recipient.', description='How to send personal messages, track them, edit your messenger folders and archive stored messages.' WHERE id=6"; $UPDATES[] = "UPDATE faq SET title='Contacting the moderating team & reporting posts', text='Contacting the moderating team\r
    \r
    If you need to contact a moderator or simply wish to view the complete administration team, you can click the link \'The moderating team\' found at the bottom of the main board page (the first page you see when visiting the board), or from \'My Assistant\'.\r
    \r
    This list will show you administrators (those who have administration control panel access), global moderators (those who can moderate in all forums) and the moderators of the individual forums.\r
    \r
    If you wish to contact someone about your member account, then contact an administrator - if you wish to contact someone about a post or topic, contact either a global moderator or the forum moderator.\r
    \r
    Reporting a post\r
    \r
    If the administrator has enabled this function on the board, you\'ll see a \'Report\' button in a post, next to the \'Quote\' button. This function will let you report the post to the forum moderator (or the administrator(s), if there isn\'t a specific moderator available). You can use this function when you think the moderator(s) should be aware of the existance of that post. However, do not use this to chat with the moderator(s)!. You can use the email function or the Personal Messenger function for that.', description='Where to find a list of the board moderators and administrators.' WHERE id=7"; @@ -39,7 +39,7 @@ $UPDATES[] = "UPDATE faq SET title='Viewing members profile information', text=' $UPDATES[] = "UPDATE faq SET title='Viewing active topics and new posts', text='You can view which new topics have new replies today by clicking on the \'Today\'s Active Topics\' link found at the bottom of the main board page (the first page you see when visiting the board). You can set your own date criteria, choosing to view all topics with new replies during several date choices.\r
    \r
    The \'View New Posts\' link in the member bar at the top of each page, will allow you to view all of the topics which have new replies in since your last visit to the board.', description='How to view all the topics which have a new reply today and the new posts made since your last visit.' WHERE id=9"; $UPDATES[] = "UPDATE faq SET title='Searching Topics and Posts', text='The search feature is designed to allow you to quickly find topics and posts that contain the keywords you enter.\r
    \r
    There are two types of search form available, simple search and advanced search. You may switch between the two using the \'More Options\' and \'Simple Mode\' buttons.\r
    \r
    Simple Mode\r
    \r
    All you need to do here is enter in a keyword into the search box, and select a forum(s) to search in. (to select multiple forums, hold down the control key on a PC, or the Shift/Apple key on a Mac) choose a sorting order and search.\r
    \r
    Advanced Mode\r
    \r
    The advanced search screen, will give you a much greater range of options to choose from to refine your search. In addition to searching by keyword, you are able to search by a members username or a combination of both. You can also choose to refine your search by selecting a date range, and there are a number of sorting options available. There are also two ways of displaying the search results, can either show the post text in full or just show a link to the topic, can choose this using the radio buttons available.\r
    \r
    If the administrator has enabled it, you may have a minimum amount of time to wait between searches, this is known as search flood control.\r
    \r
    There are also search boxes available at the bottom of each forum, to allow you to carry out a quick search of all of the topics within that particular forum.', description='How to use the search feature.' WHERE id=10"; $UPDATES[] = "UPDATE faq SET title='Logging in and out', text='If you have chosen not to remember your log in details in cookies, or you are accessing the board on another computer, you will need to log into the board to access your member profile and post with your registered name.\r
    \r
    When you log in, you have the choice to save cookies that will log you in automatically when you return. Do not use this option on a shared computer for security.\r
    \r
    You can also choose to hide - this will keep your name from appearing in the active users list.\r
    \r
    Logging out is simply a matter of clicking on the \'Log Out\' link that is displayed when you are logged in. If you find that you are not logged out, you may need to manually remove your cookies. See the \'Cookies\' help file for more information.', description='How to log in and out from the board and how to remain anonymous and not be shown on the active users list.' WHERE id=11"; -$UPDATES[] = "UPDATE faq SET title='My Assistant', text='This feature is sometimes referred to as a \'Browser Buddy\'. \r
    \r
    At the top it tells you how many posts have been made since you last visited the board.. Also underneath this the number of posts with replies that have been made in topics that the individual has also posted in.\r
    Click on the \'View\' link on either of the two sentences to see the posts.\r
    \r
    The next section is five links to useful features:\r
      \r
    • The link to the moderating team is basically a quick link to see all those that either administrate or moderate certain forums on the message board.
    • \r
    • The link to \'Today\'s Active Topics\' shows you all the topics that have been created in the last 24 hours on the board.
    • \r
    • Today\'s Top 10 Posters link shows you exactly as the name suggests. It shows you the amount of posts by the members and also their total percentage of the total posts made that day.
    • \r
    • The overall Top 10 Posters link shows you the top 10 posters for the whole time that the board has been installed.
    • \r
    • My last 10 posts links to the latest topics that you have made on the board. These are shortened on the page, to save space, and are linked to if you require to read more of them.
    • \r
    The two search features allow you to search the whole board for certain words in a whole topic. It isn\'t as featured as the normal search option so it is not as comprehensive.\r
    \r
    The Help Search is just as comprehensive as the normal help section\'s search function and allows for quick searching of all the help topics on the board.', description='A comprehensive guide to use this handy little feature.' WHERE id=12"; +$UPDATES[] = "UPDATE faq SET title='My Assistant', text='This feature is sometimes referred to as a \'Browser Buddy\'. \r
    \r
    At the top it tells you how many posts have been made since you last visited the board.. Also underneath this the number of posts with replies that have been made in topics that the individual has also posted in.\r
    Click on the \'View\' link on either of the two sentences to see the posts.\r
    \r
    The next section is five links to useful features:\r
      \r
    • The link to the moderating team is basically a quick link to see all those that either administrate or moderate certain forums on the message board.
    • \r
    • The link to \'Today\'s Active Topics\' shows you all the topics that have been created in the last 24 hours on the board.
    • \r
    • Today\'s Top 10 Posters link shows you exactly as the name suggests. It shows you the amount of posts by the members and also their total percentage of the total posts made that day.
    • \r
    • The overall Top 10 Posters link shows you the top 10 posters for the whole time that the board has been installed.
    • \r
    • My last 10 posts links to the latest topics that you have made on the board. These are shortened on the page, to save space, and are linked to if you require to read more of them.
    • \r
    The two search features allow you to search the whole board for certain words in a whole topic. It isn\'t as featured as the normal search option so it is not as comprehensive.\r
    \r
    The Help Search is just as comprehensive as the normal help section\'s search function and allows for quick searching of all the help topics on the board.', description='A comprehensive guide to use this handy little feature.' WHERE id=12";/*noLibHook*/ $UPDATES[] = "UPDATE faq SET title='Posting', text='There are three different posting screens available. The new topic button, visible in forums and in topics allows you to add a new topic to that particular forum. The new poll button (if the admin has enabled it) will also be viewable in topics and forums allowing you to create a new poll in the forum. When viewing a topic, there will be an add reply button, allowing you to add a new reply onto that particular topic. \r\n
    \r\n
    Posting new topics and replying\r\n
    \r\n
    When making a post, you will most likely have the option to use IBF code when posting. This will allow you to add various types of formatting to your messages. For more information on this, click the \'BB Code Help\' link under the emoticon box to launch the help window.\r\n
    \r\n
    On the left of the text entry box, there is the clickable emoticons box - you can click on these to add them to the content of your message (these are sometimes known as \'smilies\').\r\n
    \r\n
    There are three options available when making a post or a reply. \'Enable emoticons?\' if this is unchecked, then any text that would normally be converted into an emoticon will not be. \'Enable signature?\' allows you to choose whether or not you would like your signature to appear on that individual post. \'Enable email notification of replies?\' ticking this box will mean that you will receive e-mail updates to the topic, see the \'Email Notification of new messages\' help topic for more information on this.\r\n
    \r\n
    You also have the option to choose a post icon for the topic/post when creating one. This icon will appear next to the topic name on the topic listing in that forum, or will appear next to the date/time of the message if making a reply to a topic.\r\n
    \r\n
    If the admin has enabled it, you will also see a file attachments option, this will allow you to attach a file to be uploaded when making a post. Click the browse button to select a file from your computer to be uploaded. If you upload an image file, it may be shown in the content of the post, all other file types will be linked to.\r\n
    \r\n
    Poll Options\r\n
    \r\n
    If you have chosen to post a new poll, there will be an extra two option boxes at the top of the help screen. The first input box will allow you to enter the question that you are asking in the poll. The text field underneath is where you will input the choices for the poll. Simply enter a different option on each line. The maximum number of choices is set by the board admin, and this figure is displayed on the left.\r\n
    \r\n
    Quoting Posts\r\n
    \r\n
    Displayed below each post in a topic, there is a \'Quote\' button. Pressing this button will allow you to reply to a topic, and have the text from a particular reply quoted in your own reply. When you choose to do this, an extra text field will appear below the main text input box to allow you to edit the content of the post being quoted.\r\n
    \r\n
    Editing Posts\r\n
    \r\n
    Above any posts that you have made, you may see an \'Edit\' button. Pressing this will allow you to edit the post that you had previously made. \r\n
    \r\n
    When editing you may see an option to \'Add the \'Edit by\' line in this post?\'. If you tick this then it will show up in the posts that it has been edited and the time at which it was edited. If this option does not appear, then the edit by line will always be added to the post.\r\n
    \r\n
    If you are unable to see the edit button displayed on each post that you have made, then the administrator may have prevented you from editing posts, or the time limit for editing may have expired.\r\n
    \r\n
    Fast Reply\r\n
    \r\n
    Where it has been enabled, there will be a fast reply button on each topic. Clicking this will open up a posting box on the topic view screen, cutting down on the time required to load the main posting screen. Click the fast reply button to expand the reply box and type the post inside of there. Although the fast reply box is not expanded by default, you can choose the option to have it expanded by default, from the board settings section of your control panel. Pressing the \'More Options\' button will take you to the normal posting screen.', description='A guide to the features avaliable when posting on the boards.' WHERE id=13"; $UPDATES[] = "UPDATE faq SET title='Member List', text='The member list, accessed via the \'Members\' link at the top of each page, is basically a listing of all of the members that have registered on the board. \r\n
    \r\n
    If you are looking to search for a particular member by all/part of their username, then in the drop down box at the bottom of the page, change the selection from \'Search All Available\' to \'Name Begins With\' or \'Name Contains\' and input all/part of their name in the text input field and press the \'Go!\' button. \r\n
    \r\n
    Also, at the bottom of the member list page, there are a number of sorting options available to alter the way in which the list is displayed. \r\n
    \r\n
    If a member has chosen to add a photo to their profile information, then a camera icon will appear next to their name, and you may click this to view the photo.', description='Explaining the different ways to sort and search through the list of members.' WHERE id=14"; $UPDATES[] = "UPDATE faq SET title='Topic Options', text='At the bottom of each topic, there is a \'Topic Options\' button. Pressing this button will expand the topic options box. \r
    \r
    From this box, you can select from the following options: \r
      \r
    • Track this topic - this option will allow you to receive e-mail updates for the topic, see the \'Email Notification of new messages\' help file for more information on this
    • \r
    • Subscribe to this forum - will allow you to receive e-mail updates for any new topics posted in the forum, see the Notification of new messages\' help file for more information on this
    • \r
    • Download / Print this Topic - will show the topic in a number of different formats. \'Printer Friendly Version\' will display a version of the topic that is suitable for printing out. \'Download HTML Version\' will download a copy of the topic to your hard drive, and this can then be viewed in a web browser, without having to visit the board. \'Download Microsoft Word Version\' will allow you to download the file to your hard drive and open it up in the popular word processing application, Microsoft Word, for viewing offline.
    • \r
    ', description='A guide to the options avaliable when viewing a topic.' WHERE id=15"; diff --git a/upload/admin/applications/core/setup/versions/upg_21010/index.html b/upload/admin/applications/core/setup/versions/upg_21010/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_21010/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php index afd0ed20..b652085c 100644 --- a/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php index 754cd8f4..6676ee2d 100644 --- a/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php @@ -1,15 +1,15 @@ _output; @@ -44,9 +42,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -125,9 +122,9 @@ class version_upgrade $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_22005/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; $prefix = $this->registry->dbFunctions()->getPrefix(); - if ( file_exists( $path ) ) + if ( is_file( $path ) ) { - require_once( $path ); + require_once( $path );/*noLibHook*/ $this->sqlcount = 0; $output = ""; @@ -145,7 +142,7 @@ class version_upgrade { if( preg_match( "/^create table(.+?)/i", $query ) ) { - $query = preg_replace( "/^(.+?)\);$/is", "\\1) TYPE={$this->settings['mysql_tbl_type']};", $query ); + $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); } } @@ -225,7 +222,7 @@ class version_upgrade $ignore_me = array( 'redirect_url', 'redirect_loc', 'rules_text', 'permission_custom_error', 'notify_modq_emails' ); - if ( isset($this->settings['forum_cache_minimum']) AND $this->settings['forum_cache_minimum'] ) + if ( !empty($this->settings['forum_cache_minimum']) ) { $ignore_me[] = 'description'; $ignore_me[] = 'rules_title'; @@ -382,11 +379,8 @@ class version_upgrade { $this->registry->output->addMessage("Добавление стиля 2.2.0 пропущено..."); unset($this->request['workact']); - + return TRUE; } -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php index aa7c07f2..a74f221a 100644 --- a/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php index 030526ac..a787495d 100644 --- a/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php index ad432b16..c9cc5190 100644 --- a/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php index b9e21a96..5c809c2d 100644 --- a/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php index 45ee6acc..b286d3db 100644 --- a/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php index d9c6f8f5..7280f3ce 100644 --- a/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php index faef63e0..1649181c 100644 --- a/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php index 54c58ccc..a38b2590 100644 --- a/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php index cd7379f5..91db69e8 100644 --- a/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php index 0166fe30..308e968b 100644 --- a/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php index 86a90edb..f06d22dd 100644 --- a/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php @@ -1,15 +1,15 @@ checkFulltextSupport() ) { - $SQL[] = "ALTER TABLE search_index ADD FULLTEXT KEY content (content,content_title);"; $SQL[] = "ALTER TABLE message_posts ADD FULLTEXT KEY msg_post (msg_post);"; $SQL[] = "ALTER TABLE message_topics ADD FULLTEXT KEY mt_title (mt_title);"; } diff --git a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_1.php b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_1.php index 3a81c902..991c906b 100644 --- a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_1.php +++ b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_1.php @@ -1,15 +1,15 @@ /fold /* Adding this here so permsBbcode section doesn't throw error */ $SQL[] = "ALTER TABLE bbcode_mediatag ADD mediatag_position SMALLINT NOT NULL DEFAULT '0';"; +$SQL[] = "ALTER TABLE custom_bbcode ADD bbcode_custom_regex TEXT NULL DEFAULT NULL;"; + diff --git a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_2.php b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_2.php index 3a6952a4..8c941493 100644 --- a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_2.php +++ b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_2.php @@ -1,15 +1,15 @@ \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_3.php b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_3.php index 3c6f78ad..c5cce721 100644 --- a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_3.php +++ b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_3.php @@ -1,15 +1,15 @@ * Invision Power Services - * IP.Board v3.1.2 + * IP.Board v3.2.3 * Upgrade Class * * Class to add options and notices for IP.Board upgrade - * Last Updated: $Date: 2010-05-03 19:34:02 -0400 (Mon, 03 May 2010) $ + * Last Updated: $Date: 2011-05-24 15:40:20 -0400 (Tue, 24 May 2011) $ * * - * @author Matt Mecham - * @version $Rev: 6205 $ + * @author Matt Mecham + * @version $Rev: 8884 $ * @since 3.0 * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @link http://www.invisionpower.com + * @license This is NULLED! + * @link http://hatynka.in * @package IP.Board */ -class version_class_30001 +class version_class_core_30001 { /** * Constructor * - * @access public - * @param object Registry object - * @return void + * @param object $registry Registry object + * @return @e void */ public function __construct( ipsRegistry $registry ) { @@ -42,7 +41,6 @@ class version_class_30001 /** * Add pre-upgrade options: Form * - * @access public * @return string HTML block */ public function preInstallOptionsForm() @@ -76,7 +74,6 @@ EOF; * * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); * - * @access public * @return array Key / value pairs to save */ public function preInstallOptionsSave() @@ -92,7 +89,6 @@ EOF; /** * Return any post-installation notices * - * @access public * @return array Array of notices */ public function postInstallNotices() @@ -149,7 +145,6 @@ EOF; /** * Return any pre-installation notices * - * @access public * @return array Array of notices */ public function preInstallNotices() diff --git a/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php index 8e48b39c..444b60ce 100644 --- a/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php +++ b/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php @@ -1,16 +1,15 @@ _output; @@ -44,9 +41,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { @@ -131,11 +127,11 @@ class version_upgrade } /** - * Run SQL files - * - * @access public - * @param int - */ + * Run SQL files + * + * @param int + * @return @e void + */ public function upgradeSql( $id=1 ) { $cnt = 0; @@ -146,9 +142,9 @@ class version_upgrade $prefix = $this->registry->dbFunctions()->getPrefix(); $sourceFile = ''; - if ( file_exists( $path ) ) + if ( is_file( $path ) ) { - require( $path ); + require( $path );/*noLibHook*/ /* Set DB driver to return any errors */ $this->DB->return_die = 1; @@ -164,7 +160,7 @@ class version_upgrade { if ( preg_match( "/^create table(.+?)/i", $query ) ) { - $query = preg_replace( "/^(.+?)\);$/is", "\\1) TYPE={$this->settings['mysql_tbl_type']};", $query ); + $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); } } @@ -231,11 +227,10 @@ class version_upgrade /** - * Add Applications - * - * @access public - * @param int - */ + * Add Applications + * + * @return @e void + */ public function addApplications() { /* Add applications.. */ @@ -257,7 +252,7 @@ class version_upgrade // Get it! //----------------------------------------- - if ( ! file_exists( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) ) + if ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) ) { continue; } @@ -365,6 +360,24 @@ class version_upgrade //$apps['ips']['chat']['_currentLong'] = '30003'; //$apps['ips']['chat']['_currentHuman'] = '3.0.0'; + /* If we are upgrading from 2.3 and did not upload the calendar files, we still need to insert + the applications table entry, otherwise you won't be able to upgrade down the road. We will + insert it as disabled, however, as calendar won't function since files are not available + @link http://community.invisionpower.com/tracker/issue-33543-ipb2-upgrades */ + if( !isset($apps['ips']['calendar']['name']) ) + { + $apps['ips']['calendar'] = array( + 'name' => 'Calendar', + 'public_name' => 'Calendar', + 'description' => "", + 'author' => "Invision Power Services, Inc.", + 'hide_tab' => 0, + 'key' => 'calendar', + 'disabledatinstall' => 1, + 'ipskey' => "fa038db69fa627d8e8e034d65f554d1f", + ); + } + $apps['ips']['calendar']['_currentLong'] = '30003'; $apps['ips']['calendar']['_currentHuman'] = '3.0.0'; @@ -395,19 +408,23 @@ class version_upgrade $this->registry->output->addMessage("Добавление приложения: {$appData['name']}...."); - $this->DB->insert( 'core_applications', array( 'app_title' => $appData['name'], - 'app_public_title' => ( $appData['public_name'] ) ? $appData['public_name'] : '', // Allow blank in case it's an admin-only app - 'app_description' => $appData['description'], - 'app_author' => $appData['author'], - 'app_hide_tab' => intval($appData['hide_tab']), - 'app_version' => $appData['_currentHuman'], - 'app_long_version' => $appData['_currentLong'], - 'app_directory' => $appData['key'], - 'app_added' => time(), - 'app_position' => $num, - 'app_protected' => $_protected, - 'app_location' => IPSLib::extractAppLocationKey( $appData['key'] ), - 'app_enabled' => $_enabled ) ); + $this->DB->insert( 'core_applications', array( 'app_title' => $appData['name'], + 'app_public_title' => ( $appData['public_name'] ) ? $appData['public_name'] : '', // Allow blank in case it's an admin-only app + 'app_description' => $appData['description'], + 'app_author' => $appData['author'], + 'app_hide_tab' => intval($appData['hide_tab']), + 'app_version' => $appData['_currentHuman'], + 'app_long_version' => $appData['_currentLong'], + 'app_directory' => $appData['key'], + 'app_added' => time(), + 'app_position' => $num, + 'app_protected' => $_protected, + 'app_location' => IPSLib::extractAppLocationKey( $appData['key'] ), + 'app_enabled' => $_enabled, + 'app_website' => $appData['website'], + 'app_update_check' => $appData['update_check'], + 'app_global_caches' => $appData['global_caches'], + ) ); } } @@ -416,11 +433,10 @@ class version_upgrade } /** - * Add Settings - * - * @access public - * @param int - */ + * Add Settings + * + * @return @e void + */ public function addSettings() { /* INIT */ @@ -477,10 +493,10 @@ class version_upgrade /* Add 'em */ foreach( $apps as $dir => $data ) { - if ( file_exists( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_settings.xml' ) ) + if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_settings.xml' ) ) { - require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/settings.php' ); - $settings = new admin_core_tools_settings(); + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' ); + $settings = new $classToLoad(); $settings->makeRegistryShortcuts( $this->registry ); $this->request['app_dir'] = $dir; @@ -495,11 +511,10 @@ class version_upgrade } /** - * Sort out profile fields - * - * @access public - * @param int - */ + * Sort out profile fields + * + * @return @e void + */ public function addProfile() { /* INIT */ @@ -508,7 +523,7 @@ class version_upgrade $sourceFile = ''; /* Get DB driver file */ - require_once( IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_30001/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_version_upgrade.php' ); + require_once( IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_30001/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_version_upgrade.php' );/*noLibHook*/ /* First off, move all current profile fields to group ID 3 */ $this->DB->update( 'pfields_data', array( 'pf_group_id' => 3 ), 'pf_group_id=0' ); @@ -664,11 +679,10 @@ class version_upgrade } /** - * Sort out bbcode and permissions - * - * @access public - * @param int - */ + * Sort out bbcode and permissions + * + * @return @e void + */ public function permsAndBbcode() { /* INIT */ @@ -703,27 +717,27 @@ class version_upgrade /* Add 'em */ foreach( $apps as $dir => $data ) { - if ( file_exists( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ) + if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ) { //----------------------------------------- // Continue //----------------------------------------- - - require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php' ); - $bbcode = new admin_core_posts_bbcode(); + + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' ); + $bbcode = new $classToLoad(); $bbcode->makeRegistryShortcuts( $this->registry ); $bbcode->bbcodeImportDo( file_get_contents( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ); } - if ( file_exists( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ) + if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ) { //----------------------------------------- // Continue //----------------------------------------- - - require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php' ); - $bbcode = new admin_core_posts_media(); + + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' ); + $bbcode = new $classToLoad(); $bbcode->makeRegistryShortcuts( $this->registry ); $bbcode->doMediaImport( file_get_contents( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ); @@ -1021,8 +1035,8 @@ class version_upgrade /** * Export skin and languages - * - * @access public + * + * @return @e void */ public function exportSkinLang() { @@ -1051,9 +1065,9 @@ class version_upgrade { if ( ! is_dir( IPS_CACHE_PATH . 'cache/previousLangFiles' ) ) { - if ( @mkdir( IPS_CACHE_PATH . 'cache/previousLangFiles', 0777 ) ) + if ( @mkdir( IPS_CACHE_PATH . 'cache/previousLangFiles', IPS_FOLDER_PERMISSION ) ) { - @chmod( IPS_CACHE_PATH . 'cache/previousLangFiles', 0777 ); + @chmod( IPS_CACHE_PATH . 'cache/previousLangFiles', IPS_FOLDER_PERMISSION ); } } @@ -1105,42 +1119,42 @@ class version_upgrade { if ( ! is_dir( IPS_CACHE_PATH . 'cache/previousSkinFiles' ) ) { - if ( @mkdir( IPS_CACHE_PATH . 'cache/previousSkinFiles', 0777 ) ) + if ( @mkdir( IPS_CACHE_PATH . 'cache/previousSkinFiles', IPS_FOLDER_PERMISSION ) ) { - @chmod( IPS_CACHE_PATH . 'cache/previousSkinFiles', 0777 ); + @chmod( IPS_CACHE_PATH . 'cache/previousSkinFiles', IPS_FOLDER_PERMISSION ); } } $safeName = IPSText::alphanumericalClean( $set['set_name'] ); $dirPath = IPS_CACHE_PATH . 'cache/previousSkinFiles/' . $safeName; - if ( @mkdir( $dirPath, 0777 ) ) + if ( @mkdir( $dirPath, IPS_FOLDER_PERMISSION ) ) { - @chmod( $dirPath, 0777 ); + @chmod( $dirPath, IPS_FOLDER_PERMISSION ); } if ( is_dir( $dirPath ) ) { /* Export CSS */ - if ( @mkdir( $dirPath . '/css', 0777 ) ) + if ( @mkdir( $dirPath . '/css', IPS_FOLDER_PERMISSION ) ) { - @chmod( $dirPath . '/css', 0777 ); + @chmod( $dirPath . '/css', IPS_FOLDER_PERMISSION ); } @file_put_contents( $dirPath . '/css/css.css', $set['set_cache_css'] ); /* Export Wrapper */ - if ( @mkdir( $dirPath . '/wrapper', 0777 ) ) + if ( @mkdir( $dirPath . '/wrapper', IPS_FOLDER_PERMISSION ) ) { - @chmod( $dirPath . '/wrapper', 0777 ); + @chmod( $dirPath . '/wrapper', IPS_FOLDER_PERMISSION ); } @file_put_contents( $dirPath . '/wrapper/wrapper.html', $set['set_wrapper'] ); /* Export Templates */ - if ( @mkdir( $dirPath . '/templates', 0777 ) ) + if ( @mkdir( $dirPath . '/templates', IPS_FOLDER_PERMISSION ) ) { - @chmod( $dirPath . '/templates', 0777 ); + @chmod( $dirPath . '/templates', IPS_FOLDER_PERMISSION ); } $this->DB->build( array( 'select' => '*', @@ -1156,9 +1170,9 @@ class version_upgrade $_bitName = IPSText::alphanumericalClean( $row['func_name'] ); /* Make section dir */ - if ( @mkdir( $dirPath . '/templates/' . $_groupName, 0777 ) ) + if ( @mkdir( $dirPath . '/templates/' . $_groupName, IPS_FOLDER_PERMISSION ) ) { - @chmod( $dirPath . '/templates/' . $_groupName, 0777 ); + @chmod( $dirPath . '/templates/' . $_groupName, IPS_FOLDER_PERMISSION ); } @file_put_contents( $dirPath . '/templates/' . $_groupName . '/' . $_bitName . '.html', $row['section_content'] ); @@ -1186,10 +1200,10 @@ class version_upgrade } /** - * Convert PMs - * - * @access public - */ + * Convert PMs + * + * @return @e void + */ public function convertPms() { /* INIT */ @@ -1303,7 +1317,7 @@ class version_upgrade /* Build invited - does not include 'to' person */ if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) ) { - $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id']; + $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/ } $_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0; @@ -1397,18 +1411,31 @@ class version_upgrade } /** - * Convert Block lists - * - * @access public - */ + * Convert Block lists + * + * @return @e void + */ public function convertBlockLists() { /* INIT */ $pergo = 200; $start = intval( $this->request['st'] ); + $options = IPSSetUp::getSavedData('custom_options'); + $skipPms = $options['core'][30001]['skipPms']; $converted = 0; $seen = 0; + /* Skipping? */ + if ( $skipPms ) + { + /* add a message */ + $this->registry->output->addMessage( "Skipping Block List Conversion" ); + + $this->request['workact'] = 'pmblock'; + $this->request['st'] = 0; + return; + } + $this->DB->build( array( 'select' => '*', 'from' => 'members', 'where' => method_exists( $this->DB, 'setTableIdentityInsert' ) ? 'ignored_users NOT LIKE \'\'' : $this->DB->buildLength('ignored_users') . ' > 0', @@ -1469,10 +1496,10 @@ class version_upgrade } /** - * Convert Block lists - * - * @access public - */ + * Convert Block lists + * + * @return @e void + */ public function convertPmBlockLists() { /* INIT */ @@ -1480,6 +1507,19 @@ class version_upgrade $start = intval( $this->request['st'] ); $converted = 0; $seen = 0; + $options = IPSSetUp::getSavedData('custom_options'); + $skipPms = $options['core'][30001]['skipPms']; + + /* Skipping? */ + if ( $skipPms ) + { + /* add a message */ + $this->registry->output->addMessage( "Skipping PM Block List Conversion" ); + + $this->request['workact'] = 'finish'; + $this->request['st'] = 0; + return; + } $this->DB->build( array( 'select' => '*', 'from' => 'contacts', @@ -1554,11 +1594,10 @@ class version_upgrade /** - * Finish up conversion stuff - * - * @access public - * @param int - */ + * Finish up conversion stuff + * + * @return @e void + */ public function finish() { $options = IPSSetUp::getSavedData('custom_options'); @@ -1614,7 +1653,7 @@ class version_upgrade 'external' => 5 ); /* Fetch XML */ - require_once( IPS_KERNEL_PATH . 'classXML.php' ); + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ $xml = new classXML( IPSSetUp::charSet ); $xml->load( IPS_ROOT_PATH . 'setup/xml/loginauth.xml' ); @@ -1684,6 +1723,4 @@ class version_upgrade /* Last function, so unset workact */ $this->request['workact'] = ''; } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30003/index.html b/upload/admin/applications/core/setup/versions/upg_30003/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_30003/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php index 708f6954..cf3ab69c 100644 --- a/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php index d4c978b7..a375f1ca 100644 --- a/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php index 6796300c..319d157f 100644 --- a/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php index ed0ee4d1..dfe044e9 100644 --- a/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php index 9161a19f..1d62c59a 100644 --- a/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php index e07185af..00d88323 100644 --- a/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php @@ -1,15 +1,15 @@ _output; @@ -44,9 +42,8 @@ class version_upgrade /** * Execute selected method * - * @access public * @param object Registry object - * @return void + * @return @e void */ public function doExecute( ipsRegistry $registry ) { diff --git a/upload/admin/applications/core/setup/versions/upg_30009/index.html b/upload/admin/applications/core/setup/versions/upg_30009/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_30009/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php index a4e1dfae..823b45a5 100644 --- a/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php index f8fa7526..cf749f5f 100644 --- a/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php index 6089e086..12028ba2 100644 --- a/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php index 6d9a7712..d6834c5b 100644 --- a/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php @@ -1,15 +1,15 @@ checkForField( 'tag_hidden', 'tags_index' ) ) { $SQL[] = "ALTER TABLE tags_index ADD tag_hidden INT(1) NOT NULL default '0', ADD INDEX tag_grab (app, type, type_id, type_2, type_id_2, tag_hidden);"; - //$SQL[] = "CREATE INDEX tag_grab ON tags_index (app, type, type_id, type_2, type_id_2, tag_hidden);"; - // ^^ This is a mssql query.. } $SQL[] = "ALTER TABLE message_topic_user_map ADD INDEX ( map_topic_id );"; @@ -54,9 +52,9 @@ $SQL[] = "ALTER TABLE polls ADD INDEX ( tid );"; $SQL[] = "CREATE TABLE core_rss_imported ( - rss_guid CHAR(32) NOT NULL, - rss_foreign_id INT(10) NOT NULL default '0', - rss_foreign_key VARCHAR(100) NOT NULL default '', + rss_guid CHAR(32) NOT NULL, + rss_foreign_id INT(10) NOT NULL default '0', + rss_foreign_key VARCHAR(100) NOT NULL default '', PRIMARY KEY (rss_guid), KEY rss_grabber (rss_guid, rss_foreign_key) );"; diff --git a/upload/admin/applications/core/setup/versions/upg_31000/index.html b/upload/admin/applications/core/setup/versions/upg_31000/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_31000/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php index fe710bfa..dada0f36 100644 --- a/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php @@ -1,15 +1,15 @@ 0;"; -$SQL[] = "ALTER TABLE members ADD twitter_id VARCHAR(255) NOT NULL DEFAULT '';"; +$SQL[] = "ALTER TABLE members ADD twitter_id VARCHAR(255) NOT NULL DEFAULT '';"; $SQL[] = "ALTER TABLE members ADD twitter_token VARCHAR(255) NOT NULL DEFAULT '';"; $SQL[] = "ALTER TABLE members ADD twitter_secret VARCHAR(255) NOT NULL DEFAULT '';"; $SQL[] = "ALTER TABLE members ADD notification_cnt MEDIUMINT NOT NULL DEFAULT '0';"; @@ -331,9 +331,9 @@ $SQL[] = "ALTER TABLE members ADD INDEX twitter_id (twitter_id);"; $SQL[] = "ALTER TABLE profile_portal ADD tc_last_sid_import BIGINT(20) UNSIGNED NOT NULL default '0';"; -$SQL[] = "ALTER TABLE profile_portal ADD tc_photo text;"; +$SQL[] = "ALTER TABLE profile_portal ADD tc_photo text;"; $SQL[] = "ALTER TABLE profile_portal ADD tc_bwoptions int(10) unsigned NOT NULL default '0';"; -$SQL[] = "ALTER TABLE profile_portal ADD pp_customization mediumtext;"; +$SQL[] = "ALTER TABLE profile_portal ADD pp_customization mediumtext;"; $SQL[] = "ALTER TABLE groups ADD g_max_notifications MEDIUMINT NOT NULL DEFAULT '0';"; $SQL[] = "ALTER TABLE groups ADD g_max_bgimg_upload INT(10) NOT NULL default '0';"; @@ -342,8 +342,8 @@ $SQL[] = "ALTER TABLE rc_classes ADD app VARCHAR( 32 ) NOT NULL;"; $SQL[] = "ALTER TABLE forums ADD disable_sharelinks INT(1) NOT NULL default '0';"; $SQL[] = "ALTER TABLE topics ADD topic_deleted_posts INT(10) NOT NULL default '0';"; -$SQL[] = "ALTER TABLE forums ADD deleted_posts INT(10) NOT NULL default '0';"; -$SQL[] = "ALTER TABLE forums ADD deleted_topics INT(10) NOT NULL default '0';"; +$SQL[] = "ALTER TABLE forums ADD deleted_posts INT(10) NOT NULL default '0';"; +$SQL[] = "ALTER TABLE forums ADD deleted_topics INT(10) NOT NULL default '0';"; $SQL[] = "ALTER TABLE forums ADD rules_raw_html tinyint(1) NOT NULL default '0';"; @@ -398,7 +398,7 @@ if ( ! $skins['default'] ) 'set_permissions' => '*', 'set_is_default' => 0, 'set_author_name' => "Invision Power Services, Inc", - 'set_author_url' => 'http://bestcms.ws', + 'set_author_url' => 'http://www.invisionpower.com', 'set_image_dir' => 'master', 'set_emo_dir' => 'default', 'set_hide_from_list' => 1, @@ -418,7 +418,7 @@ if ( ! $skins['lofi'] ) 'set_permissions' => '*', 'set_is_default' => 0, 'set_author_name' => "Invision Power Services, Inc", - 'set_author_url' => 'http://bestcms.ws', + 'set_author_url' => 'http://www.invisionpower.com', 'set_image_dir' => 'master', 'set_emo_dir' => 'default', 'set_hide_from_list' => 1, @@ -436,9 +436,12 @@ if ( ! $skin['set_id'] ) $DB->update( 'skin_collections', array( 'set_is_default' => 1, 'set_hide_from_list' => 0 ), "set_key='default'" ); } -$SQL[] = "ALTER TABLE custom_bbcode ADD bbcode_custom_regex TEXT NULL DEFAULT NULL;"; +if ( ! $DB->checkForField( 'bbcode_custom_regex', 'custom_bbcode' ) ) +{ + $SQL[] = "ALTER TABLE custom_bbcode ADD bbcode_custom_regex TEXT NULL DEFAULT NULL;"; +} -$SQL[] = "ALTER TABLE skin_templates ADD template_master_key VARCHAR(100) NOT NULL DEFAULT '';"; +$SQL[] = "ALTER TABLE skin_templates ADD template_master_key VARCHAR(100) NOT NULL DEFAULT '';"; $SQL[] = "ALTER TABLE skin_templates ADD INDEX template_master_key (template_master_key);"; $SQL[] = "ALTER TABLE skin_css ADD css_master_key VARCHAR(100) NOT NULL DEFAULT '';"; diff --git a/upload/admin/applications/core/setup/versions/upg_31003/index.html b/upload/admin/applications/core/setup/versions/upg_31003/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_31003/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php index e948192f..ba93bcc5 100644 --- a/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php index f06ed975..e5e6dc37 100644 --- a/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php index 7d5de29d..97373e2c 100644 --- a/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php @@ -1,15 +1,15 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php index eb8f8386..51aa0afa 100644 --- a/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php @@ -1,48 +1,20 @@ checkForTable('cal_events') ) @@ -50,6 +22,10 @@ if ( $DB->checkForTable('cal_events') ) $SQL[] = "ALTER TABLE cal_events CHANGE event_tz event_tz VARCHAR( 4 ) NOT NULL DEFAULT '0'"; } +/* @link http://community.invisionpower.com/tracker/issue-32451-calendar-upgrade-issue-warning-and-then-driver-error + This may cause two entries for calendar for this version number, but that doesn't matter */ +$SQL[] = "INSERT INTO upgrade_history (upgrade_version_id, upgrade_version_human, upgrade_date, upgrade_mid, upgrade_app) VALUES (31006, '3.1.3', " . time() . ", 1, 'calendar');"; + $SQL[] = "ALTER TABLE mobile_notifications DROP INDEX id;"; $SQL[] = "ALTER TABLE profile_friends DROP INDEX friends_member_id;"; $SQL[] = "ALTER TABLE member_status_updates DROP INDEX status_member_id;"; diff --git a/upload/admin/applications/core/setup/versions/upg_31007/index.html b/upload/admin/applications/core/setup/versions/upg_31007/index.html index dfdb4ca9..b09595ca 100644 --- a/upload/admin/applications/core/setup/versions/upg_31007/index.html +++ b/upload/admin/applications/core/setup/versions/upg_31007/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php index 0e11fea0..fdb347f8 100644 --- a/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php @@ -1,15 +1,15 @@ +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php new file mode 100644 index 00000000..0f586cdb --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php @@ -0,0 +1,72 @@ +getPrefix()); + +/* Disable non-IPS hooks */ +$SQL[] = "UPDATE core_hooks SET hook_enabled=0 WHERE hook_author!='Invision Power Services, Inc.' AND hook_author!='Invision Power Services, Inc';"; + +/* Cleanup some old CSS files */ +$SQL[] = "DELETE FROM skin_cache WHERE cache_value_1 in ('ipb_reset','ipb_bbcode','lightbox');"; +$SQL[] = "DELETE FROM skin_css WHERE css_group in ('ipb_reset','ipb_bbcode','lightbox');"; +$SQL[] = "DELETE FROM skin_css_previous WHERE p_css_group in ('ipb_reset','ipb_bbcode','lightbox');"; + +/* Remove old settings and setting groups */ +$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN( 'threaded_per_page', 'spider_anon', 'enable_sockets', 'spam_service_api_key', 'news_forum_id', 'index_news_link', + 'csite_title', 'csite_article_date', 'csite_nav_show', 'csite_nav_contents', 'csite_fav_show', 'csite_fav_contents', 'blogs_portal_lastx', 'poll_poll_url', 'recent_topics_article_forum', + 'recent_topics_article_max', 'portal_exclude_pinned', 'recent_topics_discuss_number', 'forum_trash_can_enable', 'forum_trash_can_id', 'forum_trash_can_use_admin', 'forum_trash_can_use_smod', + 'forum_trash_can_use_mod', 'guests_ava', 'avatars_on', 'avatar_url', 'avatar_ext', 'avatar_def', 'avup_size_max', 'avatar_dims', 'disable_ipbsize', 'registration_qanda', + 'disable_reportpost', 'captcha_allow_fonts', 'gd_version', 'login_page_info', 'register_page_info', 'cache_calendar', 'disable_online_ip', 'topicmode_default', 'allow_skins', + 'ipb_disable_group_psformat', 'max_sig_length', 'aboutme_emoticons', 'login_change_key', 'disable_flash', 'disable_admin_anon', 'msg_allow_code', 'warn_show_rating', 'short_forum_jump', + 'ips_default_editor', 'poll_tags', 'ipb_reg_show', 'cpu_watch_update', 'report_nemail_enabled', 'report_pm_enabled', 'enable_show_as_titles', 'pre_pinned', 'pre_moved', 'pre_polls', + 'max_bbcodes_per_post', 'post_wordwrap', 'aboutme_bbcode', 'sig_allow_ibc', 'aboutme_html', 'sig_allow_html', 'msg_allow_html', 'postpage_contents', 'topicpage_contents', 'use_mail_form', + 'resize_linked_img', 'cc_monitor' );"; +$SQL[] = "DELETE FROM core_sys_settings_titles WHERE conf_title_keyword in ( 'ipbportal', 'portal_poll', 'portal_recent_topics', 'portal_blogs', 'newssetup', 'trashcansetup', + 'cookies', 'ipbreg', 'twitterconnect' );"; + +/* Remove portal application - cache will be rebuilt by upgrader automatically */ +$SQL[] = "DELETE FROM core_applications WHERE app_directory='portal';"; +$SQL[] = "DELETE FROM core_sys_module WHERE sys_module_application='portal';"; +$SQL[] = "DELETE FROM upgrade_history WHERE upgrade_app='portal';"; +$SQL[] = "DELETE FROM cache_store WHERE cs_key='portal';"; +$SQL[] = "DELETE FROM core_sys_lang_words WHERE word_app='portal';"; + +/* Ensure engine isn't added */ +ipsRegistry::$settings['mysql_tbl_type'] = ''; + +/* Ensure reputation_cache does not have duplicates for new unique key to be added */ +$SQL[] = "CREATE TABLE reputation_cache2 (SELECT * FROM `{$PRE}reputation_cache` WHERE id > 0 GROUP BY app, type, type_id);"; +$SQL[] = "DROP TABLE reputation_cache;"; +$SQL[] = "RENAME TABLE reputation_cache2 TO reputation_cache;"; +$SQL[] = "ALTER TABLE reputation_cache CHANGE id id bigint NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(id), ADD UNIQUE KEY (app, type, type_id);"; + +/* This, too, causes many issues. Have seen several customers where the delete query cannot finish, even after 8 hours. */ +/*$SQL[] = "CREATE TABLE reputation_cache_tempforupgrade SELECT id, CONCAT( app, '-', type, '-', type_id ) as cct, count( CONCAT( app, '-', type, '-', type_id ) ) AS count FROM {$PRE}reputation_cache GROUP BY cct;"; +$SQL[] = "CREATE INDEX tmpIDX ON reputation_cache_tempforupgrade ( count );"; +$SQL[] = "DELETE FROM reputation_cache WHERE id IN( select id from {$PRE}reputation_cache_tempforupgrade WHERE count > 1 );"; +$SQL[] = "DROP TABLE reputation_cache_tempforupgrade;";*/ + +/* +The original query can take 5+ minutes with a lot of records. Changed to the above based on feedback in bug report. Didn't use temp tables due to problems with some shared hosts. +@link http://community.invisionpower.com/tracker/issue-31514-upgrade-query-taking-huge-amount-of-time + +$SQL[] = "DELETE FROM reputation_cache WHERE id IN( + SELECT id FROM ( + SELECT x.id, CONCAT( x.app, '-', x.type, '-', x.type_id ) as cct, count( CONCAT( x.app, '-', x.type, '-', x.type_id ) ) as count FROM {$PRE}reputation_cache x GROUP BY cct ORDER BY count DESC + ) as q WHERE count > 1 );";*/ + +/* Delete old cache store records */ +$SQL[] = "delete from cache_store where cs_key IN( 'ccMonitor', 'portal' );"; + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_1.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_1.php new file mode 100644 index 00000000..38bbfa41 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_1.php @@ -0,0 +1,197 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* Generic changes */ +$SQL[] = "ALTER TABLE login_methods ADD login_custom_config TEXT NULL DEFAULT NULL;"; + +$SQL[] = "ALTER TABLE reputation_cache ADD rep_like_cache MEDIUMTEXT, + CHANGE rep_points rep_points INT( 10 ) NOT NULL DEFAULT '0';"; + +$SQL[] = "ALTER TABLE core_like ADD like_lookup_area CHAR(32) NOT NULL DEFAULT '' AFTER like_lookup_id, + ADD like_visible TINYINT NOT NULL DEFAULT '1', + DROP INDEX find_rel_favs, + ADD INDEX find_rel_likes ( like_lookup_id , like_visible , like_is_anon , like_added ), + DROP INDEX like_member_id, + ADD INDEX like_member_id ( like_member_id , like_visible , like_added ), + ADD INDEX like_lookup_area ( like_lookup_area , like_visible ), + ADD INDEX notification_task ( like_notify_do, like_app (50), like_area (50), like_visible, like_notify_sent, like_notify_freq (50) );"; +$SQL[] = "UPDATE core_like SET like_lookup_area = MD5(CONCAT(like_app, ';', like_area, ';', like_member_id ) );"; + +if( !$DB->checkForField( 'app_tab_groups', 'core_applications' ) ) +{ + $SQL[] = "ALTER TABLE core_applications ADD app_website VARCHAR(255) NULL DEFAULT NULL, + ADD app_update_check VARCHAR(255) NULL DEFAULT NULL, + ADD app_global_caches VARCHAR(255) NULL DEFAULT NULL, + ADD app_tab_groups TEXT NULL DEFAULT NULL AFTER app_hide_tab;"; +} + +$SQL[] = "ALTER TABLE cache_store DROP cs_extra, + ADD cs_rebuild TINYINT( 1 ) NOT NULL DEFAULT '0';"; + +$SQL[] = "ALTER TABLE banfilters DROP ban_nocache, + ADD ban_reason VARCHAR(255) NULL DEFAULT NULL;"; + +$SQL[] = "ALTER TABLE rc_reports_index ADD INDEX ( status );"; + +$SQL[] = "ALTER TABLE rc_comments ADD approved TINYINT NOT NULL DEFAULT '1', + ADD edit_date INT NOT NULL DEFAULT '0', + ADD author_name VARCHAR( 255 ) NULL DEFAULT NULL , + ADD ip_address VARCHAR( 46 ) NULL DEFAULT NULL;"; + +$SQL[] = "ALTER TABLE inline_notifications ADD notify_meta_app VARCHAR(50) NULL DEFAULT NULL, + ADD notify_meta_area VARCHAR(100) NULL DEFAULT NULL, + ADD notify_meta_id INT(10) DEFAULT 0, + ADD notify_meta_key VARCHAR(32) NULL DEFAULT NULL, + ADD KEY notify_meta_key (notify_meta_key);"; + +$SQL[] = "ALTER TABLE ignored_users ADD ignore_signatures INT(1) NOT NULL DEFAULT '0', + ADD ignore_chats INT(1) NOT NULL DEFAULT '0';"; + +$SQL[] = "ALTER TABLE mail_queue ADD mail_cc TEXT DEFAULT NULL;"; + +$SQL[] = "ALTER TABLE permission_index CHANGE perm_2 perm_2 TEXT NULL DEFAULT NULL, + CHANGE perm_3 perm_3 TEXT NULL DEFAULT NULL, + CHANGE perm_4 perm_4 TEXT NULL DEFAULT NULL, + CHANGE perm_5 perm_5 TEXT NULL DEFAULT NULL, + CHANGE perm_6 perm_6 TEXT NULL DEFAULT NULL, + CHANGE perm_7 perm_7 TEXT NULL DEFAULT NULL;"; + +$SQL[] = "ALTER TABLE forums DROP quick_reply, + ADD tag_predefined TEXT NULL;"; + +$SQL[] = "ALTER TABLE captcha CHANGE captcha_ipaddress captcha_ipaddress VARCHAR( 46 ) NOT NULL;"; +$SQL[] = "ALTER TABLE converge_local CHANGE converge_ip_address converge_ip_address VARCHAR( 46 ) NOT NULL;"; +$SQL[] = "ALTER TABLE api_log CHANGE api_log_ip api_log_ip VARCHAR( 46 ) NOT NULL;"; +$SQL[] = "ALTER TABLE api_users CHANGE api_user_ip api_user_ip VARCHAR( 46 ) NOT NULL;"; +$SQL[] = "ALTER TABLE core_sys_cp_sessions CHANGE session_ip_address session_ip_address VARCHAR( 46 ) NOT NULL;"; + +$SQL[] = "ALTER TABLE sessions DROP location, + CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL, + CHANGE member_name member_name VARCHAR( 255 ) NULL DEFAULT NULL, + CHANGE search_thread_time search_thread_time INT( 10 ) NOT NULL DEFAULT '0';"; + +$SQL[] = "ALTER TABLE upgrade_sessions CHANGE session_ip_address session_ip_address VARCHAR( 46 ) NOT NULL;"; + +$SQL[] = "ALTER TABLE validating CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL DEFAULT '0';"; + +$SQL[] = "ALTER TABLE core_sys_lang CHANGE lang_short lang_short varchar(32) NOT NULL;"; + +$SQL[] = "CREATE TABLE core_editor_autosave ( + eas_key CHAR(32) NOT NULL, + eas_member_id INT(10) UNSIGNED NOT NULL DEFAULT '0', + eas_app VARCHAR(50) NOT NULL DEFAULT '', + eas_section VARCHAR(100) NOT NULL DEFAULT '', + eas_updated INT(10) UNSIGNED NOT NULL DEFAULT '0', + eas_content MEDIUMTEXT, + UNIQUE KEY eas_key (eas_key), + KEY eas_member_lookup (eas_member_id, eas_app, eas_section), + KEY eas_updated (eas_updated) +);"; + +$SQL[] = "CREATE TABLE core_tags ( + tag_id BIGINT(20) UNSIGNED NOT NULL auto_increment, + tag_aai_lookup CHAR(32) NOT NULL DEFAULT '', + tag_aap_lookup CHAR(32) NOT NULL DEFAULT '', + tag_meta_app VARCHAR(200) NOT NULL default '', + tag_meta_area VARCHAR(200) NOT NULL default '', + tag_meta_id INT(10) UNSIGNED NOT NULL DEFAULT 0, + tag_meta_parent_id INT(10) UNSIGNED NOT NULL DEFAULT 0, + tag_member_id INT(10) UNSIGNED NOT NULL DEFAULT 0, + tag_added INT(10) UNSIGNED NOT NULL DEFAULT 0, + tag_prefix INT(1) UNSIGNED NOT NULL DEFAULT 0, + tag_text VARCHAR(255), + PRIMARY KEY (tag_id), + KEY tag_aai_lookup (tag_aai_lookup), + KEY tag_app (tag_meta_app (100), tag_meta_area (100)), + KEY tag_member_id (tag_member_id), + KEY tag_aap_lookup (tag_aap_lookup, tag_text (200)), + KEY tag_added (tag_added ) );"; + +$SQL[] = "CREATE TABLE core_tags_perms ( + tag_perm_aai_lookup CHAR(32) NOT NULL DEFAULT '', + tag_perm_aap_lookup CHAR(32) NOT NULL DEFAULT '', + tag_perm_text VARCHAR(255) NOT NULL DEFAULT '', + tag_perm_visible INT(1) UNSIGNED NOT NULL DEFAULT 1, + UNIQUE KEY tag_perm_aai_lookup (tag_perm_aai_lookup), + KEY tag_perm_aap_lookup( tag_perm_aap_lookup ), + KEY tag_lookup (tag_perm_text, tag_perm_visible) );"; + +$SQL[] = "CREATE TABLE core_tags_cache ( + tag_cache_key CHAR(32) NOT NULL DEFAULT '', + tag_cache_text text, + tag_cache_date INT(10) NOT NULL DEFAULT 0, + UNIQUE KEY (tag_cache_key ) );"; + +$SQL[] = "CREATE TABLE cache_simple ( + cache_id VARCHAR(32) NOT NULL DEFAULT '', + cache_perm_key VARCHAR(32) NOT NULL DEFAULT '', + cache_time INT(10) NOT NULL DEFAULT 0, + cache_data MEDIUMTEXT NOT NULL, + UNIQUE KEY lookup ( cache_id, cache_perm_key ) +);"; + +$SQL[] = "CREATE TABLE core_incoming_email_log ( + log_id int(11) NOT NULL AUTO_INCREMENT, + log_email varchar(255) DEFAULT NULL, + log_time int(10) DEFAULT NULL, + PRIMARY KEY (log_id) +);"; + +if ( ! $DB->checkForTable('core_geolocation_cache') ) +{ + $SQL[] = "CREATE TABLE core_geolocation_cache ( + geocache_key varchar(32) NOT NULL, + geocache_lat varchar(100) NOT NULL, + geocache_lon varchar(100) NOT NULL, + geocache_raw text, + geocache_country varchar(255) NOT NULL default '', + geocache_district varchar(255) NOT NULL default '', + geocache_district2 varchar(255) NOT NULL default '', + geocache_locality varchar(255) NOT NULL default '', + geocache_type varchar(255) NOT NULL default '', + geocache_engine varchar(255) NOT NULL default '', + geocache_added int(10) NOT NULL default '0', + geocache_short text, + PRIMARY KEY (geocache_key), + KEY geo_lat_lon (geocache_lat,geocache_lon) +);"; +} + +if ( ! $DB->checkForTable('skin_generator_sessions') ) +{ +/* Skin generator */ + $SQL[] = "CREATE TABLE skin_generator_sessions ( + sg_session_id VARCHAR(32) NOT NULL DEFAULT '', + sg_member_id INT(10) NOT NULL DEFAULT 0, + sg_skin_set_id INT(10) NOT NULL DEFAULT 0, + sg_date_start INT(10) NOT NULL DEFAULT 0, + sg_data MEDIUMTEXT, + PRIMARY KEY (sg_session_id) +);"; +} + +$SQL[] = "DROP TABLE search_results;"; +$SQL[] = "ALTER TABLE attachments_type DROP atype_photo;"; +$SQL[] = "ALTER TABLE groups DROP g_avatar_upload;"; +$SQL[] = "ALTER TABLE custom_bbcode DROP bbcode_strip_search;"; + +$SQL[] = "ALTER TABLE emoticons ADD emo_position INT(5) NOT NULL DEFAULT '0';"; + +$SQL[] = "UPDATE emoticons SET image=REPLACE(image, '.gif', '.png') WHERE emo_set='default' AND image IN ( 'angry.gif', 'biggrin.gif', 'blink.gif', 'blush.gif', 'cool.gif', 'dry.gif', 'excl.gif', + 'happy.gif', 'huh.gif', 'laugh.gif', 'mellow.gif', 'ohmy.gif', 'ph34r.gif', 'sad.gif', 'sleep.gif', 'smile.gif', 'tongue.gif', 'unsure.gif', 'wacko.gif', 'wink.gif', 'wub.gif' );"; + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_2.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_2.php new file mode 100644 index 00000000..ed06047a --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_2.php @@ -0,0 +1,36 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* Change to potentially large tables */ + +$SQL[] = "DROP TABLE email_logs;"; + +$SQL[] = "ALTER TABLE profile_ratings CHANGE rating_ip_address rating_ip_address VARCHAR( 46 ) NOT NULL;"; + +$SQL[] = "ALTER TABLE topic_ratings CHANGE rating_ip_address rating_ip_address VARCHAR( 46 ) NOT NULL;"; + +$SQL[] = "ALTER TABLE voters CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL;"; + +$SQL[] = "ALTER TABLE core_hooks CHANGE hook_installed hook_installed INT( 10 ) NOT NULL DEFAULT '0', + CHANGE hook_updated hook_updated INT( 10 ) NOT NULL DEFAULT '0', + ADD hook_global_caches VARCHAR(255) NULL DEFAULT NULL;"; + +$SQL[] = "ALTER TABLE attachments ADD attach_parent_id INT NOT NULL DEFAULT '0', + ADD INDEX ( attach_parent_id, attach_rel_module );"; + +$SQL[] = "UPDATE attachments a SET a.attach_parent_id=CASE WHEN (select p.topic_id from {$PRE}posts p WHERE p.pid=a.attach_rel_id) IS NULL THEN 0 ELSE (select p.topic_id from {$PRE}posts p WHERE p.pid=a.attach_rel_id) END WHERE a.attach_rel_module='post';"; diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_3.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_3.php new file mode 100644 index 00000000..0c7e105a --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_3.php @@ -0,0 +1,36 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* Status update and messenger changes */ + +$SQL[] = "ALTER TABLE member_status_updates ADD status_author_id INT(10) UNSIGNED NOT NULL DEFAULT '0', + ADD status_author_ip VARCHAR(46) NOT NULL DEFAULT '', + ADD status_approved INT(1) NOT NULL DEFAULT 1, + ADD INDEX status_author_lookup (status_author_id, status_member_id, status_date), + ADD INDEX ( status_member_id, status_approved, status_date );"; + +$SQL[] = "UPDATE member_status_updates SET status_author_id=status_member_id;"; + +$SQL[] = "INSERT INTO member_status_updates (status_member_id, status_author_id, status_date, status_content, status_replies, status_last_ids, status_is_latest, status_is_locked, status_hash, status_imported, status_creator, status_author_ip, status_approved) + SELECT comment_for_member_id, comment_by_member_id, comment_date, comment_content, 0, '', 0, 0, MD5(comment_content), 0, '', comment_ip_address, comment_approved FROM {$PRE}profile_comments;"; + +$SQL[] = "DROP TABLE profile_comments;"; + +$SQL[] = "ALTER TABLE message_posts CHANGE msg_ip_address msg_ip_address VARCHAR( 46 ) NOT NULL DEFAULT '0';"; + +$SQL[] = "UPDATE groups SET g_view_board=1 WHERE g_id=" . ipsRegistry::$settings['guest_group'] . ";"; \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_4.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_4.php new file mode 100644 index 00000000..0cec3994 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_4.php @@ -0,0 +1,37 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* Member and profile_portal table changes */ + +$SQL[] = "ALTER TABLE members CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL, + DROP hide_email, + DROP email_full, + DROP view_prefs, + DROP view_avs, + DROP INDEX mgroup, + ADD INDEX mgroup ( member_group_id , member_id );"; + + +$SQL[] = "UPDATE profile_portal SET pp_setting_count_visitors=1 WHERE pp_setting_count_visitors > 1;"; + +$SQL[] = "ALTER TABLE profile_portal CHANGE tc_last_sid_import tc_last_sid_import VARCHAR(50) NULL DEFAULT '0', + ADD pp_gravatar VARCHAR(255) NOT NULL DEFAULT '' AFTER pp_reputation_points, + ADD pp_photo_type VARCHAR(20) NOT NULL DEFAULT '' AFTER pp_gravatar, + CHANGE pp_setting_count_visitors pp_setting_count_visitors TINYINT(1) NOT NULL DEFAULT '0';"; + +$SQL[] = "TRUNCATE TABLE content_cache_sigs;"; diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_5.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_5.php new file mode 100644 index 00000000..6080092e --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_5.php @@ -0,0 +1,42 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* Topic table changes */ + +$SQL[] = "ALTER TABLE topics ADD tdelete_time INT NOT NULL DEFAULT 0, + ADD moved_on INT NOT NULL DEFAULT '0', + ADD INDEX approved (approved,tdelete_time), + ADD INDEX moved_redirects ( moved_on, moved_to, pinned ), + DROP INDEX starter_id, + ADD INDEX starter_id ( starter_id, forum_id, approved, start_date );"; + +/* Populate 'like' from tracker */ +$SQL[] = "INSERT IGNORE INTO {$PRE}core_like + (like_id, like_lookup_id, like_lookup_area, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq, like_notify_sent, like_visible) + SELECT MD5(CONCAT('forums;forums;', forum_id, ';', member_id)), MD5(CONCAT('forums;forums;', forum_id)), MD5(CONCAT('forums;forums;', member_id)), 'forums', 'forums', forum_id, member_id, 0, start_date, CASE WHEN forum_track_type='none' THEN 0 ELSE 1 END, forum_track_type, last_sent, 1 + FROM {$PRE}forum_tracker;"; + +$SQL[] = "INSERT IGNORE INTO {$PRE}core_like + (like_id, like_lookup_id, like_lookup_area, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq, like_notify_sent, like_visible) + SELECT MD5(CONCAT('forums;topics;', topic_id, ';', member_id)), MD5(CONCAT('forums;topics;', topic_id)), MD5(CONCAT('forums;topics;', member_id)), 'forums', 'topics', topic_id, member_id, 0, start_date, CASE WHEN topic_track_type='none' THEN 0 ELSE 1 END, topic_track_type, last_sent, 1 + FROM {$PRE}tracker;"; + +$SQL[] = "DROP TABLE forum_tracker;"; +$SQL[] = "DROP TABLE tracker;"; + +$SQL[] = "TRUNCATE TABLE content_cache_posts;"; \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_6.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_6.php new file mode 100644 index 00000000..b9f0b031 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_6.php @@ -0,0 +1,34 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* Posts table */ + +$SQL[] = "ALTER TABLE posts CHANGE author_name author_name VARCHAR( 255 ) NULL DEFAULT NULL, + CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL, + ADD post_bwoptions INT(10) UNSIGNED NOT NULL DEFAULT 0, + ADD pdelete_time INT NOT NULL DEFAULT 0, + ADD post_field_int INT(10) NOT NULL DEFAULT 0, + ADD post_field_t1 TEXT NULL DEFAULT NULL, + ADD post_field_t2 TEXT NULL DEFAULT NULL, + DROP post_parent, + DROP INDEX author_id, + ADD INDEX author_id ( author_id , post_date , queued ), + ADD INDEX queued (queued,pdelete_time);"; + + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_1.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_1.php new file mode 100644 index 00000000..ed8786fc --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_1.php @@ -0,0 +1,25 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* spider logs table */ + +$TABLE = 'spider_logs'; +$SQL[] = "ALTER TABLE spider_logs CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL, + ADD request_addr TEXT NULL DEFAULT NULL;"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_10.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_10.php new file mode 100644 index 00000000..48b8b0cb --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_10.php @@ -0,0 +1,23 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + + +$TABLE = 'task_logs'; +$SQL[] = "ALTER TABLE task_logs CHANGE log_ip log_ip VARCHAR( 46 ) NOT NULL DEFAULT '0';"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_2.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_2.php new file mode 100644 index 00000000..9c0b850f --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_2.php @@ -0,0 +1,24 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +/* warn logs table */ + +$TABLE = 'warn_logs'; +$SQL[] = "ALTER TABLE warn_logs ADD INDEX ( wlog_mid, wlog_date );"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_3.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_3.php new file mode 100644 index 00000000..0a6ae70e --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_3.php @@ -0,0 +1,22 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +$TABLE = 'admin_login_logs'; +$SQL[] = "ALTER TABLE admin_login_logs CHANGE admin_ip_address admin_ip_address VARCHAR( 46 ) NOT NULL DEFAULT '0.0.0.0';"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_4.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_4.php new file mode 100644 index 00000000..19d40fa6 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_4.php @@ -0,0 +1,22 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +$TABLE = 'admin_logs'; +$SQL[] = "ALTER TABLE admin_logs CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_5.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_5.php new file mode 100644 index 00000000..e01ece0e --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_5.php @@ -0,0 +1,23 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + + +$TABLE = 'core_share_links_log'; +$SQL[] = "ALTER TABLE core_share_links_log CHANGE log_ip_address log_ip_address VARCHAR( 46 ) NOT NULL;"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_6.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_6.php new file mode 100644 index 00000000..f8016d68 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_6.php @@ -0,0 +1,22 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +$TABLE = 'dnames_change'; +$SQL[] = "ALTER TABLE dnames_change CHANGE dname_ip_address dname_ip_address VARCHAR( 46 ) NOT NULL;"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_7.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_7.php new file mode 100644 index 00000000..215fb4e2 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_7.php @@ -0,0 +1,24 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + + +$TABLE = 'error_logs'; +$SQL[] = "ALTER TABLE error_logs CHANGE log_ip_address log_ip_address VARCHAR( 46 ) NULL DEFAULT NULL, + CHANGE log_date log_date INT( 10 ) NOT NULL DEFAULT '0';"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_8.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_8.php new file mode 100644 index 00000000..36ab8fd5 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_8.php @@ -0,0 +1,24 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + + +$TABLE = 'moderator_logs'; +$SQL[] = "ALTER TABLE moderator_logs CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL DEFAULT '0', + CHANGE member_name member_name VARCHAR( 255 ) NOT NULL;"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_9.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_9.php new file mode 100644 index 00000000..cf00e5aa --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates_logs_9.php @@ -0,0 +1,23 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + + +$TABLE = 'spam_service_log'; +$SQL[] = "ALTER TABLE spam_service_log CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL;"; + + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/version_class.php b/upload/admin/applications/core/setup/versions/upg_32000/version_class.php new file mode 100644 index 00000000..ae78801f --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/version_class.php @@ -0,0 +1,112 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Upgrade Class + * + * Class to add options and notices for IP.Board upgrade + * Last Updated: $Date: 2011-05-25 14:58:10 -0400 (Wed, 25 May 2011) $ + * + * + * @author Matt Mecham + * @version $Rev: 8891 $ + * @since 3.0 + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @link http://hatynka.in + * @package IP.Board + */ + +class version_class_core_32000 +{ + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + } + + /** + * Add pre-upgrade options: Form + * + * @return string HTML block + */ + public function preInstallOptionsForm() + { + $_wrapper = "
      %s
    "; + $_html = ''; + $posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'posts' ) ); + + /* Got more than 100K posts? */ + if( $posts['total'] > 100000 ) + { +$_html .= << + + Внести изменение в структуру таблицы сообщений вручную? Ваш форум содержит более 100,000 сообщений. Мы крайне рекомендуем чтобы вы включили эту опцию для предотвращения возможных проблем при обновлении мастером обновления. В процессе обновления мастер на необходимом шаге выведет запросы, которые вы должны будете выполнить напрямую в базе данных, после чего вам достаточно будет обновить страницу и процесс будет продолжен. +
  • +EOF; + } + + if( $_html ) + { + return sprintf( $_wrapper, $_html ); + } + else + { + return ''; + } + } + + /** + * Add pre-upgrade options: Save + * + * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); + * + * @return array Key / value pairs to save + */ + public function preInstallOptionsSave() + { + return array( 'manualPostsTableQuery' => intval( $_REQUEST['manualPostsTableQuery'] ) + ); + } + + /** + * Return any post-installation notices + * + * @return array Array of notices + */ + public function postInstallNotices() + { + return array(); + } + + + /** + * Return any pre-installation notices + * + * @return array Array of notices + */ + public function preInstallNotices() + { + $notices = array(); + + $notices[] = "При обновлении будут удалены все XML стили."; + + return $notices; + + } +} + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php new file mode 100644 index 00000000..ca1fcde4 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php @@ -0,0 +1,980 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + case 'sql': + case 'sql1': + default: + $this->upgradeSql(1); + break; + case 'sql2': + $this->upgradeSql(2); + break; + case 'sql3': + $this->upgradeSql(3); + break; + case 'sql4': + $this->upgradeSql(4); + break; + case 'sql5': + $this->upgradeSql(5); + break; + case 'sql6': + $this->upgradeSql(6); + break; + + case 'logs': + case 'logs1': + $this->upgradeLogs(1); + break; + case 'logs2': + $this->upgradeLogs(2); + break; + case 'logs3': + $this->upgradeLogs(3); + break; + case 'logs4': + $this->upgradeLogs(4); + break; + case 'logs5': + $this->upgradeLogs(5); + break; + case 'logs6': + $this->upgradeLogs(6); + break; + case 'logs7': + $this->upgradeLogs(7); + break; + case 'logs8': + $this->upgradeLogs(8); + break; + case 'logs9': + $this->upgradeLogs(9); + break; + case 'logs10': + $this->upgradeLogs(10); + break; + + case 'forums': + $this->fixArchiveForums(); + break; + + case 'loginmethods': + $this->fixLoginMethods(); + break; + + case 'oldhooks': + $this->removeOldHooks(); + break; + + case 'xmlskin': + $this->removeXMLSkin(); + break; + + case 'setdefaultskin': + $this->setDefaultSkin(); + break; + + case 'hooks': + $this->convertHooks(); + break; + + case 'photos': + $this->convertPhotos(); + break; + } + + /* Workact is set in the function, so if it has not been set, then we're done. The last function should unset it. */ + if ( $this->request['workact'] ) + { + return false; + } + else + { + return true; + } + } + + /** + * Run SQL files + * + * @param int + * @return @e void + */ + public function upgradeSql( $id=1 ) + { + $cnt = 0; + $file = '_updates_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_32000/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + $sourceFile = ''; + $options = IPSSetUp::getSavedData('custom_options'); + $postTable = $options['core'][32000]['manualPostsTableQuery']; + + if ( is_file( $path ) ) + { + $SQL = array(); + + require( $path );/*noLibHook*/ + + /* Set DB driver to return any errors */ + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + $query = str_replace( "<%time%>", time(), $query ); + + if ( $this->settings['mysql_tbl_type'] ) + { + if ( preg_match( "/^create table(.+?)/i", $query ) ) + { + $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); + } + } + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + if( IPSSetUp::getSavedData('man') OR ( $id == 6 AND $postTable ) ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "
    " . $query . "
    " . $this->DB->error ); + } + else + { + $cnt++; + } + } + } + + $this->registry->output->addMessage("{$cnt} запросов выполнено...."); + } + + /* Next Page */ + if ( $id < 6 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'sql' . $nextid; + } + else + { + $this->request['workact'] = 'logs'; + } + + if ( $output ) + { + /* Create source file */ + if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) + { + $sourceFile = IPSSetUp::createSqlSourceFile( $output, '32000', $id ); + } + + $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); + } + } + + /** + * Upgrade log file tables + * + * @param int + * @return @e void + */ + public function upgradeLogs( $id=1 ) + { + /* Verify posts alter table query has run */ + if( $id == 1 ) + { + if( !$this->DB->checkForField( 'post_bwoptions', 'posts' ) ) + { + $this->_output = ' '; + $this->registry->output->addError( "Вы должны выполнить запрос изменяющий таблицу posts. После того как вы выполните это, просто обновите данную страницу и обновление будет продолжено." ); + return; + } + } + + $cnt = 0; + $file = '_updates_logs_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_32000/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + + if ( is_file( $path ) ) + { + $SQL = array(); + $TABLE = ''; + + require( $path );/*noLibHook*/ + + /* Set DB driver to return any errors */ + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + /* Chose to prune and run? */ + if( $this->request['pruneAndRun'] ) + { + $this->DB->delete( $TABLE ); + + $man = false; + } + else + { + /* Show alter table / prune option? */ + $man = IPSSetUp::getSavedData('man'); + + if( $TABLE ) + { + $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => $TABLE ) ); + + if( $count['logs'] > 100000 ) + { + $man = true; + } + } + } + + /* Show option to run manually or prune ? */ + if( $man ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "
    " . $query . "
    " . $this->DB->error ); + } + else + { + $cnt++; + } + } + } + + $this->registry->output->addMessage("{$cnt} запросов выполнено...."); + } + + /* Next Page */ + if ( $id < 10 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'logs' . $nextid; + } + else + { + $this->request['workact'] = 'forums'; + } + + if ( $output ) + { + $this->_output = $this->registry->output->template()->upgrade_manual_queries_logs( $output, $id, $TABLE ); + } + } + + /** + * Convert archive forums to read-only forums + * + * @return @e void + */ + public function fixArchiveForums() + { + /* Update array for archive forums */ + $_total = 0; + $_update = array( + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + ); + + /* Get 'archive' forums */ + $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'where' => 'status=0' ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $this->DB->update( 'permission_index', $_update, "app='forums' AND perm_type='forum' AND perm_type_id={$r['id']}" ); + + $_total++; + } + + /* Now drop the status field in forums table */ + $this->DB->dropField( 'forums', 'status' ); + + /* Message */ + $this->registry->output->addMessage("{$_total} форумов со статусом 'архивный' переведено в форумы только для чтения...."); + + /* Next Page */ + $this->request['workact'] = 'loginmethods'; + } + + /** + * Pull login method conf to DB + * + * @return @e void + */ + public function fixLoginMethods() + { + /* Init */ + $_total = 0; + + if( !defined('IPS_PATH_CUSTOM_LOGIN') ) + { + define( 'IPS_PATH_CUSTOM_LOGIN' , IPS_ROOT_PATH . 'sources/loginauth' ); + } + + /* Try to loop over all login methods to grab current configs */ + try + { + foreach( new DirectoryIterator( IPS_PATH_CUSTOM_LOGIN ) as $file ) + { + if ( $file->isDir() ) + { + if( file_exists( $file->getPathname() . '/conf.php' ) ) + { + $LOGIN_CONF = array(); + + include( $file->getPathname() . '/conf.php' );/*noLibHook*/ + + if( is_array($LOGIN_CONF) AND count($LOGIN_CONF) ) + { + $this->DB->update( 'login_methods', array( 'login_custom_config' => @serialize($LOGIN_CONF) ), "login_folder_name='" . $this->DB->addSlashes( $file->getFilename() ) . "'" ); + + $_total++; + } + } + } + } + } + catch( Exception $e ) + { + } + + /* Message */ + $this->registry->output->addMessage("{$_total} login method configs imported...."); + + /* Next Page */ + $this->request['workact'] = 'oldhooks'; + } + + /** + * Remove old hooks + * + * @return @e void + */ + public function removeOldHooks() + { + /* Hooks to remove */ + $hooks = array( 'watched_content', 'todays_top_posters', 'unread_notifications' ); + $_hookIds = array(); + $_total = 0; + + /* Get hook records */ + $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_key IN('" . implode( "','", $hooks ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_hookIds[] = $r['hook_id']; + } + + /* Remove associated files */ + if( count($_hookIds) ) + { + $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); + } + + /* Remove hook records */ + $this->DB->delete( 'core_hooks_files', 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + $this->DB->delete( 'core_hooks', 'hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + + $_total++; + } + + /* Message */ + $this->registry->output->addMessage("{$_total} устаревших хуков удалено...."); + + /* Next Page */ + $this->request['workact'] = 'xmlskin'; + } + + /** + * Remove the XML skin + * + * @return @e void + */ + public function removeXMLSkin() + { + /* Get skin functions library */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + + $skinFunctions = new skinCaching( $this->registry ); + + /* Uninstall any XML skins */ + $this->DB->build( array( 'select' => 'set_id', 'from' => 'skin_collections', 'where' => "set_output_format='xml'" ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $skinFunctions->removeSet( $r['set_id'], true ); + } + + /* Some extra cleanup */ + $this->DB->delete( 'skin_css', "css_group='ipb_board_index'" ); + $this->DB->delete( 'skin_css', "css_master_key='xmlskin'" ); + $this->DB->delete( 'skin_css_previous', "p_css_master_key='xmlskin'" ); + $this->DB->delete( 'skin_templates', "template_master_key='xmlskin'" ); + $this->DB->delete( 'skin_templates_previous', "p_template_master_key='xmlskin'" ); + + /* Message */ + $this->registry->output->addMessage("Устаревшие XML стили удалены..."); + + /* Next Page */ + $this->request['workact'] = 'setdefaultskin'; + } + + /** + * Restore IPB default skin as default + * + * @return @e void + */ + public function setDefaultSkin() + { + /* Get skin functions library */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + + $skinFunctions = new skinCaching( $this->registry ); + + /* Update members to use default skin */ + $this->DB->update( 'members', array( 'skin' => 0 ) ); + + /* Update forums to use default skin */ + $this->DB->update( 'forums', array( 'skin_id' => 0 ) ); + + /* Reset any default skin(s) */ + $this->DB->update( 'skin_collections', array( 'set_is_default' => 0 ) ); + + /* Set IPB default skin as default */ + $this->DB->update( 'skin_collections', array( 'set_is_default' => 1 ), "set_key='default'" ); + + /* Verify we have a skin set as default */ + $_check = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_collections', 'where' => 'set_is_default=1' ) ); + + if( $_check['total'] < 1 ) + { + $this->DB->build( array( 'update' => 'skin_collections', 'set' => 'set_is_default=1', 'where' => "set_output_format='html'", 'limit' => array( 0, 1 ) ) ); + $this->DB->execute(); + } + + /* Check for any modifications in IPB default skin */ + $_master = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_collections', 'where' => "set_key='default'" ) ); + $_master['set_id'] = intval($_master['set_id']); + $_modifiedTemplates = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_templates', 'where' => "template_set_id={$_master['set_id']} AND template_removable=1 OR template_user_edited=1" ) ); + $_modifiedCSS = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_css', 'where' => "css_set_id={$_master['set_id']} AND css_master_key=''" ) ); + + if( $_modifiedTemplates['total'] OR $_modifiedCSS['total'] ) + { + /* Create a new skin with IPB default as parent */ + $curPos = $skinFunctions->fetchHighestSetPosition(); + + $_master['set_key'] = 'default_modified'; + $_master['set_parent_id'] = $_master['set_id']; + $_master['set_is_default'] = 0; + $_master['set_name'] = $_master['set_name'] . ' (Pre 3.2)'; + $_master['set_order'] = (int)$curPos++; + unset($_master['set_id']); + + $this->DB->insert( 'skin_collections', $_master ); + $set_id = $this->DB->getInsertId(); + + $this->DB->update( 'skin_templates', array( 'template_set_id' => $set_id ), "template_set_id={$_master['set_parent_id']} AND template_removable=1 OR template_user_edited=1" ); + $this->DB->update( 'skin_css', array( 'css_set_id' => $set_id ), "css_set_id={$_master['set_parent_id']} AND css_master_key=''" ); + + $skinFunctions->rebuildSkinSetsCache(); + $skinFunctions->rebuildTreeInformation( $set_id ); + //$skinFunctions->flushSkinData(); + + $skinFunctions->rebuildCSS( $set_id ); + $skinFunctions->rebuildPHPTemplates( $set_id ); + $skinFunctions->rebuildReplacementsCache( $set_id ); + } + + /* Message */ + $this->registry->output->addMessage("Восстановлен новый базовый стиль...."); + + /* Next Page */ + $this->request['workact'] = 'hooks'; + } + + /** + * Convert stored hook data + * + * @return @e void + */ + public function convertHooks() + { + $_total = 0; + + /* Grab all hooks */ + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); + $outer = $this->DB->execute(); + + while( $hook = $this->DB->fetch($outer) ) + { + $_extraData = unserialize($hook['hook_extra_data']); + + /* Fix setting groups */ + if( is_array($_extraData['settingGroups']) AND count($_extraData['settingGroups']) ) + { + $_settingGroups = array(); + + foreach( $_extraData['settingGroups'] as $_group ) + { + if( intval($_group) == $_group ) + { + $_settingGroups[ $_group ] = intval($_group); + } + } + + if( count($_settingGroups) ) + { + $_extraData['settingGroups'] = array(); + + $this->DB->build( array( 'select' => 'conf_title_id, conf_title_keyword', 'from' => 'core_sys_settings_titles' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['conf_title_id'], $_settingGroups ) ) + { + $_extraData['settingGroups'][] = $r['conf_title_keyword']; + } + } + } + } + + /* Fix settings */ + if( is_array($_extraData['settings']) AND count($_extraData['settings']) ) + { + $_settings = array(); + + foreach( $_extraData['settings'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_settings[ $_id ] = intval($_id); + } + } + + if( count($_settings) ) + { + $_extraData['settings'] = array(); + + $this->DB->build( array( 'select' => 'conf_id, conf_key', 'from' => 'core_sys_conf_settings' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['conf_id'], $_settings ) ) + { + $_extraData['settings'][] = $r['conf_key']; + } + } + } + } + + /* Fix tasks */ + if( is_array($_extraData['tasks']) AND count($_extraData['tasks']) ) + { + $_tasks = array(); + + foreach( $_extraData['tasks'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_tasks[ $_id ] = intval($_id); + } + } + + if( count($_tasks) ) + { + $_extraData['tasks'] = array(); + + $this->DB->build( array( 'select' => 'task_id, task_key', 'from' => 'task_manager' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['task_id'], $_tasks ) ) + { + $_extraData['tasks'][] = $r['task_key']; + } + } + } + } + + /* Fix help files */ + if( is_array($_extraData['help']) AND count($_extraData['help']) ) + { + $_help = array(); + + foreach( $_extraData['help'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_help[ $_id ] = intval($_id); + } + } + + if( count($_help) ) + { + $_extraData['help'] = array(); + + $this->DB->build( array( 'select' => 'id, title', 'from' => 'faq' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['id'], $_help ) ) + { + $_extraData['help'][] = $r['title']; + } + } + } + } + + /* Fix modules */ + if( is_array($_extraData['modules']) AND count($_extraData['modules']) ) + { + $_modules = array(); + + foreach( $_extraData['modules'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_modules[ $_id ] = intval($_id); + } + } + + if( count($_modules) ) + { + $_extraData['modules'] = array(); + + $this->DB->build( array( 'select' => 'sys_module_id, sys_module_admin, sys_module_application, sys_module_key', 'from' => 'core_sys_module' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['sys_module_id'], $_modules ) ) + { + $_extraData['modules'][] = ( $r['sys_module_admin'] ? 'admin' : 'public' ) . '-' . $r['sys_module_application'] . '-' . $r['sys_module_key']; + } + } + } + } + + /* Fix templates */ + if( is_array($_extraData['templates']) AND count($_extraData['templates']) ) + { + $_newTemplates = array(); + + foreach( $_extraData['templates'] as $file => $templates ) + { + foreach( $templates as $template ) + { + $_newTemplates[ $file ][ $template ] = $template; + } + } + + $_extraData['templates'] = $_newTemplates; + } + + /* Fix CSS */ + if( is_array($_extraData['css']) AND count($_extraData['css']) ) + { + $_css = array(); + + foreach( $_extraData['css'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_css[ $_id ] = intval($_id); + } + } + + if( count($_css) ) + { + $_extraData['css'] = array(); + + $this->DB->build( array( 'select' => 'css_group', 'from' => 'skin_css', 'where' => "css_id IN(" . implode( ',', $_css ) . ")" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_extraData['css'][ $r['css_group'] ] = $r['css_group']; + } + } + } + + $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $_extraData ) ), 'hook_id=' . $hook['hook_id'] ); + + $_total++; + } + + /* Message */ + $this->registry->output->addMessage("{$_total} хуков обновлено...."); + + /* Next Page */ + $this->request['workact'] = 'photos'; + } + + /** + * Convert and rebuild photos + * + * @param int + * @return @e void + */ + public function convertPhotos() + { + /* Is this the first cycle? */ + if( !$this->request['from'] ) + { + $this->_output = <<Конвертация фотографий +
    + IP.Board 3.2 теперь использует только одно изображение для идентификации пользователя. Вы должны выбрать, что именно (аватар или фотография из профиля) будет сохранено и использовано новой версией. +
    + +
    + В процессе конвертации также будут изменены размеры существующих изображений и созданы новые превью. Вы можете отложить этот процесс, отметив чекбокс. Процесс перестроения изображений может быть запущен вами после обновления в админ-центре форума. +

    + Перестроить сейчас
    + Пропустить +EOF; + + return; + } + + /* Our options */ + $convertFrom = $this->request['from'] == 'avatars' ? 'avatars' : 'photos'; + $skipRebuild = intval($this->request['skip']); + + /* Init */ + $st = intval($this->request['st']); + $did = 0; + $each = 200; + + require_once( IPS_ROOT_PATH . 'sources/classes/member/photo.php' );/*noLibHook*/ + $photo = new classes_member_photo( $this->registry ); + + /* Loop over members */ + $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'limit' => array( $st, $each ) ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $did++; + + $update = array(); + + if( $r['fb_photo'] ) + { + $update['pp_photo_type'] = 'facebook'; + } + else if( $r['tc_photo'] ) + { + $update['pp_photo_type'] = 'twitter'; + } + else + { + if( $convertFrom == 'avatars' ) + { + if( $r['avatar_type'] == 'upload' AND $r['avatar_location'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['avatar_location']; + $_dims = @getimagesize( $this->settings['upload_dir'] . '/' . $r['avatar_location'] ); + $update['pp_main_width'] = $_dims[0] ? $_dims[0] : 1; + $update['pp_main_height'] = $_dims[1] ? $_dims[1] : 1; + } + else if( $r['avatar_type'] == 'gravatar' ) + { + $update['pp_photo_type'] = 'gravatar'; + $update['pp_gravatar'] = $r['avatar_location']; + + $md5Gravatar = md5( $update['pp_gravatar'] ); + + $_url = "http://www.gravatar.com"; + + if( $this->registry->output->isHTTPS ) + { + $_url = "https://secure.gravatar.com"; + } + + $update['pp_main_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_main_width'] = 100; + $update['pp_main_height'] = 100; + $update['pp_thumb_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_thumb_width'] = 100; + $update['pp_thumb_height'] = 100; + } + } + else + { + if( $r['pp_main_photo'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['pp_main_photo']; + } + } + } + + if( !$skipRebuild AND $update['pp_photo_type'] == 'custom' ) + { + $info = $photo->buildSizedPhotos( str_replace( 'upload:', '', $update['pp_main_photo'] ), $r['pp_member_id'], true ); + + $update['pp_main_width'] = intval( $info['final_width'] ); + $update['pp_main_height'] = intval( $info['final_height'] ); + $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; + $update['pp_thumb_width'] = intval( $info['t_final_width'] ); + $update['pp_thumb_height'] = intval( $info['t_final_height'] ); + } + + if( count($update) ) + { + $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); + } + } + + /* Show message and redirect */ + if( $did > 0 ) + { + $this->request['st'] = ( $st + $did ); + $this->request['workact'] = 'photos'; + + $message = $skipRebuild ? "{$this->request['st']} фотографий сконвертировано ..." : "{$this->request['st']} фотографий сконвертировано и перестроено..."; + $this->registry->output->addMessage( $message ); + + /* Yes, we are being sneaky here. Shhhhh */ + $this->request['st'] = $this->request['st'] . '&from=' . $this->request['from'] . '&skip=' . $skipRebuild; + } + else + { + $this->request['st'] = 0; + $this->request['workact'] = ''; + + $this->registry->output->addMessage( "Все фотографии сконвертированы..." ); + } + + /* Next Page */ + return; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32001/index.html b/upload/admin/applications/core/setup/versions/upg_32001/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32001/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php new file mode 100644 index 00000000..75032822 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php @@ -0,0 +1,42 @@ +getPrefix()); +$DB = ipsRegistry::DB(); + +$SQL[] = "ALTER TABLE cache_simple CHANGE cache_data cache_data MEDIUMTEXT NULL DEFAULT NULL;"; +$SQL[] = "UPDATE groups SET g_photo_max_vars=REPLACE(g_photo_max_vars, ':150:150', ':200:300') WHERE g_photo_max_vars LIKE '%:150:150';"; + +if ( ! $DB->checkForTable('skin_generator_sessions') ) +{ + /* Skin generator */ + $SQL[] = "CREATE TABLE skin_generator_sessions ( + sg_session_id VARCHAR(32) NOT NULL DEFAULT '', + sg_member_id INT(10) NOT NULL DEFAULT 0, + sg_skin_set_id INT(10) NOT NULL DEFAULT 0, + sg_date_start INT(10) NOT NULL DEFAULT 0, + sg_data MEDIUMTEXT, + PRIMARY KEY (sg_session_id) +);"; +} + +$SQL[] = "ALTER TABLE skin_collections ADD set_by_skin_gen INT(1) NOT NULL DEFAULT 0, ADD set_skin_gen_data MEDIUMTEXT;"; + +$SQL[] = "INSERT INTO core_share_links (share_title, share_key, share_enabled, share_position, share_canonical) VALUES('Google Plus One', 'googleplusone', 1, 2, 1);"; +$SQL[] = "DELETE FROM core_share_links WHERE share_key='buzz';"; + +$SQL[] = "DROP TABLE IF EXISTS vkontakte_connect;"; +$SQL[] = "ALTER TABLE members ADD vk_token TEXT NULL;"; +$SQL[] = "ALTER TABLE profile_portal ADD vk_bwoptions INT UNSIGNED NOT NULL DEFAULT '0';"; \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32001/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_32001/version_upgrade.php new file mode 100644 index 00000000..b502e502 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32001/version_upgrade.php @@ -0,0 +1,117 @@ +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + default: + case 'oldhooks': + $this->removeOldHooks(); + break; + } + + return true; + } + + /** + * Remove old hooks + * + * @return @e void + */ + public function removeOldHooks() + { + /* Hooks to remove */ + $hooks = array( 'sharelinks', 'fb_like' ); + $_hookIds = array(); + $_total = 0; + + /* Get hook records */ + $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_key IN('" . implode( "','", $hooks ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_hookIds[] = $r['hook_id']; + } + + /* Remove associated files */ + if( count($_hookIds) ) + { + $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); + } + + /* Remove hook records */ + $this->DB->delete( 'core_hooks_files', 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + $this->DB->delete( 'core_hooks', 'hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + + $_total++; + } + + /* Message */ + $this->registry->output->addMessage("{$_total} outdated hook(s) uninstalled...."); + + /* Next Page */ + $this->request['workact'] = ''; + } +} \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32002/index.html b/upload/admin/applications/core/setup/versions/upg_32002/index.html new file mode 100644 index 00000000..b09595ca --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32002/index.html @@ -0,0 +1,10 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php new file mode 100644 index 00000000..2f84c780 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php @@ -0,0 +1,17 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php new file mode 100644 index 00000000..cb8e4394 --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php @@ -0,0 +1,17 @@ + +IP.Board - Bulletin Board System + +

    403: IP.Board -> Forbidden

    +
    +You have reached this page in error, please use your back button to return to the forum. +
    +IP.Board + + \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php new file mode 100644 index 00000000..119a92bc --- /dev/null +++ b/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php @@ -0,0 +1,22 @@ + * Invision Power Services - * IP.Board v3.1.4 + * IP.Board v3.2.3 * Admin log skin file - * Last Updated: $Date: 2010-06-24 05:36:05 -0400 (Thu, 24 Jun 2010) $ + * Last Updated: $Date: 2011-07-26 04:00:17 -0400 (Tue, 26 Jul 2011) $ * * - * @author $Author: matt $ + * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6570 $ + * @version $Revision: 9317 $ */ -class cp_skin_adminlogs extends output +class cp_skin_adminlogs { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Show the splash screen for the logs * - * @access public * @return string HTML */ public function logSplashScreen() { @@ -44,20 +74,58 @@ $IPBHTML .= <<

    {$this->lang->words['choose_splash']}

    - - - - - - - - - - - - - - +
    {$this->lang->words['error_log_thelogs']}
    {$this->lang->words['alog_adminlogs']}
    {$this->lang->words['mlog_modlogs']}
    {$this->lang->words['elog_emaillogs']}
    {$this->lang->words['elog_email_err_logs']}
    {$this->lang->words['slog_spider_logs']}
    {$this->lang->words['wlog_warn_logs']}
    {$this->lang->words['api_error_logs']}
    {$this->lang->words['sched_error_logs']}
    {$this->lang->words['al_error_logs']}
    {$this->lang->words['slog_spamlogs']}
    {$this->lang->words['mlog_mobilelogs']}
    {$this->lang->words['mlog_sqlerrors']}
    +HTML; +if ( $this->registry->class_permissions->checkPermission( 'errorlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} +if ( $this->registry->class_permissions->checkPermission( 'adminlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} +if ( $this->registry->class_permissions->checkPermission( 'modlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} +if ( $this->registry->class_permissions->checkPermission( 'emailerrorlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} +if ( $this->registry->class_permissions->checkPermission( 'spiderlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} +if ( $this->registry->class_permissions->checkPermission( 'warnlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} +$IPBHTML .= << + + + + +HTML; +if ( $this->registry->class_permissions->checkPermission( 'sqlerrorlogs_view' ) ) +{ + $IPBHTML .= << +HTML; +} + $IPBHTML .= << HTML; @@ -69,7 +137,6 @@ return $IPBHTML; /** * Show the splash screen for the admin logs * - * @access public * @param array Rows * @param array Admins * @return string HTML @@ -100,7 +167,7 @@ $IPBHTML .= <<

    {$this->lang->words['alog_last5']}

    -
    {$this->lang->words['error_log_thelogs']}
    {$this->lang->words['alog_adminlogs']}
    {$this->lang->words['mlog_modlogs']}
    {$this->lang->words['elog_email_err_logs']}
    {$this->lang->words['slog_spider_logs']}
    {$this->lang->words['wlog_warn_logs']}
    {$this->lang->words['api_error_logs']}
    {$this->lang->words['sched_error_logs']}
    {$this->lang->words['al_error_logs']}
    {$this->lang->words['slog_spamlogs']}
    {$this->lang->words['mlog_mobilelogs']}
    {$this->lang->words['mlog_sqlerrors']}
    +
    @@ -115,8 +182,8 @@ if( count($rows) AND is_array($rows) ) { $IPBHTML .= << - - + + @@ -139,12 +206,12 @@ $IPBHTML .= <<

    {$this->lang->words['alog_saved']}

    -
    {$this->lang->words['alog_member']} {$this->lang->words['alog_performed']}{$row['members_display_name']}{$row['note']}{$row['members_display_name']}{$row['note']} {$row['_time']} {$row['ip_address']}
    +
    - - + + - + HTML; @@ -154,10 +221,10 @@ if( count($admins) AND is_array($admins) ) { $IPBHTML .= << - + - - + + HTML; } @@ -182,16 +249,16 @@ $IPBHTML .= <<

    {$this->lang->words['alog_search']}

    -
      -
    • - - {$form['search_for']} -
    • -
    • - - {$form['search_in']} -
    • -
    +
    {$this->lang->words['alog_member']}{$this->lang->words['alog_performed']}{$this->lang->words['alog_member']}{$this->lang->words['alog_performed']} {$this->lang->words['alog_viewall']}{$this->lang->words['alog_removeall']}{$this->lang->words['alog_removeall']}
    {$row['members_display_name']}{$row['members_display_name']} {$row['act_count']}form_code}&do=view&mid={$row['member_id']}'>{$this->lang->words['alog_view']}form_code}&do=remove&mid={$row['member_id']}'>{$this->lang->words['alog_remove']}form_code}&do=view&mid={$row['member_id']}'>{$this->lang->words['alog_view']}form_code}&do=remove&mid={$row['member_id']}'>{$this->lang->words['alog_remove']}
    + + + + + + + + +
    {$this->lang->words['alog_searchfor']}{$form['search_for']}
    {$this->lang->words['alog_searchin']}{$form['search_in']}
    @@ -207,12 +274,11 @@ return $IPBHTML; /** * SQL log RAPPER LIKE ICE T BUT MORE LIKE COFFEE * - * @access public * @param array Rows * @param string Page links * @return string HTML */ -public function sqllogsWrapper( $rows ) { +public function sqllogsWrapper( $rows, $latestError ) { $IPBHTML = ""; //--starthtml--// @@ -220,11 +286,30 @@ $IPBHTML = ""; $IPBHTML .= <<

    {$this->lang->words['sqllog_title']}

    +
    +HTML; +if ( $latestError ) +{ + $IPBHTML .= << + $latestError + +
    +HTML; +} +$IPBHTML .= <<

    {$this->lang->words['sqllog_title']}

    - +
    @@ -243,11 +328,11 @@ if( count($rows) AND is_array($rows) ) $IPBHTML .= << - - + + - + HTML; } @@ -278,11 +363,8 @@ return $IPBHTML; /** * View a log * - * @access public */ -public function sqlLogsView( $file, $size, $content ) { - -$tailSize = IPSLib::strlenToBytes( strlen( $content ) ); +public function sqlLogsView( $file, $size, $content, $tailSize ) { /* Display a message? */ if ( $tailSize < $size ) @@ -300,7 +382,7 @@ $IPBHTML .= <<

    {$file}

    -
    +
    {$content}
    @@ -313,7 +395,6 @@ return $IPBHTML; /** * View an individual admin's logs * - * @access public * @param array Rows * @param string Page links * @return string HTML @@ -330,7 +411,7 @@ $IPBHTML .= <<

    {$this->lang->words['alog_saved']}

    -
      {$this->lang->words['sqllog_name']}{$row['name']}{$row['name']} {$mtime} {$size}
    +
    @@ -365,7 +446,8 @@ HTML; $IPBHTML .= <<
    -
    {$pages}
    +
    {$pages}
    +

    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_api.php b/upload/admin/applications/core/skin_cp/cp_skin_api.php index 403dba6e..025c8698 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_api.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_api.php @@ -2,39 +2,68 @@ /** *
      * Invision Power Services
    - * IP.Board v3.1.4
    + * IP.Board v3.2.3
      * API users skin file
    - * Last Updated: $Date: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
    + * Last Updated: $Date: 2011-05-11 12:57:46 -0400 (Wed, 11 May 2011) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6925 $ + * @version $Revision: 8727 $ */ -class cp_skin_api extends output +class cp_skin_api { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} - + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * View api log details * - * @access public * @param array Log record * @return string HTML */ @@ -45,41 +74,38 @@ $IPBHTML = ""; $IPBHTML .= << -

    {$this->lang->words['a_detail']}

    -
    {$this->lang->words['alog_member']} {$this->lang->words['alog_performed']}
    +

    {$this->lang->words['a_detail']}

    +
    - - -
    -
    - {$this->lang->words['a_basics']} - - - - - - - - - - - - - - - - - -
    {$this->lang->words['a_key']}{$log['api_log_key']}
    {$this->lang->words['a_ip']}{$log['api_log_ip']}
    {$this->lang->words['a_time']}{$log['_api_log_date']}
    {$this->lang->words['a_success']}-
    -
    -
    -
    - {$this->lang->words['a_formdata']} -
    - {$log['_api_log_query']} -
    -
    -
    + {$this->lang->words['a_basics']} + + + {$this->lang->words['a_key']} + {$log['api_log_key']} + + + {$this->lang->words['a_ip']} + {$log['api_log_ip']} + + + {$this->lang->words['a_time']} + {$log['_api_log_date']} + + + {$this->lang->words['a_success']} + - + + + {$this->lang->words['a_formdata']} + + + +
    + {$log['_api_log_query']} +
    + + + EOF; @@ -90,7 +116,6 @@ return $IPBHTML; /** * View API login logs * - * @access public * @param array Rows * @param string Page links * @return string HTML @@ -107,7 +132,7 @@ $IPBHTML .= <<

    {$this->lang->words['a_requestlog']}

    - +
    @@ -130,7 +155,7 @@ $IPBHTML .= <<{$r['api_log_key']} - + @@ -140,7 +165,10 @@ EOF; } $IPBHTML .= << -
    {$links}
    +
    +
    {$links}
    +
    +
    EOF; @@ -151,7 +179,6 @@ return $IPBHTML; /** * List the api users * - * @access public * @param array Rows * @return string HTML */ @@ -160,25 +187,37 @@ public function api_list( $api_users ) { $IPBHTML = ""; //--starthtml--// +if ( ! $this->settings['xmlrpc_enable'] ){ + $status = "{$this->lang->words['perf_off']}"; +} else { + $status = "{$this->lang->words['perf_on']}"; +} + $IPBHTML .= <<

    {$this->lang->words['a_users']}

    - +
    + +

    {$this->lang->words['a_users']}

    -
      {$this->lang->words['a_key']}
    {$r['api_log_ip']}
    {$r['_api_log_date']}-- -
    +
    - - + EOF; @@ -187,16 +226,23 @@ if ( count( $api_users ) ) foreach( $api_users as $user ) { $IPBHTML .= << - + @@ -206,8 +252,9 @@ EOF; else { $IPBHTML .= << - + + EOF; } @@ -224,7 +271,6 @@ return $IPBHTML; /** * Form to add/edit an API user * - * @access public * @param array Form elements * @param string Form title * @param string Action code @@ -241,98 +287,117 @@ $IPBHTML = ""; $IPBHTML .= <<form_code}&do=$formcode&api_user_id={$api_user['api_user_id']}' method='post'> +
    form_code}&do={$formcode}&api_user_id={$api_user['api_user_id']}' method='post'>
    -

    $title

    +

    {$title}

    -
      -
    • +
      {$this->lang->words['a_user']} {$this->lang->words['a_key']} {$this->lang->words['a_ip']}{$this->lang->words['a_options']}
    {$user['api_user_name']} {$user['api_user_key']} {$user['api_user_ip']} - - {$this->lang->words[ - +
    {$this->lang->words['a_nousers']}
    form_code}&do=api_add'>{$this->lang->words['a_createone']}
    + {$this->lang->words['a_nousers']} form_code}&do=api_add' class='mini_button'>{$this->lang->words['a_createone']}
    + + + EOF; if ( $type == 'add' ) { $IPBHTML .= << - - - {$form['_api_user_key']} - + + + + EOF; } $IPBHTML .= << - - {$form['api_user_name']} - -
  • - - {$form['api_user_ip']} -
  • - - -
    -
    -
      +
    + + + + + + + + + + +
    {$this->lang->words['a_userbasics']}
    + {$this->lang->words['a_userkey']} + + + {$form['_api_user_key']}
    + {$this->lang->words['a_key_info']} +
    + {$this->lang->words['a_usertitle']} + + {$form['api_user_name']}
    + {$this->lang->words['a_usertitle_info']} +
    + {$this->lang->words['a_restrictip']} + + {$form['api_user_ip']}
    + {$this->lang->words['a_restrictip_info']} +
    Select functions to which you grant access
    EOF; if ( is_array( $permissions ) AND count( $permissions ) ) { + $IPBHTML .= << + « + » +
      +HTML; + foreach( $permissions as $key => $data ) { $IPBHTML .= <<{$data['title']} +
    • {$data['title']}
    • EOF; } -} -$IPBHTML .= << - - + $IPBHTML .= << + +
      EOF; -if ( is_array( $permissions ) AND count( $permissions ) ) -{ foreach( $permissions as $key => $data ) { $IPBHTML .= << -
        +
        + EOF; if ( is_array( $permissions[ $key ]['form_perms'] ) AND ( $permissions[ $key ]['form_perms'] ) ) { foreach( $permissions[ $key ]['form_perms'] as $perm => $_data ) { $IPBHTML .= << - - {$_data['form']} - + + + + EOF; } } $IPBHTML .= << - +
        + + + {$_data['form']}   {$_data['title']} +
        +
        EOF; } + } $IPBHTML .= << + +
        -
        - -
        +
      diff --git a/upload/admin/applications/core/skin_cp/cp_skin_applications.php b/upload/admin/applications/core/skin_cp/cp_skin_applications.php index 2ebd5ed2..ec11780b 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_applications.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_applications.php @@ -2,38 +2,67 @@ /** *
        * Invision Power Services
      - * IP.Board v3.1.4
      + * IP.Board v3.2.3
        * Applications skin file
      - * Last Updated: $Date: 2010-11-17 08:24:42 -0500 (Wed, 17 Nov 2010) $
      + * Last Updated: $Date: 2011-09-01 17:55:10 -0400 (Thu, 01 Sep 2011) $
        * 
      * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 7205 $ + * @version $Revision: 9441 $ */ -class cp_skin_applications extends output +class cp_skin_applications { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} - + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Add/edit module form * - * @access public * @param array Form elements * @param string Form title * @param string Action code @@ -58,47 +87,77 @@ $IPBHTML .= <<

      {$this->lang->words['a_modules']}

      -
        -
      • - - {$form['sys_module_admin']} -
      • -
      • - - {$form['sys_module_title']} -
      • -
      • - - {$form['sys_module_description']} -
      • -
      • - - {$form['sys_module_key']} -
      • -
      • - - {$form['sys_module_version']} -
      • -
      • - - {$form['sys_module_visible']} -
      • + + + + + + + + + + + + + + + + + + + + + + + + + EOF; if ( IN_DEV ) { $IPBHTML .= << - - {$form['sys_module_protected']} - + + + + EOF; } $IPBHTML .= << +
        + {$this->lang->words['a_modtype']} + + {$form['sys_module_admin']} +
        + {$this->lang->words['a_modtitle']} + + {$form['sys_module_title']} +
        + {$this->lang->words['a_moddesc']} + + {$form['sys_module_description']} +
        + {$this->lang->words['a_modkey']} + + {$form['sys_module_key']}
        + {$this->lang->words['a_modkey_info']} +
        + {$this->lang->words['a_modver']} + + {$form['sys_module_version']}
        + {$this->lang->words['a_modver_info']} +
        + {$this->lang->words['a_moden']} + + {$form['sys_module_visible']}
        + {$this->lang->words['a_moden_info']} +
        + {$this->lang->words['a_modprot']} + + {$form['sys_module_protected']}
        + {$this->lang->words['a_modprot_info']} +
        -
        - -
        +
        @@ -111,7 +170,6 @@ return $IPBHTML; /** * List the modules * - * @access public * @param array Modules * @param array Application * @param boolean Is an admin module? @@ -129,14 +187,14 @@ $IPBHTML .= <<{$_type} {$this->lang->words['a_modules']} «{$application['app_title']}»

        {$application['app_title']} > {$_type} {$this->lang->words['a_modules']}

        - + + EOF; } } else { $IPBHTML .= << - {$this->lang->words['a_nomods']} - + + + {$this->lang->words['a_nomods']} + + EOF; } $IPBHTML .= << +

        - +
        form_code}&do=module_import' enctype='multipart/form-data' method='post'>

        {$this->lang->words['a_importxml']}

        -
          -
        • - - -
        • -
        • - - -
        • -
        + + + + + + + + + +
        {$this->lang->words['a_uploadxml']}
        {$this->lang->words['a_uploadxml_info']}
        {$this->lang->words['a_filexml']}
        {$this->lang->words['a_filexml_info']}
        -
        - -
        +
        @@ -260,7 +306,6 @@ return $IPBHTML; /** * Form to add/edit an application * - * @access public * @param array Form elements * @param string Form title * @param string Action code @@ -278,98 +323,165 @@ $IPBHTML .= <<{$this->lang->words['a_apps']} -
        form_code}&do={$formcode}&app_id={$application['app_id']}' method='POST'> +form_code}do={$formcode}&app_id={$application['app_id']}' method='POST'>
        -

        $title

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

        {$title}

        + +
        +
          +
        • {$this->lang->words['app_tab_info']}
        • +
        • {$this->lang->words['app_tab_permissions']}
        • +
        • {$this->lang->words['app_tab_gcaches']}
        • +
        +
        + +
        + + +
        +
        -
        - {$this->lang->words['a_apptitle_info']} -
        - {$form['app_title']} -
        -
        - {$this->lang->words['a_appptitle_info']} -
        - {$form['app_public_title']} -
        -
        - {$this->lang->words['a_appphide_desc']} -
        - {$form['app_hide_tab']} -
        -
        - {$this->lang->words['a_appdesc_info']} -
        - {$form['app_description']} -
        - - - {$form['app_author']} -
        - - - {$form['app_version']} -
        -
        - {$this->lang->words['a_appdir_info']} -
        - {$form['app_directory']} -
        - - - {$form['app_enabled']} -
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + EOF; -if ( IN_DEV ) -{ -$IPBHTML .= << - - - + if ( IN_DEV ) + { + $IPBHTML .= << + + + EOF; -} + } + $IPBHTML .= << + + + + + + + + +
        + {$this->lang->words['a_apptitle']} + + {$form['app_title']} +
        + {$this->lang->words['a_appptitle']} + + {$form['app_public_title']}
        + {$this->lang->words['a_appptitle_info']} +
        + {$this->lang->words['a_appen']} + + {$form['app_enabled']} +
        + {$this->lang->words['a_appdesc']} + + {$form['app_description']} +
        + {$this->lang->words['a_appauthor']} + + {$form['app_author']} +
        + {$this->lang->words['a_appver']} + + {$form['app_version']} +
        + {$this->lang->words['a_appdir']} + + {$form['app_directory']}
        + {$this->lang->words['a_appdir_info']} +
        -
        - {$this->lang->words['a_appprot_info']} -
        - {$form['app_protected']} -
        + {$this->lang->words['a_appprot']} + + {$form['app_protected']}
        + {$this->lang->words['a_appprot_info']} +
        + {$this->lang->words['a_hooksite']} + + {$form['app_website']}
        + {$this->lang->words['a_hooksite_info']} +
        + {$this->lang->words['a_hookurl']} + + {$form['app_update_check']}
        + {$this->lang->words['a_appurl_info']} +
        +
        + + +
        + + + + + + + + + +
        + {$this->lang->words['a_appphide']} + + {$form['app_hide_tab']}
        + {$this->lang->words['a_appphide_desc']} +
        + {$this->lang->words['app_form_tabgroups']} + + {$form['app_tab_groups']}
        + {$this->lang->words['app_form_tabgroups_desc']} +
        +
        + + +
        + + + + + +
        + {$this->lang->words['hook_form_caches']} + + {$form['app_global_caches']}
        + {$this->lang->words['hook_form_caches_desc']} +
        +
        + + + +
        - +
        @@ -384,86 +496,88 @@ return $IPBHTML; /** * List the applications * - * @access public * @param array Application * @param array Uninstalled applications * @return string HTML */ -public function applications_list( $applications, $uninstalled=array() ) { +public function applications_list( $applications, $uninstalled=array(), $message=NULL ) { $IPBHTML = ""; //--starthtml--// -if( !IPSLib::appIsInstalled('nexus', false) OR !IPSLib::appIsInstalled('blog', false) OR !IPSLib::appIsInstalled('gallery', false) OR !IPSLib::appIsInstalled('ccs', false) OR !IPSLib::appIsInstalled('downloads', false) OR !$this->settings['ips_cp_purchase'] ) -{ +$canInstall = $this->registry->class_permissions->checkPermission( 'app_install' ); + $IPBHTML .= << -

        {$this->lang->words['purchase_additional']}

        - -EOF; - -foreach( array('nexus','blog','gallery','ccs','downloads') as $__app ) -{ - if( !IPSLib::appIsInstalled( $__app, false ) ) - { - $_app_name = $__app == 'ccs' ? 'Content' : ucfirst($__app); - - $IPBHTML .= << - - IP.{$_app_name} - -EOF; - } -} - - if( !$this->settings['ips_cp_purchase'] ) - { - $IPBHTML .= << - - Удаление копирайта - -EOF; - } -} - -$IPBHTML .= <<

        {$this->lang->words['a_apps']}

        -
          -
        • {$this->lang->words['a_addnewapp']}
        • -
        • {$this->lang->words['recache_link']}
        • -
        • {$this->lang->words['rebuild_furl_link']}
        • -
        • {$this->lang->words['export_xml']}
        • + +
          + +
          + + +EOF; + +if ( $message ) +{ + $IPBHTML .= "
          {$message}

          "; } $IPBHTML .= << - - -
          +

          {$this->lang->words['a_installedapps']}

          -
          - - - - - - - - - - -
            {$this->lang->words['a_app']}{$this->lang->words['a_status']}{$this->lang->words['a_version']}{$this->lang->words['a_enabled']} 
          -
          + EOF; $incrementer = 1; @@ -488,118 +602,118 @@ foreach( $applications as $local => $apps ) $app['titlePrefix'] = $this->lang->words['a_rootapps']; } - -$IPBHTML .= << -
        • - {$app['titlePrefix']} -
        • - + $IPBHTML .= << + +   + + {$app['titlePrefix']} + + EOF; - foreach( $apps as $app ) - { - $img = file_exists( IPSLib::getAppDir( $app['app_directory'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $app['app_directory'] ) . '/' . $app['app_directory'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/_newimages/applications/{$app['app_directory']}.png"; - -$IPBHTML .= << - - - - - - + + - - - -
          -
          drag
          -
          - - - form_code}&do=modules_overview&app_id={$app['app_id']}&sys_module_admin=1'>{$app['titlePrefix']}{$app['app_title']} - +foreach( $apps as $app ) +{ + $img = is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $app['app_directory'] ) . '/' . $app['app_directory'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$app['app_directory']}.png"; + + $IPBHTML .= << + +
           
          +
          +   form_code}&do=modules_overview&app_id={$app['app_id']}&sys_module_admin=1'>{$app['titlePrefix']}{$app['app_title']} +   v{$app['_human_current']} + EOF; - if ( isset( $app['_long_version'] ) && $app['_long_version'] > $app['_long_current'] ) +/* Update available? */ +if( $app['app_update_available'][0] ) +{ + $_update = "{$this->lang->words['hook_update_available']}"; + + if ( !empty($app['app_update_available'][1]) ) { - $IPBHTML .= "{$this->lang->words['a_upgradeavail']}"; + $_update = "{$_update}"; } - else + elseif( $app['app_website'] ) { - $IPBHTML .= "{$this->lang->words['a_oh_kay']}"; + $_update = "{$_update}"; } -$IPBHTML .= << - - {$app['_human_current']} - - form_code}&do=toggle_app&app_id={$app['app_id']}' title='{$this->lang->words['toggle_app_enabled']}'>- - - {$this->lang->words[ - -
          - + $IPBHTML .= << + + form_code}&do=toggle_app&app_id={$app['app_id']}' title='{$this->lang->words['toggle_app_enabled']}'>- + + + + + + EOF; } $IPBHTML .= << - + + EOF; - $incrementer++; - + $incrementer++; } + $IPBHTML .= << 
          +
          EOF; if ( is_array( $uninstalled ) AND count( $uninstalled ) ) { $IPBHTML .= << -
          -

          {$this->lang->words['a_unapps']}

          - - - - - - - +
          +

          {$this->lang->words['a_unapps']}

          +
           {$this->lang->words['a_app']}{$this->lang->words['a_author']} 
          EOF; foreach( $uninstalled as $app ) @@ -608,62 +722,117 @@ foreach( $uninstalled as $app ) { $app['titlePrefix'] = $this->lang->words['a__ips']; $app['_location'] = 'ips'; + $img = ""; } else if ( strstr( $app['path'], 'applications_addon/other' ) ) { - $app['titlePrefix'] = $this->lang->words['a__thidparty']; + $app['titlePrefix'] = $this->lang->words['a__thirdparty']; $app['_location'] = 'other'; + $img = ''; } else { $app['titlePrefix'] = $this->lang->words['a__rootapp']; $app['_location'] = 'root'; + $img = ""; } if ( $app['okToGo'] ) { $warning = ''; $install = <<{$this->lang->words['a_install']} + {$this->lang->words['a_install']} EOF; } else { - $install = $this->lang->words['a_cannotinstall']; + $install = "{$this->lang->words['a_cannotinstall']}"; $warning = <<{$this->lang->words['a_cantinstall_info']} +
          {$this->lang->words['a_cantinstall_info']} EOF; } +$install = $canInstall ? $install : ''; + $IPBHTML .= << -
          - - - + + + EOF; } $IPBHTML .= << -
           
          EOF; - } -if ( IN_DEV ) +if( + ( !IPSLib::appIsInstalled('nexus', false) AND !isset($uninstalled['nexus']) ) OR + ( !IPSLib::appIsInstalled('blog', false) AND !isset($uninstalled['blog']) ) OR + ( !IPSLib::appIsInstalled('gallery', false) AND !isset($uninstalled['gallery']) ) OR + ( !IPSLib::appIsInstalled('ccs', false) AND !isset($uninstalled['ccs']) ) OR + ( !IPSLib::appIsInstalled('downloads', false) AND !isset($uninstalled['downloads']) ) OR + !$this->settings['ips_cp_purchase'] ) { $IPBHTML .= << -
        • form_code}&do=inDevExportAll'>In Dev: Экспорт XML всех приложений
        • -
        • form_code}&do=inDevRebuildAll'>In Dev: Импорт XML всех приложений
        • - +
          +
          +
          {$app['titlePrefix']}{$app['title']}{$warning}{$app['author']}{$install} + {$img} + + {$app['title']}
          + {$app['author']} + {$warning} +
          + {$install} +
          +EOF; + foreach( array('nexus','blog','gallery','ccs','downloads') as $__app ) + { + if( !IPSLib::appIsInstalled( $__app, false ) AND !isset($uninstalled[ $__app ]) ) + { + $_app_name = $__app == 'ccs' ? 'Content' : ucfirst($__app); + + $IPBHTML .= << + + + +EOF; + } +} + + if( !$this->settings['ips_cp_purchase'] ) +{ + $IPBHTML .= << + + + +EOF; + } + $IPBHTML .= << + EOF; } +$IPBHTML .= << +EOF; + //--endhtml--// return $IPBHTML; } @@ -671,7 +840,6 @@ return $IPBHTML; /** * Splash screen to remove an application * - * @access public * @param array Application * @return string HTML */ @@ -681,7 +849,7 @@ return <<

          {$this->lang->words['a_remove']} {$data['app_title']} {$this->lang->words['a_app']}

          -
          + + + IP.{$_app_name} +
          + + + Copyright Removal +
          +
          @@ -107,12 +139,11 @@ HTML; $IPBHTML .= <<
          -
          - {$links} -
          -
          +
           {$this->lang->words['erlog_removeall']} 
          +
          {$links}
          +
          @@ -123,11 +154,13 @@ $IPBHTML .= <<

          {$this->lang->words['error_log_search']}

          -

          - - {$form['type']} {$form['match']} {$form['string']} -

          - +
          {$this->lang->words['a_currentver']}: @@ -710,7 +878,7 @@ return << @@ -721,271 +889,316 @@ EOF; /** * List the hooks * - * @access public * @param array Installed hooks * @param array Uninstalled hooks + * @param integer Number of enabled hooks with warnings + * @param string|null Message to display * @return string HTML */ -public function hooksOverview( $installedHooks, $uninstalledHooks ) +public function hooksOverview( $installedHooks, $uninstalledHooks, $warnings, $message ) { $HTML = ""; -$leSigh = ( $this->request['checkUpdates'] ) ? ' class="closed"' : ''; -$leBigh = ( $this->request['checkUpdates'] ) ? 0 : 1; -$cache = $this->cache->getCache( 'disabledHooksCache' ); +/* Sort out some data */ +$warningBadge= "{$this->lang->words['hook_badge_warning']} "; +$updateBadge = "{$this->lang->words['hook_update_available']}"; +$cache = $this->cache->getCache('disabledHooksCache'); + $HTML .= <<

          {$this->lang->words['a_hooks']}

          -
            -EOF; - -if ( IN_DEV ) -{ - $HTML .= << {$this->lang->words['remove_dead_caches']} -EOF; -} - - -$HTML .= << {$this->lang->words['create_hook_link']} -
          • {$this->lang->words['rebuild_app_hooks']}
          • - form_code}&do=hooks_overview&checkUpdates={$leBigh}'> {$this->lang->words['hook_check_updates']} + - -
              -
            • {$this->lang->words['a_installedhooks']}
            • -
            • {$this->lang->words['a_disabledhook']}
            • -
            - - - -
            -
            -
            - - - - - - - - - -
             {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_lastupdated']}{$this->lang->words['a_version']} 
            -
            -
            - - - - -
            -
            - - - - - - - - +
          • + form_code}do=removeDeadCaches'> {$this->lang->words['remove_dead_caches']} +
          • + + + EOF; -if( count( $uninstalledHooks ) ) +if ( $message ) { - foreach( $uninstalledHooks as $r ) - { - $HTML .= << 0 ) +{ + $_text = ( $warnings == 1 ) ? $this->lang->words['hook_overview_warning'] : sprintf( $this->lang->words['hook_overview_warnings'], $warnings ); + + $HTML .= '
            ' . $this->registry->output->global_template->warning_box( $_text ) . '
            '; +} + +$HTML .= << +

            {$this->lang->words['a_hooks']}

            + +
            + « + » +
              +
            • {$this->lang->words['a_installhook']}
            • +
            • {$this->lang->words['a_installedhooks']}
            • +
            • {$this->lang->words['a_disabledhook']}
            • +
            +
            + +
            + +
            +
            form_code}do=install_hook' method='post' enctype='multipart/form-data'> +
            {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_uptodate']}{$this->lang->words['a_version']} 
            + + + + +
            + {$this->lang->words['a_hookxml']} + + +
            + +
            + +
            + +
            + +
            + - + + + + + +EOF; + + if( count( $installedHooks ) ) + { + foreach( $installedHooks as $r ) + { + $HTML .= << + - - - - + + EOF; - } -} -else -{ - $HTML .= << - - + } + } + else + { + $HTML .= << + + EOF; -} - -$HTML .= << - -
            -
            form_code}&do=install_hook' method='post' enctype='multipart/form-data'> -
            -

            {$this->lang->words['a_installhook']}

            + } -
              -
            • - - -
            • -
                - -
                -
                - -
                + $HTML .= <<
                + + + +
                +
            - {$r['hook_name']} -
            {$r['hook_desc']}
            +
             {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_lastupdated']} 
            +   {$r['hook_author']}{$r['hook_update_available']}{$r['hook_version_human']} - {$this->lang->words[ - +EOF; + + $_warning = count($r['_require_errors']) ? "form_code}do=check_requirements&id={$r['hook_id']}'>{$warningBadge}" : ''; + + $r['hook_name'] = IN_DEV ? "form_code}do=edit_hook&id={$r['hook_id']}'>{$r['hook_name']}" : $r['hook_name']; + + $HTML .= "{$_warning}{$r['hook_name']}  v{$r['hook_version_human']}"; + + if( $r['hook_desc'] ) + { + $HTML .= "
            {$r['hook_desc']}"; + } + + /* Update available? */ + if( $r['hook_update_available'][0] ) + { + $r['_updated'] = $updateBadge; + + if ( !empty($r['hook_update_available'][1]) ) + { + $r['_updated'] = "{$r['_updated']}"; + } + elseif( $r['hook_website'] ) + { + $r['_updated'] = "{$r['_updated']}"; + } + } + + $HTML .= << +
            + {$r['hook_author']} + + {$r['_updated']} + + + +
            {$this->lang->words['a_nodishooks']}
            {$this->lang->words['a_nohooks']}
            + + + + + + +EOF; + + if( count( $uninstalledHooks ) ) + { + foreach( $uninstalledHooks as $r ) + { + $HTML .= << + +EOF; + + /* Update available? */ + if( $r['hook_update_available'][0] ) + { + $r['_updated'] = $updateBadge; + + if ( !empty($r['hook_update_available'][1]) ) + { + $r['_updated'] = "{$r['_updated']}"; + } + elseif( $r['hook_website'] ) + { + $r['_updated'] = "{$r['_updated']}"; + } + } + + $HTML .= <<{$r['_updated']} + + +EOF; + } + } + else + { + $HTML .= << + + +EOF; + } + + $HTML .= << + + + - + EOF; return $HTML; @@ -995,35 +1208,39 @@ return $HTML; /** * Form to add/edit a hook * - * @access public + * @param array Form elements * @param string Action code * @param array Hook data * @param array Files in this hook * @return string HTML */ -public function hookForm( $action, $hookData, $files=array() ) +public function hookForm( $form, $action, $hookData, $files=array(), $requirements=array() ) { + +/* Hook types */ +$hookTypes = array( array( 0, $this->lang->words['a_selectone'] ), + array( 'commandHooks', $this->lang->words['a_aoverloader'] ), + array( 'skinHooks', $this->lang->words['a_soverloader'] ), + array( 'templateHooks', $this->lang->words['a_templatehook'] ), + array( 'dataHooks', $this->lang->words['a_datahook'] ), + array( 'libraryHooks', $this->lang->words['a_libraryhook'] ) + ); + +/* Get apps to use for library hooks */ +$appsArray = array( array( 0, $this->lang->words['a_selectone'] ) ); + +foreach( ipsRegistry::$applications as $dir => $appdata ) +{ + $appsArray[] = array( $dir, $appdata['app_title'] ); +} + +$_removeInDev = IN_DEV ? '' : 'display: none;'; + $HTML .= <<

            {$this->lang->words['a_setuphook']}

            -
              -
            • {$this->lang->words['hook_form_info']}
            • -
            • {$this->lang->words['a_hookrequirements']}
            • -
            • {$this->lang->words['a_hookfiles']}
            • -
            - - -
            form_code}' id='mainform'> @@ -1031,70 +1248,187 @@ ipbAcpTabStrips.doToggle($('tabtab-HookInfo'));
            -
            -
              -
            • - - -
            • +

              {$this->lang->words['a_setuphook']}

              -
            • - - -
            • +
              + « + » +
                +
              • {$this->lang->words['hook_form_info']}
              • +
              • {$this->lang->words['a_hookrequirements']}
              • +
              • {$this->lang->words['hook_globalcaches']}
              • +
              • {$this->lang->words['a_hookfiles']}
              • +
              +
              -
            • - - -
            • +
              -
            • - - -
            • - -
            • - - -
            • - -
            • - - -
            • - -
            • - - -
            • - -
            • - - -
            • - -
            • - - -
            • -
            + +
            +
            {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_uptodate']} 
            +EOF; + + $_warning = count($r['_require_errors']) ? "form_code}do=check_requirements&id={$r['hook_id']}'>{$warningBadge}" : ''; + + $r['hook_name'] = IN_DEV ? "form_code}&do=edit_hook&id={$r['hook_id']}'>{$r['hook_name']}" : $r['hook_name']; + + $HTML .= "{$_warning}{$r['hook_name']}  v{$r['hook_version_human']}"; + + if( $r['hook_desc'] ) + { + $HTML .= <<{$r['hook_desc']} +EOF; + } + + $HTML .= << + {$r['hook_author']} + + + +
            {$this->lang->words['a_nodishooks']}
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
             
            + {$this->lang->words['hook_form_title']} + + {$form['hook_name']}
            + {$this->lang->words['hook_form_title_help']} +
            + {$this->lang->words['hook_form_desc']} + + {$form['hook_desc']}
            + {$this->lang->words['hook_form_desc_help']} +
            + {$this->lang->words['hook_form_key']} + + {$form['hook_key']}
            + {$this->lang->words['hook_form_key_desc']} +
            + {$this->lang->words['hook_form_version']} + + {$form['hook_version_human']}
            + {$this->lang->words['hook_form_version_help']} +
            + {$this->lang->words['a_hookversion']} + + {$form['hook_version_long']}
            + {$this->lang->words['a_hookversion_info']} +
            + {$this->lang->words['a_hookauthor']} + + {$form['hook_author']}
            + {$this->lang->words['a_hookauthor_info']} +
            + {$this->lang->words['a_hookemail']} + + {$form['hook_email']}
            + {$this->lang->words['a_hookemail_info']} +
            + {$this->lang->words['a_hooksite']} + + {$form['hook_website']}
            + {$this->lang->words['a_hooksite_info']} +
            + {$this->lang->words['a_hookurl']} + + {$form['hook_update_check']}
            + {$this->lang->words['a_hookurl_info']} +
            -
            -
              -
            • - - {$this->lang->words['a_min']}:
              - {$this->lang->words['a_max']}: -
            • -
            • - - {$this->lang->words['a_min']}:
              - {$this->lang->words['a_max']}: -
            • -
            + + +
            + + + + + + + + +EOF; + + $latestReqIndex = 0; + + if( is_array( $requirements ) && count( $requirements ) ) + { + foreach( $requirements as $appKey => $require ) + { + $_requiredApp = $this->registry->output->formDropdown( "requireApp[{$latestReqIndex}]", $appsArray, $appKey );/*noLibHook*/ + + $HTML .= << + + + + + + +EOF; + + $latestReqIndex++; + } + } + + $HTML .= << + +
            +
            -
            -
            +
            + + +
            +
            {$this->lang->words['a_phpver']}
            + {$this->lang->words['a_phpver']} + + {$this->lang->words['a_min']}: {$form['hook_php_version_min']}

            + {$this->lang->words['a_max']}: {$form['hook_php_version_max']}
            + {$this->lang->words['a_enterzero']} {$this->lang->words['a_phpminmax']} +
            {$this->lang->words['hook_require_apptitle']}{$this->lang->words['hook_remove_requirement']}
            + {$this->lang->words['hook_require_apptitle']} + + {$_requiredApp}

            + {$this->lang->words['a_min']}:

            + {$this->lang->words['a_max']}:
            + {$this->lang->words['a_enterzero']} {$this->lang->words['a_longversionid']} +
            + + + + + + + +
            {$this->lang->words['hook_globalcaches']}
            + {$this->lang->words['hook_form_caches']} + + {$form['hook_global_caches']}
            + {$this->lang->words['hook_form_caches_desc']} +
            +
            + + +
            + EOF; $latestIndex = 0; @@ -1103,185 +1437,268 @@ EOF; { foreach( $files as $index => $file ) { - $hook_type_command = $file['hook_type'] == 'commandHooks' ? " selected='selected'" : ''; - $hook_type_skin = $file['hook_type'] == 'skinHooks' ? " selected='selected'" : ''; - $hook_type_template = $file['hook_type'] == 'templateHooks' ? " selected='selected'" : ''; - $hook_type_data = $file['hook_type'] == 'dataHooks' ? " selected='selected'" : ''; - $hook_type_library = $file['hook_type'] == 'libraryHooks' ? " selected='selected'" : ''; - $latestIndex = $index > $latestIndex ? $index : $latestIndex; $HTML .= <<{$this->lang->words['a_hookfile']} #{$index} -
              +
            + + EOF; } } $HTML .= << +
            + + + + EOF; if( IN_DEV ) { $HTML .= << - - - - -
          • - - -
          • +
            + + + + + + + EOF; } else { $HTML .= << + + EOF; } + +$_hookTypes = $this->registry->output->formDropdown( "hook_type[{$index}]", $hookTypes, $file['hook_type'], "hook_type[{$index}]", "onchange='selectHookType({$index});'" ); + $HTML .= << - - - + + + + EOF; if( $file['hook_type'] == 'dataHooks' ) { $HTML .= << - + + + + EOF; } else if( $file['hook_type'] == 'libraryHooks' ) { - $apps = array(); - - foreach( ipsRegistry::$applications as $dir => $appdata ) - { - $apps[] = array( $dir, $appdata['app_title'] ); - } - - $_applications = $this->registry->output->formDropdown( "libApplication[{$index}]", $apps, $file['hook_data']['libApplication'] ); + $_applications = $this->registry->output->formDropdown( "libApplication[{$index}]", $appsArray, $file['hook_data']['libApplication'] ); $HTML .= << - - - -
          • - +
          • + + + + + + + EOF; } else if( $file['hook_type'] != 'templateHooks' ) { $HTML .= << - - - + + + + EOF; } else { $HTML .= << - + + + + + + + + + + + + + + + + + + + + EOF; } $HTML .= << +
            {$this->lang->words['a_hookfile']} #{$index}{$this->lang->words['hook_remove_file']}
            + {$this->lang->words['a_filenamedir']} + + +
            + {$this->lang->words['a_fileclassname']} + + +
            +
            + {$this->lang->words['a_filehooktype']} + + {$_hookTypes} +
            + {$this->lang->words['a_datalocation']} + {$file['_dataLocationDropdown']} - +
            + {$this->lang->words['a_classextend']} + + +
            + {$this->lang->words['a_hookapp']} + {$_applications} - +
            + {$this->lang->words['a_classextend']} + + +
            + {$this->lang->words['a_skingroup']} + {$file['_skinDropdown']} - - -
          • - +
          • + {$this->lang->words['a_skinfunc']} + {$file['_templateDropdown']} - - -
          • - +
          • + {$this->lang->words['a_typeoftemp']} + {$file['_hookTypeDropdown']} - - -
          • - +
          • + {$this->lang->words['a_hookid']} + {$file['_hookIdsDropdown']} - - -
          • - +
          • + {$this->lang->words['a_hookloc']} + {$file['_hookEPDropdown']} - +
            +
            +
            -
            -
            + +
            -
            -
            - EOF; return $HTML; } - /** * Show the hook details * - * @access public * @param array Hook data * @param array Files in this hook * @return string HTML */ public function hookDetails( $hookData, $files=array() ) { +$HTML = ''; + +/* Menu */ $HTML .= << +

            {$this->lang->words['hook_view_details']}

            + + + +

            {$hookData['hook_name']}

            - +
            - - - - @@ -1291,10 +1708,10 @@ EOF; { $HTML .= << - - @@ -1305,63 +1722,65 @@ EOF; { $HTML .= << - - EOF; } - $HTML .= << - -
            -EOF; - - if( $hookData['hook_requirements']['hook_ipb_version_min'] > 0 OR $hookData['hook_requirements']['hook_ipb_version_max'] > 0 - OR $hookData['hook_requirements']['hook_php_version_min'] OR $hookData['hook_requirements']['hook_php_version_max'] ) + /* Update available? */ + if( $hookData['hook_update_available'][0] ) { - $HTML .= << -

            {$this->lang->words['a_hookrequirements']}

            + $hookData['_updated'] = "{$this->lang->words['hook_update_available']}";; -
            {$hookData['hook_desc']}
            - {$this->lang->words['a_hookver']} + + {$this->lang->words['a_hookver']} + {$hookData['hook_version_human']}
            - {$this->lang->words['a_hookauthor']} + + {$this->lang->words['a_hookauthor']} + {$hookData['hook_author']}
            - {$this->lang->words['a_hookemail']} + + {$this->lang->words['a_hookemail']} + {$hookData['hook_email']}
            - {$this->lang->words['a_authorsite']} + + {$this->lang->words['a_authorsite']} + {$hookData['hook_website']}
            -EOF; - - if( $hookData['hook_requirements']['hook_ipb_version_min'] > 0 OR $hookData['hook_requirements']['hook_ipb_version_max'] > 0 ) + if ( !empty($hookData['hook_update_available'][1]) ) { - $hookData['hook_requirements']['hook_ipb_version_min'] = $hookData['hook_requirements']['hook_ipb_version_min'] ? $hookData['hook_requirements']['hook_ipb_version_min'] : 'нет'; - $hookData['hook_requirements']['hook_ipb_version_max'] = $hookData['hook_requirements']['hook_ipb_version_max'] ? $hookData['hook_requirements']['hook_ipb_version_max'] : 'нет'; + $hookData['_updated'] = "{$hookData['_updated']}"; + } + if( $hookData['hook_website'] ) + { + $hookData['_updated'] = "{$hookData['_updated']}"; + } + } $HTML .= << - - + + + +EOF; + + if ( $hookData['hook_global_caches'] ) { - $hookData['hook_requirements']['hook_php_version_min'] = $hookData['hook_requirements']['hook_php_version_min'] ? $hookData['hook_requirements']['hook_php_version_min'] : 'нет'; - $hookData['hook_requirements']['hook_php_version_max'] = $hookData['hook_requirements']['hook_php_version_max'] ? $hookData['hook_requirements']['hook_php_version_max'] : 'нет'; + $cachesCount = count( explode(',', $hookData['hook_global_caches']) ); $HTML .= << - - EOF; @@ -1371,13 +1790,9 @@ EOF;
            - {$this->lang->words['a_boardversion']} + + {$this->lang->words['a_lastupdated']} - {$this->lang->words['a_minimum']}: {$hookData['hook_requirements']['hook_ipb_version_min']}
            - {$this->lang->words['a_maximum']}: {$hookData['hook_requirements']['hook_ipb_version_max']} +
            + {$hookData['_updated']}
            + {$this->lang->words['a_hookrequirements']} + EOF; - } - if( $hookData['hook_requirements']['hook_php_version_min'] OR $hookData['hook_requirements']['hook_php_version_max'] ) + $HTML .= ( is_array($hookData['_require_errors']) && count($hookData['_require_errors']) ) ? "form_code}do=check_requirements&id={$hookData['hook_id']}'>{$this->lang->words['hook_require_error']}" : "{$this->lang->words['hook_require_ok']}"; + + $HTML .= << +
            - {$this->lang->words['a_phpver']} + + {$this->lang->words['hook_globalcaches']} - {$this->lang->words['a_minimum']}: {$hookData['hook_requirements']['hook_php_version_min']}
            - {$this->lang->words['a_maximum']}: {$hookData['hook_requirements']['hook_php_version_max']} +
            + {$cachesCount}  ( {$hookData['hook_global_caches']} )

            -EOF; - } - - $HTML .= <<

            {$this->lang->words['a_fileuses']}

            - +
            @@ -1447,6 +1862,14 @@ EOF; $showsAt .= $this->lang->words['a_labeled'] . $data['hook_data']['id']; } + elseif ( $data['hook_type'] == 'libraryHooks' ) + { + $showsAt = sprintf( $this->lang->words['a_libraryhookfor'], $data['hook_data']['classToOverload'], $data['hook_data']['libApplication'] ); + } + elseif ( $data['hook_type'] == 'dataHooks' ) + { + $showsAt = $this->lang->words['a_datahookfor'] . $data['hook_data']['dataLocation']; + } else { $showsAt = $this->lang->words['a_willoverload'] . $data['hook_data']['classToOverload']; @@ -1456,28 +1879,33 @@ EOF; { case 'templateHooks': $hookType = $this->lang->words['a_templatehook']; - break; + break; case 'commandHooks': $hookType = $this->lang->words['a_aoverloader']; - break; + break; case 'skinHooks': $hookType = $this->lang->words['a_soverloader']; - break; + break; + case 'libraryHooks': + $hookType = $this->lang->words['a_libraryhook']; + break; + case 'dataHooks': + $hookType = $this->lang->words['a_datahook']; + break; } $HTML .= << - - - - - + + + + + + EOF; } $HTML .= << - EOF; return $HTML; @@ -1486,111 +1914,244 @@ return $HTML; /** * Show the hook requirements * - * @access public * @param array Hook data - * @param boolean True if you don't meet IPB min requirements, otherwise false - * @param boolean True if you don't meet PHP min requirements, otherwise false + * @param array Array of errors found + * @param array Array of the app versions * @return string HTML */ -public function hookRequirements( $hookData, $hookIpbBad, $hookPhpBad ) +public function hookRequirements( $hookData, $errors, $versions=array() ) { - if( $hookIpbBad OR $hookPhpBad ) - { - $HTML .= $this->registry->output->global_template->warning_box( $hookData['hook_name'], $this->lang->words['a_noyoucant'] ) . '
            '; - } +$HTML = ''; +/* Let's sort out the badges... */ +$forceEnable = empty($this->request['fromInstall']) ? '' : '&skipRequirements=1'; +$_goodBadge = "{$this->lang->words['hook_require_ok']}"; +$_errorBadge = "{$this->lang->words['hook_require_error']}"; + +/* Menu */ $HTML .= << +

            {$this->lang->words['a_hookrequirements']}

            + + + +
            +EOF; + +/* Check if we got any requirements... */ +if ( !$hookData['hook_requirements']['hook_php_version_min'] && !$hookData['hook_requirements']['hook_php_version_min'] && ( ( !is_array($hookData['hook_requirements']['required_applications']) || !count($hookData['hook_requirements']['required_applications']) ) ) ) +{ +$HTML .= << + {$this->lang->words['hook_require_noreqs']} + +EOF; + +return $HTML; +} + + +/* Got errors? */ +if( count($errors) ) +{ + $HTML .= $this->registry->output->global_template->warning_box( $this->lang->words['a_noyoucant'], empty($this->request['fromInstall']) ? '' : '
            '.$this->lang->words['hook_require_skip_reqs'] ) . '
            '; + + /* Replacement time? */ + if ( isset($errors['php_min']) ) + { + $hookData['hook_requirements']['hook_php_version_min'] = $errors['php_min']; + } + if ( isset($errors['php_max']) ) + { + $hookData['hook_requirements']['hook_php_version_max'] = $errors['php_max']; + } +} + +/* Still here? We do have some requirements then! */ +$HTML .= <<

            {$hookData['hook_name']}

            -
            {$this->lang->words['a_realfile']} {$this->lang->words['a_storedfile']}{$data['hook_file_real']}{$data['hook_file_stored']}{$hookType}{$showsAt}
            {$data['hook_file_real']}{$data['hook_file_stored']}{$hookType}{$showsAt}
            - -EOF; - - if( $hookData['hook_requirements']['hook_ipb_version_min'] ) - { - $HTML .= << - - + + + -EOF; - } - - if( $hookData['hook_requirements']['hook_ipb_version_max'] ) - { - $HTML .= << - - - -EOF; - } - - if( $hookData['hook_requirements']['hook_ipb_version_min'] OR $hookData['hook_requirements']['hook_ipb_version_max'] ) - { - $HTML .= << - + - - - - - -EOF; - } - - if( $hookData['hook_requirements']['hook_php_version_min'] ) - { - $HTML .= << - - - -EOF; - } - - if( $hookData['hook_requirements']['hook_php_version_max'] ) - { - $HTML .= << - - - -EOF; - } - - if( $hookData['hook_requirements']['hook_php_version_min'] OR $hookData['hook_requirements']['hook_php_version_max'] ) - { - $HTML .= << - +EOF; + +if ( $hookData['hook_requirements']['hook_php_version_min'] ) +{ + + $HTML .= << - - + + EOF; - } +} +if ( $hookData['hook_requirements']['hook_php_version_max'] ) +{ + + $HTML .= << + + + +EOF; +} + + if ( is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications']) ) + { + foreach( $hookData['hook_requirements']['required_applications'] as $appKey => $appData ) + { + $_appName = ipsRegistry::$applications[ $appKey ]['app_title']; + + $HTML .= << + + + + + +EOF; + /* Got a min version? */ + if ( ! isset($errors[ $appKey.'_app' ]) && $appData['min_version'] ) + { + + $HTML .= << + + +EOF; +} + /* Got a max version? */ + if ( ! isset($errors[ $appKey.'_app' ]) && $appData['max_version'] ) + { + + $HTML .= << + + +EOF; + } + } + } + $HTML .= << @@ -1603,7 +2164,6 @@ return $HTML; /** * Page to export a hook * - * @access public * @param array Hook data * @return string HTML */ @@ -1624,7 +2184,10 @@ $hookData['hook_extra_data']['display']['css'] = $hookData['hook_extra_data'][ $HTML .= <<{$this->lang->words['hook_h2_exporting']} {$hookData['hook_name']} +
            +

            {$this->lang->words['hook_h2_exporting']} {$hookData['hook_name']}

            +
            + @@ -1640,12 +2203,14 @@ $HTML .= <<

            {$this->lang->words['a_exportsettings']}

            -
             
            {$this->lang->words['a_minipb']}{$hookData['hook_requirements']['hook_ipb_version_min']}{$this->lang->words['a_phpver']}  
            {$this->lang->words['a_maxipb']}{$hookData['hook_requirements']['hook_ipb_version_max']}
            {$this->lang->words['a_youripb']} -EOF; - -$HTML .= IPB_VERSION; - -$hookIpbBad = $hookIpbBad ? "" . $hookIpbBad . "" : "{$this->lang->words['a_willworkipb']}"; - -$HTML .= <<{$this->lang->words['hook_require_current']} + +  
            {$this->lang->words['a_ipbstatus']}{$hookIpbBad}
            {$this->lang->words['a_minphp']}{$hookData['hook_requirements']['hook_php_version_min']}
            {$this->lang->words['a_maxphp']}{$hookData['hook_requirements']['hook_php_version_max']}
            {$this->lang->words['a_yourphp']} EOF; $HTML .= PHP_VERSION; -$hookPhpBad = $hookPhpBad ? "" . $hookPhpBad . "" : "{$this->lang->words['a_willworkphp']}"; - $HTML .= <<
            {$this->lang->words['a_phpstatus']}{$hookPhpBad} + {$this->lang->words['hook_require_min']} + +EOF; + + $HTML .= isset($errors['php_min']) ? $_errorBadge : $_goodBadge; + + $HTML .= << + + {$hookData['hook_requirements']['hook_php_version_min']} +
            + {$this->lang->words['hook_require_max']} + +EOF; + + $HTML .= isset($errors['php_max']) ? $_errorBadge : $_goodBadge; + + $HTML .= << + + {$hookData['hook_requirements']['hook_php_version_max']} +
            {$this->lang->words['hook_require_apptitle']}: {$_appName}
            + {$this->lang->words['hook_require_current']} + +EOF; + + $HTML .= isset($errors[ $appKey.'_app' ]) ? $_errorBadge : $_goodBadge; + + $HTML .= << + +EOF; + + $HTML .= isset($errors[ $appKey.'_app' ]) ? $errors[ $appKey.'_app' ] : ipsRegistry::$applications[ $appKey ]['app_version']; + + $HTML .= << +
            + {$this->lang->words['hook_require_min']} + +EOF; + + $appData['min_version'] = isset($errors[ $appKey.'_min' ]) ? $errors[ $appKey.'_min' ] : $appData['min_version']; + + $HTML .= isset($errors[ $appKey.'_min' ]) ? $_errorBadge : $_goodBadge; + + $HTML .= << + +EOF; + + $HTML .= isset($versions[ $appKey ][ $appData['min_version'] ]) ? $versions[ $appKey ][ $appData['min_version'] ] : $appData['min_version']; + + $HTML .= << +
            + {$this->lang->words['hook_require_max']} + +EOF; + + $appData['max_version'] = isset($errors[ $appKey.'_max' ]) ? $errors[ $appKey.'_max' ] : $appData['max_version']; + + $HTML .= isset($errors[ $appKey.'_max' ]) ? $_errorBadge : $_goodBadge; + + $HTML .= << + +EOF; + + $HTML .= isset($versions[ $appKey ][ $appData['max_version'] ]) ? $versions[ $appKey ][ $appData['max_version'] ] : $appData['max_version']; + + $HTML .= << +
            - +
            {$this->lang->words['a_settings_info']}
            + + +
            {$this->lang->words['a_settings_info']}

            {$hookData['hook_extra_data']['display']['settings']}

            -
            {$this->lang->words['a_addsettings']}
            +
            {$this->lang->words['a_addsettings']}
            @@ -1658,12 +2223,14 @@ $HTML .= <<

            {$this->lang->words['a_exportlang']}

            - - +
            {$this->lang->words['a_lang_info']}
            + + +
            {$this->lang->words['a_lang_info']}

            {$hookData['hook_extra_data']['display']['language']}

            -
            {$this->lang->words['a_addlang']}
            +
            {$this->lang->words['a_addlang']}
            @@ -1676,12 +2243,14 @@ $HTML .= <<

            {$this->lang->words['a_exportmod']}

            - - +
            {$this->lang->words['a_mod_info']}
            + + +
            {$this->lang->words['a_mod_info']}

            {$hookData['hook_extra_data']['display']['modules']}

            -
            {$this->lang->words['a_addmod']}
            +
            {$this->lang->words['a_addmod']}
            @@ -1694,12 +2263,14 @@ $HTML .= <<

            {$this->lang->words['a_exporthelp']}

            - - +
            {$this->lang->words['a_help_info']}
            + + +
            {$this->lang->words['a_help_info']}

            {$hookData['hook_extra_data']['display']['help']}

            -
            {$this->lang->words['a_addhelp']}
            +
            {$this->lang->words['a_addhelp']}
            @@ -1713,12 +2284,14 @@ $HTML .= <<

            {$this->lang->words['a_exportskin']}

            - - +
            {$this->lang->words['a_skin_info']}
            + + +
            {$this->lang->words['a_skin_info']}

            {$hookData['hook_extra_data']['display']['templates']}

            -
            {$this->lang->words['a_addskin']}
            +
            {$this->lang->words['a_addskin']}
            @@ -1731,12 +2304,14 @@ $HTML .= <<

            {$this->lang->words['a_exportcss']}

            - - +
            {$this->lang->words['a_css_info']}
            + + +
            {$this->lang->words['a_css_info']}

            {$hookData['hook_extra_data']['display']['css']}

            -
            {$this->lang->words['a_addcss']}
            +
            {$this->lang->words['a_addcss']}
            @@ -1749,12 +2324,14 @@ $HTML .= <<

            {$this->lang->words['a_exporttasks']}

            - - +
            {$this->lang->words['a_tasks_info']}
            + + +
            {$this->lang->words['a_tasks_info']}

            {$hookData['hook_extra_data']['display']['tasks']}

            -
            {$this->lang->words['a_addtasks']}
            +
            {$this->lang->words['a_addtasks']}
            @@ -1767,12 +2344,14 @@ $HTML .= <<

            {$this->lang->words['a_exportdb']}

            - - +
            {$this->lang->words['a_db_info']}
            + + +
            {$this->lang->words['a_db_info']}

            {$hookData['hook_extra_data']['display']['database']}

            -
            {$this->lang->words['a_adddb']}
            +
            {$this->lang->words['a_adddb']}
            @@ -1785,12 +2364,14 @@ $HTML .= <<

            {$this->lang->words['a_exportscript']}

            - - +
            {$this->lang->words['a_script_info']}
            + + +
            {$this->lang->words['a_script_info']}

            {$hookData['hook_extra_data']['display']['custom']}

            -
            {$this->lang->words['a_addscript']}
            +
            {$this->lang->words['a_addscript']}
            @@ -1801,9 +2382,93 @@ $HTML .= <<
            -
            - -
            + +
            +
            + +EOF; + +return $HTML; +} + +/** + * Show a form to create sphinx cronjobs strings + * + * @param array $sphinxData Sphinx data + * @return @e string HTML + */ +public function sphinxConfForm( $sphinxData=array() ) +{ +$HTML = ''; + +/* Form path */ +$sphinxPath = $this->registry->output->formInput( 'sphinx_conf_path', $this->request['sphinx_conf_path'] ); + +/* Init template */ +$HTML .= << +

            {$this->lang->words['sphinx_cronjob_title']}

            + +EOF; + + +/* Got a path? */ +if ( $this->request['sphinx_conf_path'] && count($sphinxData) ) +{ + /* Sort out some variables.. */ + $this->request['sphinx_conf_path'] = rtrim( $this->request['sphinx_conf_path'], '/' ); + $_file = $this->request['sphinx_conf_path'] . '/sphinx.conf'; + $cronJobs = "*/15 * * * * /usr/local/bin/indexer --config {$_file} " . implode( ' ', $sphinxData['deltas'] ) . " --rotate +0 4 * * * /usr/local/bin/indexer --config {$_file} --all --rotate"; + + /* Doesn't exist? */ + if( !@is_file( $_file ) ) + { + $HTML .= $this->registry->output->global_template->warning_box( $this->lang->words['sphinx_cronjob_nofile'], '
            ' . sprintf( $this->lang->words['sphinx_cronjob_nofiledesc'], $_file ) ) . '
            '; + } + +$HTML .= << + {$this->lang->words['sphinx_cronjob_details']} +

            + +

            + {$this->lang->words['sphinx_cronjob_note']} + +

            +EOF; + + + /*echo "
            ";print_r(
            +	
            +	$this->request
            +	#$sphinxData['deltas']
            +	
            +	);echo '
            '; + /**/ + #exit; + #print nl2br( htmlentities( $sphinxData['content'] ) ); exit; +} + + +$HTML .= <<form_code}do=sphinxBuildCron' method='post' enctype='multipart/form-data'> +
            +

            {$this->lang->words['sphinx_cronjob_title']}

            + + + + + +
            + {$this->lang->words['sphinx_cronjob_path']} + + {$sphinxPath}
            + {$this->lang->words['sphinx_cronjob_path_desc']} +
            + +
            +
            diff --git a/upload/admin/applications/core/skin_cp/cp_skin_badwords.php b/upload/admin/applications/core/skin_cp/cp_skin_badwords.php index 5dc9d30b..31ab1b0b 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_badwords.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_badwords.php @@ -2,38 +2,68 @@ /** *
              * Invision Power Services
            - * IP.Board v3.1.4
            + * IP.Board v3.2.3
              * Badwords skin file
            - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
            + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
              * 
            * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ -class cp_skin_badwords extends output +class cp_skin_badwords { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} - + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + /** * Edit badwords * - * @access public * @param int ID * @param array Form elements * @return string HTML @@ -55,20 +85,20 @@ $IPBHTML .= <<

            {$this->lang->words['bwl_edit_filter']}

            -
              -
            • - - {$form['before']} -
            • -
            • - - {$form['after']} -
            • -
            • - - {$form['match']} -
            • -
            + + + + + + + + + + + + + +
            {$this->lang->words['bwl_before']}{$form['before']}
            {$this->lang->words['bwl_after']}{$form['after']}
            {$this->lang->words['bwl_method']}{$form['match']}
            @@ -84,7 +114,6 @@ return $IPBHTML; /** * Badwords wrapper * - * @access public * @param array Badword rows * @return string HTML */ @@ -99,7 +128,7 @@ $IPBHTML .= <<
          • form_code}&do=badword_export'> - + {$this->lang->words['bwl_export']}
          • @@ -112,7 +141,7 @@ $IPBHTML .= <<

            {$this->lang->words['bwl_current']}

            - +
            @@ -124,15 +153,14 @@ HTML; foreach( $rows as $row ) { $IPBHTML .= << + - @@ -146,7 +174,7 @@ $IPBHTML .= <<

            {$this->lang->words['bwl_filter_add']}

            -
            {$this->lang->words['bwl_before']} {$this->lang->words['bwl_after']}
            {$row['type']} {$row['replace']} {$row['method']} - {$this->lang->words[ - +
            +
            @@ -178,12 +206,12 @@ $IPBHTML .= <<

            {$this->lang->words['bwl_import']}

            -
              -
            • - - -
            • -
            +
            {$this->lang->words['bwl_before']} {$this->lang->words['bwl_after']}
            + + + + +
            {$this->lang->words['bwl_import_upload']}
            {$this->lang->words['bwl_import_info']}
            diff --git a/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php b/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php index ce9e8958..63a70c6e 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php @@ -2,38 +2,68 @@ /** *
              * Invision Power Services
            - * IP.Board v3.1.4
            + * IP.Board v3.2.3
              * BBcode skin file
            - * Last Updated: $Date: 2010-07-13 19:56:23 -0400 (Tue, 13 Jul 2010) $
            + * Last Updated: $Date: 2011-06-07 18:56:57 -0400 (Tue, 07 Jun 2011) $
              * 
            * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6644 $ + * @version $Revision: 8999 $ */ -class cp_skin_bbcode extends output +class cp_skin_bbcode { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * BBCode wrapper * - * @access public * @param string Content (compiled HTML rows) * @return string HTML */ @@ -55,41 +85,43 @@ $IPBHTML .= <<

            {$this->lang->words['bbcode_header']}

            - +

            {$this->lang->words['your_bbcodes']}

            - +
            - + {$content}
            {$this->lang->words['bbcode_title']} {$this->lang->words['bbcode_tag']}{$this->lang->words['bbcode_options']} 
            @@ -99,7 +131,7 @@ $IPBHTML .= <<form_code}&do=bbcode_test' method='post'>

            {$this->lang->words['test_parse']}

            -

          {$row['members_display_name']} {$row['_date']}
          + + + + +
          {$this->lang->words['erlog_searchwhere']}{$form['type']} {$form['match']} {$form['string']}
          +
          diff --git a/upload/admin/applications/core/skin_cp/cp_skin_group_core.php b/upload/admin/applications/core/skin_cp/cp_skin_group_core.php new file mode 100644 index 00000000..3836b918 --- /dev/null +++ b/upload/admin/applications/core/skin_cp/cp_skin_group_core.php @@ -0,0 +1,142 @@ + + * Invision Power Services + * IP.Board v3.2.3 + * Group plugin skin functions + * Last Updated: $LastChangedDate: 2011-09-01 08:16:37 -0400 (Thu, 01 Sep 2011) $ + * + * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license This is NULLED! + * @package IP.Board + * @subpackage Forums + * @link http://hatynka.in + * @since 14th May 2003 + * @version $Rev: 9439 $ + */ + +class cp_skin_group_core +{ + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + +/** + * Show forums group form + * + * @param array Group data + * @param string Tab ID + * @param array Plugins + * @param array Plugins we can view + * @param array Plugins we can send + * @return string HTML + */ +public function acp_group_form_main( $group, $tabId, $plugins, $canView, $canSend ) { + + +$IPBHTML = ""; + +$IPBHTML .= << +
          + +EOF; + +foreach( $plugins as $id => $data ) +{ + $formSend = $this->registry->output->formYesNo( "rc_send_" . $id, in_array( $id, $canSend ) ); + $formView = $this->registry->output->formYesNo( "rc_view_" . $id, in_array( $id, $canView ) ); + + $IPBHTML .= << + + + + + + + + + + +EOF; +} + +$IPBHTML .= << + + + +EOF; + +return $IPBHTML; +} + +/** + * Display forum group form tabs + * + * @param array Group data + * @param string Tab id + * @return string HTML + */ +public function acp_group_form_tabs( $group, $tabId ) { + +$IPBHTML = ""; + +$IPBHTML .= <<{$this->lang->words['tab_groupform_rc']} +EOF; + +return $IPBHTML; +} + +} \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/cp_skin_help_files.php b/upload/admin/applications/core/skin_cp/cp_skin_help_files.php index adee75ed..7009811e 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_help_files.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_help_files.php @@ -2,38 +2,68 @@ /** *
            * Invision Power Services
          - * IP.Board v3.1.4
          + * IP.Board v3.2.3
            * Manage help files skin file
          - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
          + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
            * 
          * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ -class cp_skin_help_files extends output +class cp_skin_help_files { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Form to add/edit a help file * - * @access public * @param string Action * @param int ID * @param array Form elements @@ -57,33 +87,43 @@ $IPBHTML .= <<

          {$button}

          - -
            -
          • - - {$form['title']} -
          • - -
          • - - {$form['description']} -
          • - -
          • - - {$form['appDir']} -
          • - -
          • - -
            -
          • -
          +
          {$this->lang->words['gf_rc_perms_for']} {$data['class_title']}
          + {$this->lang->words['gf_can_send_report']} + + {$formSend} +
          + {$this->lang->words['gf_can_view_report']} + + {$formView} +
          + + + + + + + + + + + + + + + + +
          + {$this->lang->words['h_filetitle']} + + {$form['title']} +
          + {$this->lang->words['h_filedesc']} + + {$form['description']} +
          + {$this->lang->words['h_fileapp']} + + {$form['appDir']} +
          + {$this->lang->words['h_filetext']} + + +
          -
          - -
          -
          + +
          HTML; @@ -95,7 +135,6 @@ return $IPBHTML; /** * List the current help files * - * @access public * @param array Rows * @return string HTML */ @@ -107,91 +146,100 @@ $IPBHTML = ""; $IPBHTML .= <<

          {$this->lang->words['h_title']}

          - +
          +HTML; - - +$IPBHTML .= <<

          {$this->lang->words['h_current']}

          - -
            + + HTML; foreach( $rows as $r ) { $IPBHTML .= << -
            - - - - - -
            -
            -
            - form_code}&do=edit&id={$r['id']}'>{$r['title']}
            - {$r['description']} -
            - {$this->lang->words[ - -
            - + + +   + + + form_code}&do=edit&id={$r['id']}'>{$r['title']}
            + {$r['description']} + + +
              +HTML; + + if ( $this->registry->class_permissions->checkPermission( 'help_manage' ) ) + { + $IPBHTML .= << + form_code}&do=edit&id={$r['id']}' title='{$this->lang->words['h_edit']}'>{$this->lang->words['h_edit']} + +HTML; + } + if ( $this->registry->class_permissions->checkPermission( 'help_remove' ) ) + { + $IPBHTML .= << + form_code}&do=remove&id={$r['id']}");' title='{$this->lang->words['h_remove']}'>{$this->lang->words['h_remove']} + +HTML; + } + $IPBHTML .= << + + HTML; } $IPBHTML .= << - +
              + HTML; //--endhtml--// return $IPBHTML; - } } \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php b/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php index fbd1f98a..9b908285 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Hooks export skin file
              - * Last Updated: $Date: 2010-10-18 13:10:17 -0400 (Mon, 18 Oct 2010) $
              + * Last Updated: $Date: 2011-10-07 22:31:51 -0400 (Fri, 07 Oct 2011) $
                * 
              * - * @author $Author: ips_terabyte $ + * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6990 $ + * @version $Revision: 9588 $ */ -class cp_skin_hooks_export extends output +class cp_skin_hooks_export { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Inline css dhtml box * - * @access public * @param array Hook data * @param array Form elements * @return string HTML @@ -55,16 +85,18 @@ $IPBHTML .= <<

              {$this->lang->words['addcss']}

              -
                -
              • - {$this->lang->words['selectoneomorecss']} -
              • -
              • - {$form['css']} -
              • -
              + + + + + +
              + {$this->lang->words['selectoneomorecss']} + + {$form['css']} +
              - +
              @@ -77,7 +109,6 @@ return $IPBHTML; /** * Inline settings dhtml box * - * @access public * @param array Hook data * @param array Form elements * @return string HTML @@ -99,22 +130,26 @@ $IPBHTML .= <<

              {$this->lang->words['addsettings']}

              -
                -
              • - {$this->lang->words['exportonesettings']} -
              • -
              • - {$form['groups']} -
              • -
              • - {$this->lang->words['indivsettingsex']} -
              • -
              • - {$form['settings']} -
              • -
              + + + + + + + + + +
              + {$this->lang->words['exportonesettings']} + + {$form['groups']} +
              + {$this->lang->words['indivsettingsex']} + + {$form['settings']} +
              - +
              @@ -126,7 +161,6 @@ return $IPBHTML; /** * Inline modules dhtml box * - * @access public * @param array Hook data * @param array Form elements * @return string HTML @@ -148,16 +182,18 @@ $IPBHTML .= <<

              {$this->lang->words['addmodules']}

              -
                -
              • - {$this->lang->words['exportmodules']} -
              • -
              • - {$form['modules']} -
              • -
              + + + + + +
              + {$this->lang->words['exportmodules']} + + {$form['modules']} +
              - +
              @@ -169,7 +205,6 @@ return $IPBHTML; /** * Inline custom script dhtml box * - * @access public * @param array Hook data * @param array Form elements * @return string HTML @@ -177,7 +212,9 @@ return $IPBHTML; public function inline_custom( $hook, $form=array() ) { $IPBHTML = ""; - + +$pathcustomscript = sprintf( $this->lang->words['pathcustomscript'], rtrim( str_replace( DOC_IPS_ROOT_PATH, '', IPS_HOOKS_PATH ), '/' ) ); + $IPBHTML .= << acp.hooks.fields['MF__custom'] = {}; @@ -191,16 +228,18 @@ $IPBHTML .= <<

              {$this->lang->words['addcustomscript']}

              -
                -
              • - {$this->lang->words['pathcustomscript']} -
              • -
              • - install_ {$form['custom']} -
              • -
              + + + + + +
              + {$pathcustomscript} + + install_ {$form['custom']} +
              - +
              EOF; @@ -211,7 +250,6 @@ return $IPBHTML; /** * Inline help files dhtml box * - * @access public * @param array Hook data * @param array Form elements * @return string HTML @@ -233,16 +271,18 @@ $IPBHTML .= <<

              {$this->lang->words['addhelpfiles']}

              -
                -
              • - {$this->lang->words['selectoneormorehelp']} -
              • -
              • - {$form['help']} -
              • -
              + + + + + +
              + {$this->lang->words['selectoneormorehelp']} + + {$form['help']} +
              - +
              EOF; @@ -253,7 +293,6 @@ return $IPBHTML; /** * Inline tasks dhtml box * - * @access public * @param array Hook data * @param array Form elements * @return string HTML @@ -275,16 +314,18 @@ $IPBHTML .= <<

              {$this->lang->words['addtasks']}

              -
                -
              • - {$this->lang->words['oneormtasks']} -
              • -
              • - {$form['tasks']} -
              • -
              + + + + + +
              + {$this->lang->words['oneormtasks']} + + {$form['tasks']} +
              - +
              @@ -296,7 +337,6 @@ return $IPBHTML; /** * Inline language bits dhtml box * - * @access public * @param array Hook data * @param array Form elements * @param int Current index @@ -316,7 +356,7 @@ $IPBHTML .= <<
              #{control}
              "); + ipb.templates['lang_row'] = new Template("
            • #{control}
            • "); acp.hooks.languageMax = $i; @@ -338,7 +378,7 @@ EOF; { $IPBHTML .= << - +
              {$form['language_file_' . $k ]}
              @@ -362,7 +402,7 @@ EOF; $IPBHTML .= << - +
              {$form['language_file_' . $i ]}
              @@ -383,7 +423,7 @@ EOF;
              - + @@ -397,7 +437,6 @@ return $IPBHTML; /** * Inline skin bits dhtml box * - * @access public * @param array Hook data * @param array Form elements * @param int Current index @@ -417,7 +456,7 @@ $IPBHTML .= <<
              #{control}
              "); + ipb.templates['skin_row'] = new Template("
            • #{control}
            • "); acp.hooks.skinMax = $i; @@ -440,7 +479,7 @@ if( $i ) { $IPBHTML .= << - +
              @@ -194,7 +180,6 @@ return $IPBHTML; /** * Wrapper for bad files from AV checker * - * @access public * @param string Content * @return string HTML */ @@ -204,17 +189,12 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= << -
              {$this->lang->words['skin_suspicious_files']}
              -
              -
              - {$this->lang->words['skin_th_filesize']} -
              -
              -
              {$form['skin_file_' . $k ]}
              @@ -464,7 +503,7 @@ EOF; } $IPBHTML .= << - +
              +EOF; + +$IPBHTML .= <<{$form_field} EOF; if( $desc ) { $IPBHTML .= <<{$desc} +
              {$desc} EOF; -} $IPBHTML .= << - {$form_field} - +
              EOF; +} //--endhtml--// return $IPBHTML; @@ -435,7 +452,6 @@ return $IPBHTML; /** * Show the form to "finish" adding the plugin * - * @access public * @param array Plugin data * @param array Groups that can report * @param array Groups that can moderate @@ -480,40 +496,40 @@ $IPBHTML .= <<

              {$this->lang->words['r_editplugin']}: {$plug_data['class_title']}

              -
                -
              • - - {$form['plugi_app']} -
              • -
              • - - {$form['plugi_can_report']} -
              • -
              • - - {$form['plugi_gperm']} -
              • -
              • - - {$form['plugi_enabled']} -
              • +
              {$form['skin_file_' . $i ]}
              @@ -485,7 +524,7 @@ EOF;
              - + @@ -499,7 +538,6 @@ return $IPBHTML; /** * Inline database changes dhtml box * - * @access public * @param array Hook data * @param array Form elements * @param int Current index @@ -519,7 +557,7 @@ $IPBHTML .= <<

              "); + ipb.templates['db_row'] = new Template("

            • "); ipb.templates['db_create'] = new Template("{$this->lang->words['desc_newtable']}


              {$this->lang->words['desc_fieldnames']}


              {$this->lang->words['desc_tabletype']}
              "); @@ -558,7 +596,7 @@ if( $i ) { $IPBHTML .= << - +
              - + + - EOF; return $IPBHTML; @@ -243,7 +261,6 @@ return $IPBHTML; /** * Show the main overview template * - * @access public * @param string Content * @return string HTML */ @@ -254,8 +271,8 @@ $IPBHTML .= <<{$this->lang->words['r_overview_title']}
              {$form['type_' . $k ]}
              @@ -645,7 +683,7 @@ EOF; } $IPBHTML .= << - +
              - - - - + + + EOF; //--endhtml--// @@ -214,7 +500,6 @@ return $IPBHTML; /** * Show a latest login record * - * @access public * @param array Record * @return string HTML */ @@ -222,20 +507,25 @@ public function acp_last_logins_row( $r ) { $IPBHTML = ""; //--starthtml--// +if( empty( $r['admin_username'] ) ) +{ + $r['admin_username'] = "" . $this->lang->words['cp_none_entered'] . ""; +} $IPBHTML .= << - - + - EOF; @@ -247,7 +537,6 @@ return $IPBHTML; /** * Wrapper for latest ACP logins * - * @access public * @param string Content * @return string HTML */ @@ -257,46 +546,29 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= << -

              {$this->lang->words['cp_latestadminlogins']}

              -
              {$form['type_' . $i ]}
              @@ -679,7 +717,7 @@ $IPBHTML .= <<
              - + diff --git a/upload/admin/applications/core/skin_cp/cp_skin_livesearch.php b/upload/admin/applications/core/skin_cp/cp_skin_livesearch.php deleted file mode 100644 index 975fe1f3..00000000 --- a/upload/admin/applications/core/skin_cp/cp_skin_livesearch.php +++ /dev/null @@ -1,402 +0,0 @@ - - * Invision Power Services - * IP.Board v3.1.4 - * ACP live search skin file - * Last Updated: $Date: 2010-07-06 11:07:25 -0400 (Tue, 06 Jul 2010) $ - * - * - * @author $Author: matt $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Friday 19th May 2006 17:33 - * @version $Revision: 6604 $ - */ - -class cp_skin_livesearch extends output -{ - /** - * Currently hiding settings - * - * @access private - * @var bool - */ - private $startedHideSettings = false; - - /** - * Currently hiding page links - * - * @access private - * @var bool - */ - private $startedHidePages = false; - - /** - * Currently hiding members - * - * @access private - * @var bool - */ - private $startedHideMembers = false; - - /** - * Entries until hidden - * - * @access private - * @var bool - */ - private $displayRows = 8; - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} - -/** - * Display the live search results - * - * @access public - * @param array Results - * @param string Current search term - * @return string HTML - */ -public function liveSearchDisplay( $results, $search_term ) { - -$IPBHTML = ""; -//--starthtml--// -$IPBHTML .= << -EOF; - -if( count($results) ) -{ - foreach( $results as $key => $output ) - { - if( $key == 'settings' ) - { - $text = $this->lang->words['ls_settings']; - } - else if( $key == 'location' ) - { - $text = $this->lang->words['ls_acppages']; - } - else if( $key == 'members' ) - { - $text = $this->lang->words['ls_members']; - } - else if( $key == 'groupLangs' ) - { - $text = $this->lang->words['ls_groups']; - } - else if( $key == 'groups' ) - { - $text = $this->lang->words['ls_grouptitles']; - } - else if( $key == 'forums' ) - { - $text = $this->lang->words['ls_forums']; - } - - if( !$output ) - { - continue; - } - - $IPBHTML .= << - {$text} {$this->lang->words[ -
                - {$output} -
              -EOF; - - -// If we started hidding members, we need to stop hiding them now... -if( $key == 'members' AND $this->startedHideMembers ) -{ - $this->startedHideMembers = false; - $IPBHTML .= << - -EOF; -} -// If we started hiding forums, we need to stop hiding them now... -else if( $key == 'forums' AND $this->startedHideForums ) -{ - $this->startedHideForums = false; - $IPBHTML .= << - -EOF; -} -// If we started hidding groups, we need to stop hiding them now... -else if( $key == 'groups' AND $this->startedHideGroups ) -{ - $this->startedHideGroups = false; - $IPBHTML .= << - -EOF; -} -// If we started hidding settings, we need to stop hiding them now... -else if( $key == 'settings' AND $this->startedHideSettings ) -{ - $this->startedHideSettings = false; - $IPBHTML .= << - -EOF; -} -// If we started hidding pages, we need to stop hiding them now... -else if( $key == 'location' AND $this->startedHidePages ) -{ - $this->startedHidePages = false; - $IPBHTML .= << - -EOF; -} - -$IPBHTML .= << -EOF; - } -} -else -{ - $IPBHTML .= <<{$this->lang->words['lsnoresults']} -EOF; -} - -$IPBHTML .= << -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Group language results - * - * @access public - * @return string HTML - */ -public function searchRowGroups() { -$IPBHTML = ""; - -//--starthtml--// -$IPBHTML .= <<{$this->lang->words['ls_groupresults']} -EOF; -//--endhtml--// -return $IPBHTML; -} - -/** - * Group title results - * - * @access public - * @param array Result - * @param int Section count - * @return string HTML - */ -public function searchRowGroupsTitles( $r, $secCount ) { -$IPBHTML = ""; - -if( $secCount > 10 ) -{ - if( !$this->startedHideGroups ) - { - $this->startedHideGroups = true; - - $IPBHTML .= << -
              - -
              +
              +
              + +
              +
              - - - - {$r['admin_username']} -
              +
              + {$r['admin_username']}
              + {$r['_admin_time']} - +
              - - + +
              - {$content} -
              - - +
              +

              + {$this->lang->words['cp_seeall_logins']} {$this->lang->words['_raquo']} + {$this->lang->words['cp_latestadminlogins']} +

              + EOF; -//--endhtml--// -return $IPBHTML; -} - - -/** - * Show the admins online record - * - * @access public - * @param array Record - * @return string HTML - */ -public function acp_onlineadmin_row( $r ) { - -$IPBHTML = ""; -//--starthtml--// - -$r['url'] = $this->registry->output->buildSEOUrl( $this->settings['board_url'] . '/index.php?showuser=' . $r['session_member_id'], 'none', $r['members_seo_name'], 'showuser' ); - -$IPBHTML .= << - - - + if( $content ){ + $IPBHTML .= $content; + } else { + $IPBHTML .= << + + +EOF; + } + + $IPBHTML .= << + EOF; //--endhtml--// @@ -306,7 +578,6 @@ return $IPBHTML; /** * Admins online wrapper * - * @access public * @param string Content * @return string HTML */ @@ -315,11 +586,14 @@ public function acp_onlineadmin_wrapper($content) { $IPBHTML = ""; //--starthtml--// -$IPBHTML .= << - {$content} -
              - {$r['members_display_name']} -
              {$r['session_location']} (IP: {$r['session_ip_address']})
              -
              - -
              + {$this->lang->words['cp_no_failed_logins']} +
              -EOF; +if( count( $content ) ) +{ + foreach( $content as $r ){ + $data[] = "lang->words['cp_from']} {$r['session_ip_address']}'>{$r['members_display_name']}"; + } + + $IPBHTML .= "({$this->lang->words['admins_online']} " . implode(", ", $data) . ")"; +} //--endhtml--// return $IPBHTML; @@ -328,7 +602,6 @@ return $IPBHTML; /** * Show latest actions record * - * @access public * @param array Record * @return string HTML */ @@ -354,45 +627,9 @@ EOF; return $IPBHTML; } -/** - * Latest actions wrapper - * - * @access public - * @param string Content - * @return string HTML - */ -public function acp_lastactions_wrapper($content) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -
              {$this->lang->words['cp_lastacpactions']}
              - - - - - - - $content -
               {$this->lang->words['cp_membername']}{$this->lang->words['cp_timeofaction']}
              - -
              - -EOF; - -//--endhtml--// -return $IPBHTML; -} - - /** * Show a warning box * - * @access public * @param string Title * @param string Content * @return string HTML @@ -403,9 +640,11 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= << -

              {$this->lang->words[ {$title}

              - {$content} +
              +

              {$title}

              +
              EOF; @@ -413,30 +652,9 @@ EOF; return $IPBHTML; } -/** - * Show a warning that an emergency skin rebuild has occurred - * - * @access public - * @return string HTML - * @deprecated Don't think this is done/called anymore - */ -public function warning_rebuild_emergency() { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= <<lang->words['cp_emergency']} -EOF; - -//--endhtml--// -return $IPBHTML; -} - /** * Show a warning that the rebuild following the upgrade hasn't been completed * - * @access public * @return string HTML */ public function warning_rebuild_upgrade() { @@ -455,7 +673,6 @@ return $IPBHTML; /** * Show form to change details * - * @access public * @return string HTML */ public function showChangeForm() { @@ -468,32 +685,34 @@ $IPBHTML .= <<

              {$this->lang->words['mycp_change_details']}

              -
                -
              • -
              • - - -
              • -
              • - - -
              • - -
              • -
              • - - -
              • -
              • - - -
              • -
              - +
              + + + + + + + + + + + + + + + + + + + + + + +
              {$this->lang->words['change_email_details']}
              {$this->lang->words['change__email']}
              {$this->lang->words['change__email_confirm']}
              {$this->lang->words['change_pass_details']}
              {$this->lang->words['change__pass']}
              {$this->lang->words['change__pass_confirm']}
              +
              +
              -
              - -
              +
              diff --git a/upload/admin/applications/core/skin_cp/cp_skin_performance.php b/upload/admin/applications/core/skin_cp/cp_skin_performance.php index 584e2719..6901fdbb 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_performance.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_performance.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Performance mode skin file
              - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ -class cp_skin_performance extends output +class cp_skin_performance { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Show the results from toggling the mode * - * @access public * @param bool Currently on or off * @param array Actions that were taken * @return string HTML @@ -89,7 +119,6 @@ return $IPBHTML; /** * Show the overview page * - * @access public * @param string Content * @return string HTML */ diff --git a/upload/admin/applications/core/skin_cp/cp_skin_qanda.php b/upload/admin/applications/core/skin_cp/cp_skin_qanda.php index 692ef624..e9df06b4 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_qanda.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_qanda.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Question and answer skin file
              - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
              + * Last Updated: $Date: 2011-08-01 17:58:16 -0400 (Mon, 01 Aug 2011) $
                * 
              * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 9346 $ */ -class cp_skin_qanda extends output +class cp_skin_qanda { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Show the q&a form * - * @access public * @param string Action * @param int ID * @param array Form elements @@ -57,16 +87,25 @@ $IPBHTML .= <<

              {$button}

              -
                -
              • - - {$form['question']} -
              • -
              • - - {$form['answers']} -
              • -
              + + + + + + + + + +
              + {$this->lang->words['qa_form_question']} + + {$form['question']} +
              + {$this->lang->words['qa_form_answers']} + + {$form['answers']}
              + {$this->lang->words['qa_form_answers_extra']} +
              @@ -81,7 +120,6 @@ return $IPBHTML; /** * Show the overview page * - * @access public * @param array Rows * @return string HTML */ @@ -90,52 +128,81 @@ public function overview( $rows ) $IPBHTML = ""; //--starthtml--// + $IPBHTML .= <<

              {$this->lang->words['qa_help_title']}

              - + +
              +
              HTML; -if ( count( $rows ) AND ! $this->settings['registration_qanda'] ) -{ - $this->lang->words['qa_not_on_desc'] = sprintf( $this->lang->words['qa_not_on_desc'], $this->settings['base_url'] . $this->form_code .'&do=switchOn' ); - - $IPBHTML .= $this->registry->output->global_template->warning_box( $this->lang->words['qa_not_on_title'], $this->lang->words['qa_not_on_desc'] ) . "
              "; -} + $IPBHTML .= <<

              {$this->lang->words['qa_current']}

              - +
              HTML; if( count($rows) ) { $IPBHTML .= << - - + + HTML; foreach( $rows as $r ) { + $r['_answers'] = IPSText::truncate( str_replace("\r", ", ", $r['qa_answers']), 50 ); + $IPBHTML .= << - + + HTML; @@ -144,7 +211,17 @@ HTML; else { $IPBHTML .= << + HTML; } diff --git a/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php b/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php index 247ec03b..0a8dd351 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Cleanup and rebuild tools skin file
              - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
              + * Last Updated: $Date: 2011-05-26 11:36:44 -0400 (Thu, 26 May 2011) $
                * 
              * * @author $Author: bfarber $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8899 $ */ -class cp_skin_rebuild extends output +class cp_skin_rebuild { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Splash screen of available tools * - * @access public * @return string HTML */ public function toolsSplashScreen() @@ -42,6 +72,28 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= << +

              {$this->lang->words['re_310to320']}

              + + +form_code}' method='post' name='theAdminForm' id='theAdminForm'> + + +
              +

              {$this->lang->words['re_320photos']}

              + +
              {$this->lang->words['qa_form_question']}{$this->lang->words['qa_options']}{$this->lang->words['qa_form_question']} 
              {$r['qa_question']}
              - {$this->lang->words[ - +HTML; + + if ( $this->registry->class_permissions->checkPermission( 'qa_manage' ) ) + { + $IPBHTML .= << +
            • + form_code}&do=edit&id={$r['qa_id']}'>{$this->lang->words['qa_edit']} +
            • +
            • + form_code}&do=remove&id={$r['qa_id']}");'>{$this->lang->words['qa_delete']} +
            • +HTML; + } + + $IPBHTML .= <<
              {$this->lang->words['qa_none']}
              {$this->lang->words['qa_none']}. +HTML; + if ( $this->registry->class_permissions->checkPermission( 'qa_manage' ) ) + { + $IPBHTML .= <<form_code}&do=new' title='{$this->lang->words['qa_addlink']}' class='mini_button'>{$this->lang->words['qa_createonenow']} +HTML; + } + + $IPBHTML .= <<
              + + + +
              {$this->lang->words['re_320photos_info']}
              + +
              + {$this->lang->words['re_convertfromphotos']} +
              + +
              +

              {$this->lang->words['re_230to300']}

              @@ -52,14 +104,17 @@ $IPBHTML .= <<

              {$this->lang->words['re_300pms']}

              -
                -
              • {$this->lang->words['re_300pms_info']}
              • -
              + + + + +
              {$this->lang->words['re_300pms_info']}
              +
              - +

              {$this->lang->words['re_20to21']}

              @@ -70,10 +125,13 @@ $IPBHTML .= <<

              {$this->lang->words['re_dupe2']}

              - -
                -
              • {$this->lang->words['re_dupe2_info']}
              • -
              + + + + + +
              {$this->lang->words['re_dupe2_info']}
              +
              @@ -87,9 +145,12 @@ $IPBHTML .= <<

              {$this->lang->words['re_events']}

              -
                -
              • {$this->lang->words['re_events_info']}
              • -
              + + + + +
              {$this->lang->words['re_events_info']}
              +
              @@ -103,9 +164,12 @@ $IPBHTML .= <<

              {$this->lang->words['re_polls']}

              -
                -
              • {$this->lang->words['re_polls_info']}
              • -
              + + + + +
              {$this->lang->words['re_polls_info']}
              +
              @@ -123,9 +187,11 @@ $IPBHTML .= <<

              {$this->lang->words['re_dupe1']}

              -
                -
              • {$this->lang->words['re_dupe1_info']}
              • -
              + + + + +
              {$this->lang->words['re_dupe1_info']}
              @@ -139,9 +205,11 @@ $IPBHTML .= <<

              {$this->lang->words['re_converge']}

              -
                -
              • {$this->lang->words['re_converge_info']}
              • -
              + + + + +
              {$this->lang->words['re_converge_info']}
              @@ -155,9 +223,11 @@ $IPBHTML .= <<

              {$this->lang->words['re_ban']}

              -
                -
              • {$this->lang->words['re_ban_info']}
              • -
              + + + + +
              {$this->lang->words['re_ban_info']}
              @@ -173,7 +243,6 @@ return $IPBHTML; /** * Rebuild content splash screen * - * @access public * @param array Form elements * @param array Sections we can rebuild * @param array Sections we have rebuilt @@ -189,6 +258,12 @@ $IPBHTML .= <<{$this->lang->words['re_title']}
              +HTML; + +if ( $this->registry->class_permissions->checkPermission( 'tools_recount' ) ) +{ + +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -196,34 +271,40 @@ $IPBHTML .= <<

              {$this->lang->words['re_stats']}

              -
                + + + + + -
              • - - {$form['posts']} -
              • - -
              • - - {$form['members']} -
              • - -
              • - - {$form['lastreg']} -
              • - -
              • - - {$form['online']} -
              • - + + + + + + + + + + + + + + +
                {$this->lang->words['re_s_total']}{$form['posts']}
                {$this->lang->words['re_s_members']}{$form['members']}
                {$this->lang->words['re_s_last']}{$form['lastreg']}
                {$this->lang->words['re_s_most']}{$form['online']}
                +

              +HTML; +} + +if ( $this->registry->class_permissions->checkPermission( 'tools_resyncht' ) ) +{ +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -231,18 +312,26 @@ $IPBHTML .= <<

              {$this->lang->words['re_topics']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + + +
              {$this->lang->words['re_topics']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_topics_info']}

              +HTML; +} + +if ( $this->registry->class_permissions->checkPermission( 'tools_resynch' ) ) +{ + +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -250,12 +339,12 @@ $IPBHTML .= <<

              {$this->lang->words['re_forums']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + + +
              {$this->lang->words['re_forums']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_forums_info']}
              @@ -263,7 +352,9 @@ $IPBHTML .= <<
              HTML; -if( count($rebuildSections) ) +} + +if( count($rebuildSections) and $this->registry->class_permissions->checkPermission( 'tools_rebuild' ) ) { $IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -273,12 +364,13 @@ if( count($rebuildSections) )

              {$this->lang->words['re_rebuild']}

              -
                -
              • - + +
                -
                  -
                • +
                + + + HTML; foreach( $rebuildSections as $section ) @@ -291,15 +383,23 @@ HTML; } $IPBHTML .= <<{$description} + + + + HTML; } $IPBHTML .= <<  {$form['pergo']} {$this->lang->words['re_percycle']} + + + + + + - - + +
                {$this->lang->words['re_rebuildbutton']}
                  {$description}
                {$this->lang->words['re_percycle']}{$form['pergo']}
                @@ -308,6 +408,8 @@ HTML; HTML; } +if ( $this->registry->class_permissions->checkPermission( 'tools_postcounts' ) ) +{ $IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -316,12 +418,12 @@ $IPBHTML .= <<

                {$this->lang->words['re_user']}

                -
                  -
                • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
                • -
                + + + + + +
                {$this->lang->words['re_user']}{$form['pergo']} {$this->lang->words['re_percycle']}
                {$this->lang->words['re_user_info']}
                @@ -335,12 +437,13 @@ $IPBHTML .= <<

                {$this->lang->words['re_seouser']}

                -
                  -
                • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
                • -
                + + + + + +
                {$this->lang->words['re_seouser']}{$form['pergo']} {$this->lang->words['re_percycle']}
                {$this->lang->words['re_seouser_info']}
                +
                @@ -354,12 +457,12 @@ $IPBHTML .= <<

                {$this->lang->words['re_msgcount']}

                -
                  -
                • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
                • -
                + + + + +
                {$this->lang->words['re_msgcount']} + {$form['pergo']} {$this->lang->words['re_percycle']}
                {$this->lang->words['re_msgcount_info']}
                @@ -373,18 +476,24 @@ $IPBHTML .= <<

                {$this->lang->words['re_count']}

                -
                  -
                • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
                • -
                + + + + + +
                {$this->lang->words['re_count']}{$form['pergo']} {$this->lang->words['re_percycle']}
                {$this->lang->words['re_count_info']}

              +HTML; +} + +if ( $this->registry->class_permissions->checkPermission( 'tools_thumbs' ) ) +{ +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -392,12 +501,12 @@ $IPBHTML .= <<

              {$this->lang->words['re_pphoto']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + + +
              {$this->lang->words['re_pphoto']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_pphoto_info']}
              @@ -411,17 +520,23 @@ $IPBHTML .= <<

              {$this->lang->words['re_thumb']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + + +
              {$this->lang->words['re_thumb']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_thumb_info']}

              +HTML; +} + +if ( $this->registry->class_permissions->checkPermission( 'tools_attach' ) ) +{ +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -430,18 +545,25 @@ $IPBHTML .= <<

              {$this->lang->words['re_data']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + + +
              {$this->lang->words['re_data']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_data_info']}

              +HTML; +} + +if ( $this->registry->class_permissions->checkPermission( 'tools_orphaned' ) ) +{ +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -449,36 +571,24 @@ $IPBHTML .= <<

              {$this->lang->words['re_orph']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + +
              + {$this->lang->words['re_orph']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_orph_info']}

              -
              form_code}' method='post' name='theAdminForm' id='theAdminForm'> - - - -
              -

              {$this->lang->words['re_av']}

              - -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              -
              - -
              -
              -

              +HTML; +} + +if ( $this->registry->class_permissions->checkPermission( 'tools_orphanp' ) ) +{ +$IPBHTML .= <<form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -487,12 +597,12 @@ $IPBHTML .= <<

              {$this->lang->words['re_uphoto']}

              -
                -
              • - - {$form['pergo']} {$this->lang->words['re_percycle']} -
              • -
              + + + + + +
              {$this->lang->words['re_uphoto']}{$form['pergo']} {$this->lang->words['re_percycle']}
              {$this->lang->words['re_uphoto_info']}
              @@ -500,6 +610,8 @@ $IPBHTML .= << HTML; +} + //--endhtml--// return $IPBHTML; } diff --git a/upload/admin/applications/core/skin_cp/cp_skin_reports.php b/upload/admin/applications/core/skin_cp/cp_skin_reports.php index 570bc8b1..b69cf75e 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_reports.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_reports.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Report center skin file
              - * Last Updated: $Date: 2010-05-19 21:06:53 -0400 (Wed, 19 May 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6326 $ + * @version $Revision: 8644 $ */ -class cp_skin_reports extends output +class cp_skin_reports { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Show the plugins overview page * - * @access public * @param string Content * @return string HTML */ @@ -44,8 +74,8 @@ $IPBHTML .= <<{$this->lang->words['r_plugmanager']}
                - {$this->lang->words[ +
              {$data[ {$data['points']} {$this->lang->words['pointssuffix']} - +
              +
              - - + + - - + + - - + +
              {$this->lang->words['r_totalreports']}{$content['reports_total']}{$this->lang->words['r_totalreports']}{$content['reports_total']}
              {$this->lang->words['r_totalcomments']}{$content['comments_total']}{$this->lang->words['r_totalcomments']}{$content['comments_total']}
              {$this->lang->words['r_activeplugins']}{$content['active_plugins']} / {$content['total_plugins']}{$this->lang->words['r_activeplugins']}{$content['active_plugins']} / {$content['total_plugins']}

              {$this->lang->words['r_graphstats']}

              - +
              -
              - form_code}&code=chart_report_stats' /> - form_code}&code=chart_top_moderator' /> + + form_code}&do=chart_report_stats' /> + form_code}&do=chart_top_moderator' />
              @@ -298,7 +315,6 @@ return $IPBHTML; /** * Show the form to add/edit a plugin * - * @access public * @param array Plugin data * @return string HTML */ @@ -347,7 +363,7 @@ $IPBHTML = ""; $IPBHTML .= << -

              Плагины системы жалоб

              +

              {$this->lang->words['r_rcpluginstitle']}

              form_code}&do={$code}&secure_key={$secure_key}' method='post'> @@ -355,38 +371,38 @@ $IPBHTML .= <<

              {$this->lang->words['r_registernew']}

              -
                -
              • - - {$form['plugi_app']} -
              • -
              • - - {$form['plugi_title']} -
              • -
              • - - {$form['plugi_version']} -
              • -
              • - - {$form['plugi_desc']} -
              • -
              • - - {$form['plugi_author']} -
              • -
              • - - {$form['plugi_author_url']} -
              • -
              • - - /admin/applications/YOURAPP/extensions/reportPlugins/ {$form['plugi_file']} .php -
              • -
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              {$this->lang->words['r_app']}{$form['plugi_app']}
              {$this->lang->words['r_plugintitle']}{$form['plugi_title']}
              {$this->lang->words['r_whatcall']}
              {$this->lang->words['r_version']}{$form['plugi_version']}
              {$this->lang->words['r_description']}{$form['plugi_desc']}
              {$this->lang->words['r_authorname']}{$form['plugi_author']}
              {$this->lang->words['r_authorurl']}{$form['plugi_author_url']}
              {$this->lang->words['r_pluginfile']}/admin/applications/YOURAPP/extensions/reportPlugins/ {$form['plugi_file']} .php
              - +
              @@ -399,7 +415,6 @@ return $IPBHTML; /** * Add a row * - * @access public * @param string Title * @param string Description * @param string Form field @@ -411,22 +426,24 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= << -
              + {$title}
              + + + + + + + + + + + + + + + + EOF; if( IN_DEV == 1 ) { $IPBHTML .= << - - {$form['plugi_lockd']} - + + + + EOF; } $IPBHTML .= << +
              {$this->lang->words['r_app']}{$form['plugi_app']}
              {$this->lang->words['r_groups_submit']}{$form['plugi_can_report']}
              {$this->lang->words['r_groups_submit_info']}
              {$this->lang->words['r_groups']}{$form['plugi_gperm']}
              {$this->lang->words['r_groups_info']}
              {$this->lang->words['r_pluginenabled']}{$form['plugi_enabled']}
              {$this->lang->words['r_safemode']}{$form['plugi_lockd']}
              - +
              @@ -526,7 +542,6 @@ return $IPBHTML; /** * Form to add/edit a status image * - * @access public * @param string Code * @param array Status record * @param array Image data @@ -557,26 +572,26 @@ $IPBHTML .= <<

              {$status['title']} : {$this->lang->words['r_confimage']}

              -
                -
              • - - {$form['img_filename']} -
              • -
              • - - {$form['img_width']} -
              • -
              • - - {$form['img_height']} -
              • -
              • - - {$form['img_points']} -
              • -
              + + + + + + + + + + + + + + + + + +
              {$this->lang->words['r_image']}{$form['img_filename']}
              {$this->lang->words['r_image_info']}
              {$this->lang->words['r_width']}{$form['img_width']}
              {$this->lang->words['r_height']}{$form['img_height']}
              {$this->lang->words['r_points']}{$form['img_points']}
              {$this->lang->words['r_points_info']}
              - +
              @@ -589,7 +604,6 @@ return $IPBHTML; /** * Form to add/edit a status * - * @access public * @param string Code * @param array Status data * @return string HTML @@ -618,22 +632,22 @@ $IPBHTML .= <<

              {$this->lang->words['r_' . $code ]}

              -
                -
              • - - {$form['stat_title']} -
              • -
              • - - {$form['stat_ppr']} -
              • -
              • - - {$form['stat_pph']} -
              • -
              + + + + + + + + + + + + + +
              {$this->lang->words['r_name']}{$form['stat_title']}
              {$this->lang->words['r_name_info']}
              {$this->lang->words['r_pointsper']}{$form['stat_ppr']}
              {$this->lang->words['r_pointsper_info']}
              {$this->lang->words['r_minutes']}{$form['stat_pph']}
              {$this->lang->words['r_minutes_info']}
              - +
              diff --git a/upload/admin/applications/core/skin_cp/cp_skin_security.php b/upload/admin/applications/core/skin_cp/cp_skin_security.php index d9700c89..6568aced 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_security.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_security.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Security skin file
              - * Last Updated: $Date: 2010-05-19 21:06:53 -0400 (Wed, 19 May 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6326 $ + * @version $Revision: 8644 $ */ -class cp_skin_security extends output +class cp_skin_security { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * List administrators * - * @access public * @param array Rows * @return string HTML */ @@ -45,7 +75,7 @@ $IPBHTML = ""; $IPBHTML .= <<

              {$this->lang->words['skin_header_admins']}

              - +
              @@ -62,14 +92,18 @@ if( count( $rows ) AND is_array( $rows ) ) foreach( $rows as $row ) { $IPBHTML .= << + - + HTML; } @@ -92,55 +126,9 @@ HTML; return $IPBHTML; } -/** - * Row for list administrator - * - * @access public - * @param array Member data - * @return string HTML - * @deprecated Seems this is handled by list_admin_overview, maybe? - */ -public function list_admin_row( $member ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << - - - - - - - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - - /** * Wrapper to show files checked for anti-virus * - * @access public * @param string Content * @return string HTML */ @@ -151,12 +139,11 @@ $IPBHTML = ""; $IPBHTML .= << -
              -
              {$this->lang->words['skin_header_virus']}
              -
              {$this->lang->words['skin_th_name']} {$this->lang->words['skin_th_primary_group']}
              {$row['members_display_name']}
              {$row['_joined']}
              {$row['_mgroup']} {$row['_mgroup_others']} 
              {$row['ip_address']}
              {$row['email']} {$row['posts']}{$this->lang->words['skin_edit_member']} + +
              - {$member['members_display_name']} -
              {$member['_joined']}
              -
              - {$member['_mgroup']} - - {$member['_mgroup_others']}  - -
              {$member['ip_address']}
              -
              - {$member['email']} - - {$member['posts']} - - {$this->lang->words['skin_edit_member']} -
              - $content +
              +

              {$this->lang->words['skin_header_virus']}

              +
              + {$content}
              -
               
              EOF; @@ -167,7 +154,6 @@ return $IPBHTML; /** * Anti-virus checked file row * - * @access public * @param string Path to file * @return string HTML */ @@ -178,7 +164,7 @@ $IPBHTML = ""; $IPBHTML .= << -
              + - {$file_path}
              - $content +
              +

              {$this->lang->words['skin_suspicious_files']}

              +
              + + {$content}
              {$this->lang->words['skin_th_filesize']}
              -
               
              EOF; @@ -225,7 +205,6 @@ return $IPBHTML; /** * Row for bad files in AV checker * - * @access public * @param string File path * @param string File name * @param array Data about the file @@ -238,7 +217,7 @@ $IPBHTML = ""; $IPBHTML .= << -
              +
              ({$data['human']}k)   {$data['mtime']}
              @@ -261,7 +240,6 @@ return $IPBHTML; /** * Wrapper for files from deep scan * - * @access public * @param string Content * @return string HTML */ @@ -272,7 +250,7 @@ $IPBHTML = ""; $IPBHTML .= <<form_code}&do=deep_scan' method='POST'> -
              {$this->lang->words['sec_show']}: +
              {$this->lang->words['sec_show']}: - +
              -
              -
              {$this->lang->words['sec_executable_files']}
              -
              -
              - {$this->lang->words['sec_file_size']}   {$this->lang->words['sec_last_modified']} -
              -
              - +
              + +
              +

              {$this->lang->words['sec_executable_files']}

              + +
              + $content
              {$this->lang->words['sec_file_size']}   {$this->lang->words['sec_last_modified']}
              -
               
              EOF; @@ -307,7 +283,6 @@ return $IPBHTML; /** * Show the row for the bad file from deep scan * - * @access public * @param string File path * @param string File name * @param array Data about the bad file record @@ -320,7 +295,7 @@ $IPBHTML = ""; $IPBHTML .= << -
              +
              ({$data['human']}k)   {$data['mtime']}
              @@ -343,7 +318,6 @@ return $IPBHTML; /** * Security tools overview page * - * @access public * @param string Content * @return string HTML */ @@ -364,7 +338,7 @@ $IPBHTML .= <<

              {$this->lang->words['h3_title_security']}

              - +
              {$content['bad']} {$content['ok']} {$content['good']} @@ -380,7 +354,6 @@ return $IPBHTML; /** * "Bad" security item * - * @access public * @param string Title * @param string Description * @param string Button text @@ -396,14 +369,14 @@ $IPBHTML = ""; $IPBHTML .= << @@ -416,7 +389,6 @@ return $IPBHTML; /** * "Good" security item * - * @access public * @param string Title * @param string Description * @param string Button text @@ -432,14 +404,14 @@ $IPBHTML = ""; $IPBHTML .= << @@ -452,7 +424,6 @@ return $IPBHTML; /** * "Ok" security item * - * @access public * @param string Title * @param string Description * @param string Button text @@ -468,14 +439,14 @@ $IPBHTML = ""; $IPBHTML .= << @@ -488,7 +459,6 @@ return $IPBHTML; /** * Form to add the htaccess file * - * @access public * @return string HTML */ public function htaccess_form() { @@ -526,7 +496,7 @@ $IPBHTML .= <<
              - +

              @@ -542,7 +512,6 @@ return $IPBHTML; /** * Show details to manually set htaccess file * - * @access public * @param string .htaccess password * @param string .htaccess auth * @return string HTML @@ -590,7 +559,6 @@ return $IPBHTML; /** * Rename admin directory details * - * @access public * @return string HTML */ public function rename_admin_dir() { diff --git a/upload/admin/applications/core/skin_cp/cp_skin_settings.php b/upload/admin/applications/core/skin_cp/cp_skin_settings.php new file mode 100644 index 00000000..bd49cae3 --- /dev/null +++ b/upload/admin/applications/core/skin_cp/cp_skin_settings.php @@ -0,0 +1,638 @@ +registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + +/** + * Setting titles wrapper + * + * @param array Setting groups + * @param string Application tab to start on + * @return string HTML + */ +public function settings_titles_wrapper($settings, $start_app='') { + +$IPBHTML = ""; +//--starthtml--// + +$_default_tab = !empty( $this->request['_dtab'] ) ? $this->request['_dtab'] : 'System'; + +$IPBHTML .= << +

              {$this->lang->words['tol_settings']}

              + + + +
              +

              {$this->lang->words['tol_settings_groups']}

              +
              + « + » +
                +EOF; + +$tab_names = array( 'System' => 'Система', 'Performance' => 'Производительность', 'IPS Apps' => 'Приложения', 'Members' => 'Пользователи', 'Advanced' => 'Дополнительно', 'Forums' => 'Форумы', 'Hooks' => 'Модификации'); + +foreach( $settings as $tab => $group ) +{ + $tab_name = ($tab_names[ $tab ]) ? $tab_names[ $tab ] : $tab; + + if ( ipsRegistry::$request['app'] AND $tab == ipsRegistry::$request['app'] ) + { + $_default_tab = $tab; + } + + $_tab = IPSText::md5Clean( $tab ); + +$IPBHTML .= <<{$tab_name} + +EOF; +} + +$IPBHTML .= << +
              + +
              +EOF; + + +foreach( $settings as $tab => $app_data ) +{ + $_tab = IPSText::md5Clean( $tab ); +$IPBHTML .= << +
              - {$this->lang->words[ + {$this->lang->words[ {$title}
              {$desc}
              - $button + {$button}
              - {$this->lang->words[ + {$this->lang->words[ {$title}
              {$desc}
              - $button + {$button}
              - {$this->lang->words[ + {$this->lang->words[ {$title}
              {$desc}
              - $button + {$button}
              + +EOF; + foreach( $app_data as $r ) + { + + if(IN_DEV) + { + $export_settings_group = "
            • form_code}&do=MOD_export_setting&conf_group={$r['conf_title_id']}' title='{$this->lang->words['export_group']}'> {$this->lang->words['export_group']} +
            • "; + } + + $img = is_file( IPSLib::getAppDir( $r['conf_title_app'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $r['conf_title_app'] ) . '/' . $r['conf_title_app'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$r['conf_title_app']}.png"; + +$IPBHTML .= << + + + +EOF; + } +$IPBHTML .= << + + +EOF; + +} + +$IPBHTML .= << + + + + +
              + +
              form_code}&do=settings_do_import' enctype='multipart/form-data' method='post'> +
              +

              {$this->lang->words['tol_import_xml_settings']}

              +
              {$this->lang->words[ + form_code}&do=setting_view&conf_group={$r['conf_title_id']}' class='larger_text'>{$r['conf_title_title']} + ({$r['conf_title_count']} {$this->lang->words['settings_suffix']}) +EOF; + +if( $r['conf_title_desc'] ) +{ + $IPBHTML .= <<{$r['conf_title_desc']} +EOF; +} + +$IPBHTML .= << + + + +
              + + + + + + + + +
              {$this->lang->words['tol_upload_xml_settings_file_from_']}
              {$this->lang->words['tol_duplicate_entries_will_not_be_']}
              {$this->lang->words['tol_or_enter_the_filename_of_the_x']}
              {$this->lang->words['tol_the_file_must_be_uploaded_into']}
              +
              + +
              +
              + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Form to add/edit a setting group + * + * @param array Form elements + * @param string Form title + * @param string Action code + * @param string Button text + * @return string HTML + */ +public function settings_title_form($form, $title, $formcode, $button) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

              {$this->lang->words['s_title']}

              + + +
              form_code}&do=$formcode&id={$this->request['id']}' method='post'> +
              +

              {$title}

              + + + + + + + + + + + + + + + + + +EOF; +//startif +if ( $form['conf_title_keyword'] != '' ) +{ +$IPBHTML .= << + + + + + + + +EOF; +}//endif +$IPBHTML .= << +
              + +
              + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * View settings wrapper + * + * @param string Page title + * @param string Content + * @param string Search button + * @param string Bounceback URL + * @return string HTML + */ +public function settings_view_wrapper( $title, $content, $searchbutton, $bounceback='' ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

              {$this->lang->words['settings_h_prefix']} {$title}

              +EOF; + + if ( ipsRegistry::$request['search'] == '' AND $bounceback == '' ) + { + if ( $searchbutton ) + { + $IPBHTML .= << + + +EOF; + } + }//endif + +$IPBHTML .= << +
              request['conf_group']}&search={$this->request['search']}' method='post'> + + +
              +

              {$title}

              +
              + {$this->lang->words['tol_setting_group_title']} + {$form['conf_title_title']}
              + {$this->lang->words['tol_setting_group_application']} + {$form['conf_title_app']}
              + {$this->lang->words['tol_setting_group_tab']} + {$form['conf_title_tab']}
              + {$this->lang->words['tol_setting_group_description']} + {$form['conf_title_desc']}
              + {$this->lang->words['tol_setting_group_keyword']} + + {$form['conf_title_keyword']}
              + {$this->lang->words['tol_used_to_pull_this_from_the_db_']} +
              + {$this->lang->words['tol_hide_from_main_settings_list']} + {$form['conf_title_noshow']}
              + {$content} +
              +
              + +
              +
              + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Setting that starts a setting group + * + * @param array Setting + * @return string HTML + */ +public function settings_row_start_group($r) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +
              + + + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * View a setting row + * + * @param array Setting + * @param string Edit button + * @param string Delete button + * @param string Form element + * @param string Revert button + * @return string HTML + */ +public function settings_view_row($r, $edit, $delete, $form_element, $revert_button, $elem_type) { + +$IPBHTML = ""; +//--starthtml--// + +$_isClass = !$r['conf_start_group'] ? "isDraggable" : ''; + +$IPBHTML .= << + + + + + +EOF; + +if( $r['conf_start_group'] ) +{ + $IPBHTML .= << + + +EOF; +} + +//--endhtml--// +return $IPBHTML; +} + +/** + * Automcplete field + * + * @return string HTML + */ +public function nameAutoCompleteField( $key, $val ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Form to add/edit a setting + * + * @param array Setting + * @param string Form title + * @param string Action code + * @param string Button text + * @return string HTML + */ +public function settings_form($form, $title, $formcode, $button) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

              {$this->lang->words['add_setting_button']}

              + + +
              form_code}&do=$formcode&id={$this->request['id']}' method='post'> +
              +

              {$title}

              +
              {$r['conf_start_group']}
               
              + {$r['conf_title']} + + {$form_element}
              + {$r['conf_description']} +
              +EOF; + //startif + if ( $edit or $delete or $revert_button ) + { + $IPBHTML .= << + {$revert_button} + {$edit} + {$delete} + +EOF; + }//endif +$IPBHTML .= << +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +//startif +if ( $form['conf_protected'] != '' ) +{ +$IPBHTML .= << + + + +EOF; +}//endif +$IPBHTML .= << + + + +
              + {$this->lang->words['tol_setting_title']} + + {$form['conf_title']} +
              + {$this->lang->words['tol_setting_position']} + + {$form['conf_position']} +
              + {$this->lang->words['tol_setting_description']} + + {$form['conf_description']} +
              + {$this->lang->words['tol_setting_group']} + + {$form['conf_group']} +
              + {$this->lang->words['tol_setting_type']} + + {$form['conf_type']} +
              + {$this->lang->words['tol_setting_key']} + + {$form['conf_key']} +
              + {$this->lang->words['tol_setting_current_value']} + + {$form['conf_value']} +
              + {$this->lang->words['tol_setting_default_value']} + + {$form['conf_default']} +
              + {$this->lang->words['tol_setting_extra']} + + {$form['conf_extra']}
              + {$this->lang->words['tol_use_for_creating_form_element_']} +
              + {$this->lang->words['tol_raw_php_code_to_eval_before_sh']} + + {$form['conf_evalphp']}
              + {$this->lang->words['tol_036show_1_is_set_when_showing_']} +
              + {$this->lang->words['setting_keywords']} + + {$form['conf_keywords']}
              + {$this->lang->words['setting_keywords_desc']} +
              + {$this->lang->words['tol_start_setting_group']} + + {$form['conf_start_group']}
              + {$this->lang->words['tol_enter_title_here_or_leave_blan']} +
              + {$this->lang->words['tol_make_a_default_setting_cannot_']} + + {$form['conf_protected']} +
              + {$this->lang->words['tol_add_this_option_into_the_setti']} + + {$form['conf_add_cache']} +
              +
              + +
              + + +EOF; + +//--endhtml--// +return $IPBHTML; +} +} \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/cp_skin_setup.php b/upload/admin/applications/core/skin_cp/cp_skin_setup.php index eee67752..43d856ad 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_setup.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_setup.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Setup skin file
              - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ -class cp_skin_setup extends output +class cp_skin_setup { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Redirect screen for app setup * - * @access public * @param array Output pieces * @param array Error pieces * @param string Next URL to redirect to @@ -122,7 +152,6 @@ return $IPBHTML; /** * Show the finished screen for app setup * - * @access public * @param array Data * @param string Type of setup * @return string HTML @@ -157,7 +186,6 @@ return $IPBHTML; /** * Show the splash start screen for app setup * - * @access public * @param array Data * @param array Errors * @param string Setup type @@ -198,36 +226,36 @@ $IPBHTML .= <<

              {$prefix} {$data['title']} {$this->lang->words['applications_title']}

              - +
              - - - - - - - -
              - {$this->lang->words['current_version']} + + {$this->lang->words['current_version']} + {$data['current_version']}
              - {$prefix} {$this->lang->words['version_suffix']} + + {$prefix} {$this->lang->words['version_suffix']} + {$data['latest_version']}
              - {$this->lang->words['author_suffix']} + + {$this->lang->words['author_suffix']} + {$data['author']}
              - {$this->lang->words['duplicate_tables']} + + {$this->lang->words['duplicate_tables']} + + EOF; } diff --git a/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php index 8fa0e53f..49cf6da4 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php @@ -2,33 +2,64 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Error log skin file
              - * Last Updated: $Date: 2010-09-30 21:47:05 -0400 (Thu, 30 Sep 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6929 $ + * @version $Revision: 8644 $ */ -class cp_skin_spamlogs extends output +class cp_skin_spamlogs { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } public function spamServiceTest( $result ) { @@ -57,7 +88,6 @@ return $IPBHTML; /** * Spam log wrapper * - * @access public * @param array Rows * @param string Page links * @return string HTML @@ -68,12 +98,9 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= << -

              {$this->lang->words['spamlog_searchh3']}

              -
              form_code}' method='post'> +form_code}' method='post' class='information-box'>

              -
              - +
              form_code}' method='post' name='theAdminForm' id='theAdminForm'> @@ -81,7 +108,7 @@ $IPBHTML .= <<

              {$this->lang->words['slog_spamlogs']}

              - +
              @@ -122,12 +149,11 @@ HTML; $IPBHTML .= <<
              -
              - {$links} -
              -
              +
               {$this->lang->words['erlog_removeall']} 
              +
              {$links}
              +
              diff --git a/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php index 8f4d31f1..3eb5c4d3 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php @@ -2,38 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Spiderlogs skin file
              - * Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 5713 $ + * @version $Revision: 8644 $ */ -class cp_skin_spiderlogs extends output +class cp_skin_spiderlogs { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Spider logs wrapper * - * @access public * @param array Spider log rows * @return string HTML */ @@ -53,7 +83,7 @@ $IPBHTML .= <<

              {$this->lang->words['slog_thelogs']}

              -
              {$this->lang->words['slog_list_id']} {$this->lang->words['slog_list_date']}
              +
              @@ -69,7 +99,7 @@ if( count($rows) AND is_array($rows) ) { $IPBHTML .= << - + @@ -98,7 +128,12 @@ $IPBHTML .= <<

              {$this->lang->words['slog_search']}

              -

              {$this->lang->words['slog_searchfor']} {$form['search_for']}{$this->lang->words['slog_searchquery']}

              +
              {$this->lang->words['slog_botname']} {$this->lang->words['slog_hits']}{$row['_bot_name']}{$row['_bot_name']} {$row['cnt']} {$row['_time']} form_code}&do=view&bid={$row['_bot_url']}'>{$this->lang->words['slog_view']}
              + + + + +
              {$this->lang->words['slog_searchfor']}{$form['search_for']}
              {$this->lang->words['slog_searchquery']}
              @@ -114,7 +149,6 @@ return $IPBHTML; /** * View a single spider's log entry * - * @access public * @param array Rows * @param string Page links * @return string HTML @@ -131,7 +165,7 @@ $IPBHTML .= <<

              {$this->lang->words['slog_thelogs']}

              - +
              @@ -146,7 +180,7 @@ if( count($rows) AND is_array($rows) ) { $IPBHTML .= << - + @@ -166,7 +200,8 @@ HTML; $IPBHTML .= <<
              -
              {$pages}
              +
              {$pages}
              +

              diff --git a/upload/admin/applications/core/skin_cp/cp_skin_sql.php b/upload/admin/applications/core/skin_cp/cp_skin_sql.php index 0724d95f..af307a3b 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_sql.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_sql.php @@ -2,39 +2,68 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * SQL Toolbox skin file
              - * Last Updated: $Date: 2010-09-27 18:18:35 -0400 (Mon, 27 Sep 2010) $
              + * Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6917 $ + * @version $Revision: 8644 $ */ -class cp_skin_sql extends output +class cp_skin_sql { - -/** - * Prevent our main destructor being called by this class - * - * @access public - * @return void - */ -public function __destruct() -{ -} - + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** * Result from running an SQL tool * - * @access public * @param string Page title * @param array Columns * @param array Rows @@ -48,14 +77,14 @@ $IPBHTML .= <<

              {$title}

              -
              {$this->lang->words['slog_botname']} {$this->lang->words['slog_querystring']}{$row['_bot_name']}{$row['_bot_name']} {$row['_query_string']} {$row['_time']} {$row['ip_address']}
              +
              HTML; foreach( $columns as $r ) { $IPBHTML .= <<{$r} + HTML; } @@ -87,7 +116,6 @@ return $IPBHTML; /** * Show the header for an SQL tool result * - * @access public * @return string HTML */ public function sqlToolResultHeader() { @@ -109,7 +137,6 @@ return $IPBHTML; /** * Splash screen to create an SQL backup * - * @access public * @return string HTML */ public function sqlSafeBackupSplashScreen() { @@ -139,7 +166,6 @@ return $IPBHTML; /** * Show the form to create an SQL backup * - * @access public * @param array Form elements * @return string HTML */ @@ -167,27 +193,27 @@ $IPBHTML .= <<

              {$this->lang->words['my_simple_backup']}

              -
                -
              • - - {$form['create_tbl']} -
              • +
              {$r}
              + + + + -
            • - - -
            • + + + + -
            • - - {$form['skip']} -
            • + + + + -
            • - - {$form['enable_gzip']} -
            • - + + + + +
              {$this->lang->words['my_createtable']}{$form['create_tbl']}
              {$this->lang->words['my_backticks']}
              {$this->lang->words['my_iferror']}
              {$this->lang->words['my_skinnoness']}{$form['skip']}
              {$this->lang->words['my_skinnoness_notes']}
              {$this->lang->words['my_gzipcontent']}{$form['enable_gzip']}
              {$this->lang->words['my_gzipnotes']}
              @@ -201,7 +227,6 @@ return $IPBHTML; /** * View results from executing an SQL query * - * @access public * @param array Queries * @param array Headers for the queries * @param array Rows from the queries @@ -240,7 +265,7 @@ if( $this->form_code )

              {$this->lang->words['my_run']}

              -
              +
              @@ -256,7 +281,7 @@ foreach( $queries as $index => $aQuery )

              {$this->lang->words['my_results']}

              - +
              HTML; @@ -266,11 +291,11 @@ if( count($headers[ $index ]) ) { if ( ! $this->request['notruncate'] AND in_array( $r, $truncated ) ) { - $r = '
              ' . $r . "
              "; + $r = '
              ' . $r . "
              "; } $IPBHTML .= <<{$r} + HTML; } } @@ -280,7 +305,7 @@ $IPBHTML .= <<
              {$pages}

              + HTML; } @@ -327,7 +369,6 @@ return $IPBHTML; /** * Show the database tables (SQL Toolbox homepage) * - * @access public * @param array Tables * @return string HTML */ @@ -351,7 +392,7 @@ $IPBHTML .= <<

              {$this->lang->words['my_tables']}

              -
              {$r}
              +
              @@ -365,7 +406,7 @@ foreach( $rows as $r ) { $IPBHTML .= << - +
                {$this->lang->words['my_table']} form_code}&do=viewschematic&table={$r['table']}'>{$r['table']} HTML; @@ -411,12 +452,12 @@ $IPBHTML .= <<

              {$this->lang->words['my_run']}

              -
                -
              • - - -
              • -
              + + + + + +
              {$this->lang->words['my_manadvanced']}
              @@ -430,7 +471,6 @@ return $IPBHTML; /** * Show the table schematic (SQL Toolbox homepage) * - * @access public * @param array Rows * @return string HTML */ @@ -450,7 +490,7 @@ $IPBHTML .= <<

              {$this->lang->words['view_structure']}: {$table}

              - +
              HTML; @@ -498,7 +538,7 @@ if ( is_array( $indexes ) AND count( $indexes ) )

              {$this->lang->words['view_indexes']}: {$table}

              -
              +
              HTML; @@ -552,12 +592,12 @@ $IPBHTML .= <<

              {$this->lang->words['my_run']}

              -
                -
              • - - -
              • -
              +
              + + + + +
              {$this->lang->words['my_manadvanced']}
              diff --git a/upload/admin/applications/core/skin_cp/cp_skin_system.php b/upload/admin/applications/core/skin_cp/cp_skin_system.php index a8141ded..2a690e72 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_system.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_system.php @@ -2,38 +2,127 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * System tools skin file
              - * Last Updated: $Date: 2010-09-24 21:21:39 -0400 (Fri, 24 Sep 2010) $
              + * Last Updated: $Date: 2011-09-01 08:16:37 -0400 (Thu, 01 Sep 2011) $
                * 
              * - * @author $Author: bfarber $ + * @author $Author: ips_terabyte $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 6915 $ + * @version $Revision: 9439 $ */ -class cp_skin_system extends output +class cp_skin_system { + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } /** - * Prevent our main destructor being called by this class + * User interface content tabs * - * @access public - * @return void + * @param array Tabs + * @param array Content blocks to show + * @param string Default tab + * @return string HTML */ -public function __destruct() +public function ui_content_tabs( $tabs, $contents, $default_tab='' ) { +$HTML = << +
              + « + » +
                +EOF; + +foreach( $tabs as $t ) +{ +$HTML .= << + {$t['text']} + +EOF; + +} + +$HTML .= << +
              + +
              +EOF; + +foreach( $contents as $c ) +{ +$HTML .= << + {$c['content']} +
              +EOF; +} + +$HTML .= << + + + + +EOF; + +return $HTML; + } /** * View task manager logs * - * @access public * @param array Rows * @return string HTML */ @@ -45,12 +134,12 @@ $IPBHTML = ""; $IPBHTML .= <<

              {$this->lang->words['sys_task_manager_logs']}

              - - - - - - +
              {$this->lang->words['sys_task_run']}{$this->lang->words['sys_date_run']}{$this->lang->words['sys_log_info']}
              + + + + + HTML; foreach( $rows as $data ) @@ -76,7 +165,6 @@ return $IPBHTML; /** * Task manager logs overview * - * @access public * @param array Last 5 log rows * @param array Form elements * @return string HTML @@ -89,7 +177,7 @@ $IPBHTML = ""; $IPBHTML .= <<

              {$this->lang->words['sys_last_5_run_tasks']}

              -
              {$this->lang->words['sys_task_run']}{$this->lang->words['sys_date_run']}{$this->lang->words['sys_log_info']}
              +
              @@ -117,16 +205,16 @@ $IPBHTML .= <<form_code}&do=task_log_show' method='post'>

              {$this->lang->words['sys_view_task_manager_logs']}

              -
                -
              • - - {$form['task_title']} -
              • -
              • - - {$form['task_count']} -
              • -
              +
              {$this->lang->words['sys_task_run']} {$this->lang->words['sys_date_run']}
              + + + + + + + + +
              {$this->lang->words['sys_view_logs_for_task']}{$form['task_title']}
              {$this->lang->words['sys_show_n_log_entries']}{$form['task_count']}
              @@ -138,16 +226,16 @@ $IPBHTML .= <<form_code}&do=task_log_delete' method='post'>

              {$this->lang->words['sys_delete_task_manager_logs']}

              -
                -
              • - - {$form['task_title_delete']} -
              • -
              • - - {$form['task_prune']} -
              • -
              + + + + + + + + + +
              {$this->lang->words['sys_delete_logs_for_task']}{$form['task_title_delete']}
              {$this->lang->words['sys_delete_logs_older_than_n_days']}{$form['task_prune']}
              @@ -162,7 +250,6 @@ return $IPBHTML; /** * Task manager last 5 row entry * - * @access public * @param array Log data * @return string HTML */ @@ -186,7 +273,6 @@ return $IPBHTML; /** * Form to add/edit a task * - * @access public * @param array Form elements * @param string Button text * @param string Form action @@ -313,70 +399,71 @@ function formatnumber(num)

              {$title}

              -
                -
              • - - {$form['task_title']} -
              • -
              • - - {$form['task_description']} -
              • -
              • - - {$form['task_application']} -
              • -
              • - - /admin/applications/{task_application}/tasks/{$form['task_file']} -
              • -
              • - -
              • -
              • - - {$form['task_minute']} -
              • -
              • - - {$form['task_hour']} -
              • -
              • - - {$form['task_week_day']} -
              • -
              • - - {$form['task_month_day']} -
              • -
              • - {$this->lang->words['selectimeunitsabove']} -
              • -
              • - - {$form['task_log']} -
              • -
              • - - {$form['task_enabled']} -
              • -
              • - - {$form['task_key']} -
              • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HTML; //startif if ( IN_DEV ) { $IPBHTML .= << - - {$form['task_safemode']} - + + + + HTML; }//endif $IPBHTML .= << +
                {$this->lang->words['sys_task_title']}{$form['task_title']}
                {$this->lang->words['sys_task_short_description']}{$form['task_description']}
                {$this->lang->words['sys_task_application']}{$form['task_application']}
                {$this->lang->words['sys_task_php_file_to_run']}/admin/applications/{task_application}/tasks/{$form['task_file']}
                {$this->lang->words['sys_this_is_the_php_file_that_is_r']}
                {$this->lang->words['sys_time_options']}
                {$this->lang->words['sys_task_time_minutes']}{$form['task_minute']}
                {$this->lang->words['sys_choose_every_minute_to_run_eac']}
                {$this->lang->words['sys_task_time_hours']}{$form['task_hour']}
                {$this->lang->words['sys_choose_every_hour_to_run_each_']}
                {$this->lang->words['sys_task_time_week_day']}{$form['task_week_day']}
                {$this->lang->words['sys_choose_every_day_to_run_each_d']}
                {$this->lang->words['sys_task_time_month_day']}{$form['task_month_day']}
                {$this->lang->words['sys_choose_every_day_to_run_each_d_1']}
                {$this->lang->words['taskthereforrun']}{$this->lang->words['selectimeunitsabove']}
                {$this->lang->words['sys_enable_task_logging']}{$form['task_log']}
                {$this->lang->words['sys_will_write_to_the_task_log_eac']}
                {$this->lang->words['sys_enable_task']}{$form['task_enabled']}
                {$this->lang->words['sys_if_you_are_using_cron_you_migh']}
                {$this->lang->words['sys_task_key']}{$form['task_key']}
                {$this->lang->words['sys_this_is_used_to_call_a_task_wh']}
                {$this->lang->words['sys_task_safe_mode']}{$form['task_safemode']}
                {$this->lang->words['sys_if_set_to_yes_this_will_not_be']}
                @@ -395,7 +482,6 @@ return $IPBHTML; /** * Task manager overview * - * @access public * @param array Tasks * @param string Current date * @return string HTML @@ -409,47 +495,41 @@ $IPBHTML .= <<

                {$this->lang->words['sys_system_schedular']}

              -
              - - + - {$r['admin_username']} @@ -566,7 +675,7 @@ $IPBHTML .= << {$r['_admin_time']} - - + - @@ -581,7 +690,6 @@ return $IPBHTML; /** * ACP latest logins wrapper * - * @access public * @param string Content * @return string HTML */ @@ -593,10 +701,10 @@ $IPBHTML = ""; $IPBHTML .= <<

              {$this->lang->words['sys_last_5_acp_log_in_attempts']}

              - +
              - + @@ -604,9 +712,8 @@ $IPBHTML .= <<
              -
              - {$links} -
              +
              {$links}
              +
              @@ -619,7 +726,6 @@ return $IPBHTML; /** * Latest logins detail * - * @access public * @param array Log data * @return string HTML */ @@ -628,10 +734,12 @@ public function acp_last_logins_detail( $log ) { $IPBHTML = ""; //--starthtml--// +$image = $log['admin_success'] ? 'tick' : 'cross'; + $IPBHTML .= <<

              {$this->lang->words['logindetails']}

              -
               {$this->lang->words['sys_name']}{$this->lang->words['sys_name']} {$this->lang->words['sys_date']} {$this->lang->words['sys_status']} {$this->lang->words['sys_log']}
              +
              @@ -649,7 +757,7 @@ $IPBHTML .= << - + @@ -689,74 +797,9 @@ HTML; return $IPBHTML; } -/** - * System module welcome page - * - * @access public - * @param array Log data - * @param string ACP latest logins - * @return string HTML - * @deprecated Don't think this is used, mycp is used now instead - */ -public function system_welcome_page($data, $acplogins) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

              {$this->lang->words['sys_system_overview']}

              -
              {$this->lang->words['logindetail_basic']}
              {$this->lang->words['logindetail_success']}-
              {$this->lang->words['logindetail_post']}
              - - - - - - -
              - {$this->lang->words['sys_php_version']} - - {$data['phpversion']} ({$data['phpsapi']}) - - {$this->lang->words['sys_sql_version']} - - {$data['sqldriver']} {$data['sqlversion']} -
              - -
              - {$acplogins} -HTML; - -if ( IN_DEV ) -{ -$IPBHTML .= << - -HTML; -} - -//--endhtml--// -return $IPBHTML; -} - /** * Online user record entry * - * @access public * @param string Name * @param string IP address * @param string Login time/date @@ -786,7 +829,6 @@ return $IPBHTML; /** * Translation Session * - * @access public * @param array Languages * @return string HTML */ @@ -795,7 +837,7 @@ public function languages_translateExt( $data, $lang ) $HTML = <<
              -

                {$this->lang->words['ext_top_title']}

              +

                {$this->lang->words['ext_top_title']}

              {$this->lang->words['ext_top_desc']}

              @@ -803,23 +845,23 @@ $HTML = <<{$data['lang_title']}
              form_code}&do=translateImport' method='post'>

              {$this->lang->words['ext_title_for']} {$data['lang_title']}

              - +
              @@ -840,7 +882,7 @@ foreach( $data['files'] as $name => $data ) $HTML .= << - + @@ -851,8 +893,8 @@ HTML; } $HTML .= << -
              - +
              +
              @@ -865,7 +907,6 @@ return $HTML; /** * List installed languages * - * @access public * @param array Languages * @return string HTML */ @@ -878,7 +919,7 @@ if ( $hasTranslate ) $HTML .= << -

                {$this->lang->words['ext_top_title']}

              +

                {$this->lang->words['ext_top_title']}

              {$this->lang->words['ext_translation_detected']}
              @@ -892,7 +933,7 @@ $HTML .= <<

              {$this->lang->words['language_list_page_title']}

              -
                 
              {$name}
              {$mtime}
              +
              @@ -905,14 +946,61 @@ HTML; foreach( $rows as $r ) { -$HTML .= << + $_default = $r['default'] ? "{$this->lang->words[" : ''; + + $HTML .= << - - + + HTML; } @@ -920,19 +1008,62 @@ $HTML .= <<
              +form_code}&do=language_swap' method='post'> +
              +

              {$this->lang->words['sys_lang_choice_swap']}

              +
              {$this->lang->words['language_list_title']} {$this->lang->words['language_list_local']} form_code}&do=list_word_packs&id={$r['id']}'>{$r['title']} {$r['local']} {$r['date']} {$r['money']}{$r['default']}{$r['menu']}{$_default} + +
              + + + + + + + + +
              {$this->lang->words['where_user_lang_choice']} +
              {$this->lang->words['where_touser_lang_choice']} +
              +
              + +
              +
              + +
              form_code}&do=language_do_import' enctype='multipart/form-data' method='post'>

              {$this->lang->words['sys_import_language_xml']}

              -
                -
              • - - -
              • -
              • - - -
              • -
              + + + + + + + + + +
              {$this->lang->words['sys_upload_xml_language_file_from_']}
              {$this->lang->words['sys_duplicate_entries_will_not_be_']}
              {$this->lang->words['sys_or_enter_the_filename_of_the_x']}
              {$this->lang->words['sys_the_file_must_be_uploaded_into']}
              @@ -947,14 +1078,19 @@ $HTML .= <<form_code}&do=language_do_indev_import' method='post'>

              {$this->lang->words['sys_developers_language_cache_impo']}

              -
              HTML; } @@ -980,7 +1117,6 @@ return $HTML; /** * List word packs in a language * - * @access public * @param int Language id * @param array Word packs * @param string Page title @@ -993,21 +1129,24 @@ $HTML = <<{$this->lang->words['sym_manage_languages']}
              -
              + {$this->lang->words['sym_find']}:
              - -{$packs} + +
              +

              {$this->lang->words['lang_sections_title']}

              + {$packs} +
              HTML; return $HTML; @@ -1016,7 +1155,6 @@ return $HTML; /** * Edit a word pack * - * @access public * @param int Word pack id * @param array Language bits * @param string Page links @@ -1031,10 +1169,10 @@ $HTML = <<{$this->lang->words['sym_manage_languages']}
              form_code}' id='mainform' enctype='multipart/form-data'> @@ -1050,7 +1188,7 @@ $HTML = <<

              {$title}

              - +
              @@ -1062,15 +1200,14 @@ $tabIndex = 1; foreach( $lang as $l ) { - $css = ( $l['custom'] ) ? 'tablerow2queued' : 'tablerow2'; - $revert = ( $l['custom'] ) ? "form_code}&do=revert&word_id={$l['id']}&word_pack={$l['pack']}&id={$id}&st={$this->request['st']}' class='dropdown-button'> " : ''; - $edit = IN_DEV ? "form_code}&do=edit_word_entry&&word_id={$l['id']}&word_pack={$l['pack']}&id={$id}' class='dropdown-button'> " : ''; + $revert = ( $l['custom'] ) ? "
            • form_code}&do=revert&word_id={$l['id']}&word_pack={$l['pack']}&id={$id}&st={$this->request['st']}' class='dropdown-button'>
            • " : ''; + $edit = IN_DEV ? "
            • form_code}&do=edit_word_entry&&word_id={$l['id']}&word_pack={$l['pack']}&id={$id}' class='dropdown-button'>
            • " : ''; $pack = $this->request['search'] ? "{$this->lang->words['l_wordpack_prefix']}form_code}&word_pack={$l['pack']}&do=edit_word_pack&id={$id}'>{$l['pack']}" : ''; $HTML .= << + - HTML; @@ -1096,7 +1235,7 @@ HTML; $HTML .= <<
              - +

              @@ -1110,7 +1249,6 @@ return $HTML; /** * Language information form * - * @access public * @param string Action code * @param int Language pack id * @param string Form title @@ -1135,30 +1273,28 @@ $HTML = <<

              {$title}

              -
                -
              • - - -
              • -
              • - - -
              • -
              • - - {$data['lang_isrtl']} -
              • -
              • - - {$data['lang_default']} -
              • -
              +
              {$this->lang->words['language_word_pack_current']} {$this->lang->words['language_word_pack_new']}

              {$l['key']}

              @@ -1082,10 +1219,12 @@ $HTML .= <<
              - {$revert} + +
              + + + + + + + + + + + + + + + +
              {$this->lang->words['language_form_title']}
              {$this->lang->words['language_form_locale']}
              {$this->lang->words['language_is_rtl']}{$data['lang_isrtl']}
              {$this->lang->words['language_form_default']}{$data['lang_default']}
              -
              - -
              +
              -
              +
              HTML; @@ -1168,24 +1304,22 @@ return $HTML; /** * Show the application languages list * - * @access public * @param string Application * @param array Packs * @param array Stats - * @param array Menus * @return string HTML */ -public function languageAppPackList( $app, $packs, $stats, $menus ) +public function languageAppPackList( $app, $packs, $stats ) { $HTML = << - + +
              - - - - + + + + HTML; @@ -1193,14 +1327,27 @@ if( count( $packs ) ) { foreach( $packs as $r ) { + $stats[$r]['custom'] = isset( $stats[$r]['custom'] ) ? $stats[$r]['custom'] : ' '; $HTML .= << - - - - - + + + + + + HTML; } @@ -1209,13 +1356,12 @@ else { $HTML .= << - + HTML; } $HTML .= << - HTML; return $HTML; @@ -1224,7 +1370,6 @@ return $HTML; /** * Add/edit a word in a language pack * - * @access public * @param string Action * @param int Word id * @param int Language pack id @@ -1246,27 +1391,27 @@ $HTML = <<

              {$title}

              -
                -
              • - - -
              • -
              • - - -
              • -
              • - - -
              • -
              • - - -
              • -
              +
              {$this->lang->words['language_pack_name']}{$this->lang->words['language_total_entries']}{$this->lang->words['language_customized_entries']}{$this->lang->words['language_out_of_date_entries']} {$this->lang->words['language_total_entries']}{$this->lang->words['language_customized_entries']}{$this->lang->words['language_out_of_date_entries']} 
              form_code}&word_pack={$app}/{$r}&do=edit_word_pack&id={$this->request['id']}'>{$r}{$stats[$r]['total']}{$stats[$r]['custom']}form_code}&word_pack={$app}/{$r}&do=edit_word_pack&id={$this->request['id']}&filter=1'>{$stats[$r]['outofdate']}{$menus[$r]}
              form_code}&word_pack={$app}/{$r}&do=edit_word_pack&id={$this->request['id']}' class='larger_text'>{$r}{$stats[$r]['total']}{$stats[$r]['custom']}form_code}&word_pack={$app}/{$r}&do=edit_word_pack&id={$this->request['id']}&filter=1'>{$stats[$r]['outofdate']} + +
              {$this->lang->words['nolangpacksgroup']}{$this->lang->words['nolangpacksgroup']}
              + + + + + + + + + + + + + + + + +
              {$this->lang->words['langpackaddapp']}
              {$this->lang->words['language_pack_name']}
              {$this->lang->words['language_key']}
              {$this->lang->words['language_default']}
              - +
              diff --git a/upload/admin/applications/core/skin_cp/cp_skin_templates.php b/upload/admin/applications/core/skin_cp/cp_skin_templates.php index ffed5738..6f462116 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_templates.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_templates.php @@ -2,38 +2,330 @@ /** *
                * Invision Power Services
              - * IP.Board v3.1.4
              + * IP.Board v3.2.3
                * Look and feel skin file
              - * Last Updated: $Date: 2010-11-16 11:26:43 -0500 (Tue, 16 Nov 2010) $
              + * Last Updated: $Date: 2011-10-14 09:43:08 -0400 (Fri, 14 Oct 2011) $
                * 
              * * @author $Author: mmecham $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/community/board/license.html + * @license This is NULLED! * @package IP.Board * @subpackage Core - * @link http://www.invisionpower.com + * @link http://hatynka.in * @since Friday 19th May 2006 17:33 - * @version $Revision: 7195 $ + * @version $Revision: 9617 $ */ -class cp_skin_templates extends output +class cp_skin_templates { + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + /** - * Prevent our main destructor being called by this class + * Externally edit form * - * @access public - * @return void + * @param array Form array + * @return string HTML */ -public function __destruct() +public function externalEditOverview( $form ) { +$IPBHTML = ""; +//--starthtml--// + +$url = str_replace( array( 'http://', 'https://' ), '', $this->settings['_original_base_url'] ); +$parts = explode( '/', $url ); +$host = array_shift( $parts ); +$path = ltrim( implode( '/', $parts ) . '/dav.php', '/' ); + +$IPBHTML .= << +

              {$this->lang->words['sk_ee_main_title']}

              + + +EOF; + +if ( stristr( @php_sapi_name(), 'fcgi' ) OR isset( $_SERVER['FCGI_ROLE'] ) ) +{ + $IPBHTML .= << + {$this->lang->words['sk_ee_webdav_fgci_title']} +

              {$this->lang->words['sk_ee_webdav_fgci_desc']}

              +
              +
              +<IfModule mod_rewrite.c>
              +RewriteEngine on
              +RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
              +</IfModule>
              +		
              + +
              +EOF; +} + +$IPBHTML .= <<form_code}&do=save' method='post' enctype='multipart/form-data'> +
              +

              {$this->lang->words['sk_ee_title']}

              + + + + + +
              + {$this->lang->words['sk_ee_enable']} + {$form['webdav_on']}
              +
              + +
              +
              +
              +
              +

              {$this->lang->words['sk_ee_webdav_title']}

              + + + + + + + + + + + + + + + + + +
              + {$this->lang->words['sk_ee_webdav_host']} + {$host}
              + {$this->lang->words['sk_ee_webdav_path']} + {$path}
              + {$this->lang->words['sk_ee_webdav_username']} + {$this->memberData['name']}
              + {$this->lang->words['sk_ee_webdav_password']} + {$this->lang->words['sk_ee_webdav_ur_password']}
              +
              +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Show form to add/edit skin set + * + * @param array Form bits + * @param string Form title + * @param string Action code + * @param string Button text + * @param array Skin set data + * @return string HTML + */ +public function skinGenerator( $form, $errors ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

              {$this->lang->words['skin_gen_new_vis_skin_title']}

              + + + +
              form_code}&do=skinGenStepOneComplete' method='post'> +
              +

              Basic Settings

              + + + + + + + + + + + + + + + + + + + +
              {$this->lang->words['sk_basics']}
              + {$this->lang->words['sk_settitle']} + + {$form['set_name']} +
              {$this->lang->words['sk_setauthor']}
              + {$this->lang->words['sk_setauthorname']} + + {$form['set_author_name']} +
              *{$this->lang->words['sk_optional']} +
              + {$this->lang->words['sk_setauthorurl']} + + {$form['set_author_url']} +
              *{$this->lang->words['sk_optional']} +
              +
              + +
              +
              +
              +EOF; +//--endhtml--// +return $IPBHTML; +} + +/** + * Skin generator Ready + * + * @param int Skin set + * @return string HTML + */ +public function skinGeneratorReady( $skinSetId ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

              {$this->lang->words['skin_gen_ready_title']}

              + + + +
              +EOF; +//--endhtml--// +return $IPBHTML; +} + +/** + * New skin popup dialogue + * + * @param array $album Album data + * @param array $last10 Last 10 album images + * @return @e string HTML + */ +public function newSkinSetPopUp( $hasActiveLicense ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

              {$this->lang->words['skin_gen_new_title']}

              + + +HTML; + + if ( $hasActiveLicense ) + { + $IPBHTML .= << + +HTML; + } + else + { + $url = "{$this->settings['base_url']}&app=core&module=tools&section=licensekey"; + $lang = sprintf( $this->lang->words['vse_disabled_why'], $url ); + + $IPBHTML .= << + +HTML; + } + +$IPBHTML .= << + + + + +
              + {$this->lang->words['skin_gen_new_visual_title']} +

              {$this->lang->words['skin_gen_new_visual_desc']}

              +

              +

              {$this->lang->words['skin_gen_next_dotdotdot']}

              +
              + {$this->lang->words['skin_gen_new_visual_title']} +
              +

              {$this->lang->words['vse_disabled']}

              +

              $lang

              +
              +
              + {$this->lang->words['skin_gen_manual_title']} +

              {$this->lang->words['skin_gen_manual_desc']}

              +

              +

              {$this->lang->words['skin_gen_next_dotdotdot']}

              +
              + + +HTML; + +//--endhtml--// +return $IPBHTML; } /** * Show the skin differences result * - * @access public * @param string Differences result * @return string HTML */ @@ -43,11 +335,13 @@ $IPBHTML = ""; //--starthtml--// $IPBHTML .= <<{$this->lang->words['sk_temp_diff']} -
              - {$difference} +
              +

              {$this->lang->words['sk_temp_diff']}

              +
              + {$difference} +
              +
              {$this->lang->words['sk_removedhtml']} · {$this->lang->words['sk_addedhtml']}
              -
              {$this->lang->words['sk_removedhtml']} · {$this->lang->words['sk_addedhtml']}
              EOF; //--endhtml--// @@ -57,7 +351,6 @@ return $IPBHTML; /** * Easy logo changer * - * @access public * @param string Warning * @param string Current URL * @param int Current id @@ -73,7 +366,7 @@ array_unshift( $_skin_list, array( 0, $this->lang->words['sm_skinnone'] ) ); $skinList = ipsRegistry::getClass('output')->formDropdown( "skin", $_skin_list ); -$urlField = $this->registry->output->formInput( 'logo_url', ( isset($_POST['logo_url']) AND $_POST['logo_url'] ) ? htmlspecialchars( $_POST['logo_url'], ENT_QUOTES ) : $currentUrl ); +$urlField = $this->registry->output->formInput( 'logo_url', !empty($_POST['logo_url']) ? htmlspecialchars( $_POST['logo_url'], ENT_QUOTES ) : $currentUrl ); $uploadField = $this->registry->output->formUpload(); $IPBHTML .= << -
            • - - {$skinList} -
            • -
            • - - {$urlField} -
            • -
            • - - {$uploadField} -
            • - + + + + + + + + + + + + + +
              + {$this->lang->words['sk_applywhichset']} + {$skinList}
              {$this->lang->words['sk_applywhichset_info']}
              + {$this->lang->words['sk_urlnewlogo']} + {$urlField}
              {$this->lang->words['sk_urlnewlogo_info']}
              + {$this->lang->words['sk_uploadlogo']} + {$uploadField}
              {$this->lang->words['sk_uploadlogo_info']}
              @@ -129,7 +419,6 @@ return $IPBHTML; /** * Search and replace list template groups * - * @access public * @param array Template groups * @param array Skin set data * @param array Session data @@ -150,7 +439,7 @@ $IPBHTML .= <<

              {$this->lang->words['sandr_search_results_for']} {$setData['set_name']}

              -
              +
              EOF; if ( ! $sessionData['sandr_search_only'] ) @@ -168,38 +457,54 @@ $IPBHTML .=<<
              -
              -
              - - - #{groupName} (#{_matches} matches) - -
              -
              + + + + + + + + + +
              + + #{groupName} + + (#{_matches} matches) + + +
              -
              -
              - - - #{template_name} -
              -
              + + + + + +
              + + #{template_name} + + +
              -
              -

              Editing "#{template_name}" in "#{template_group}"

              -
              +
              +

              {$this->lang->words['sk_editing']} "#{template_name}" {$this->lang->words['in']} "#{template_group}"

              +


                - +
              @@ -227,7 +532,6 @@ return $IPBHTML; /** * Form to perform a search and replace * - * @access public * @param string Skin options list * @param int Number of bits * @param int Number to do per refresh @@ -238,6 +542,10 @@ public function searchandreplace_form( $skinOptionList, $numberbits, $pergo ) { $IPBHTML = ""; //--starthtml--// +/* Removed option : +

              {$this->lang->words['sk_searchininfo']}

              +*/ + $IPBHTML .= << {$this->lang->words['sk_searchreplaceinfo']} @@ -247,21 +555,22 @@ $IPBHTML .= <<{$this->lang->words['sk_searchandreplace']}
              form_code}&do=start' enctype='multipart/form-data' method='POST'> - + +
              - - - - + + - - + @@ -282,7 +591,6 @@ return $IPBHTML; /** * Export a skin difference result * - * @access public * @param array Session data * @param array Reports * @param array Missing parts @@ -352,7 +660,7 @@ EOF; $report['change_data_content'] = str_replace( "\n", "
              ", $report['change_data_content']); $report['change_data_content'] = str_replace( "><", ">\n<" ,$report['change_data_content']); $report['change_data_content'] = str_replace( "\t", "    ", $report['change_data_content'] ); - $report['change_data_content'] = preg_replace( "#(?lang->words['mergeexportprefix'] : ''; //removed {$prefix} from the html below since this line above is commented (terabyte) @@ -385,7 +693,6 @@ return $IPBHTML; /** * Overview of completed skin diff reports * - * @access public * @param array Session data * @param array Reports * @param array Missing bits @@ -405,17 +712,17 @@ $IPBHTML .= <<{$this->lang->words['mergereporttitle']} form_code}&do=multiManage&merge_id={$sessionData['merge_id']}' method='post'>
              -
              +

              {$sessionData['_title']}

              -
              {$this->lang->words['sk_selectskinset']} + {$this->lang->words['sk_selectskinset']} + -

              {$this->lang->words['sk_searchininfo']}

              +
              {$this->lang->words['sk_searchfor']}{$this->lang->words['sk_searchfor']}
              {$this->lang->words['sk_replacewith']}

              {$this->lang->words['sk_replacewith_info']}

              + {$this->lang->words['sk_replacewith']}

              {$this->lang->words['sk_replacewith_info']}

              {$this->lang->words['sk_regularexpression']}

              +
              EOF; @@ -520,23 +827,27 @@ EOF; } $IPBHTML .= << - + + - - + + -
              - {$report['change_data_title']} + {$report['change_data_title']}
              {$_desc}
              {$report['_size']} - {$this->lang->words[ - + +