Version 3.3.4

This commit is contained in:
Neo committed 2025-12-19 00:35:52 -08:00
1 parent 78706903a2
commit fb6b5baabc
2206 files changed
+409828 -382984

No files matched your search

@@ -1,121 +1,121 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @link http://hatynka.in
* @since Friday 18th March 2011
* @version $Revision: 8229 $
*/
class sabre_directory_groups extends Sabre_DAV_Directory
{
protected $_skinSet = array();
protected $_group = '';
public function __construct( $group, $skinSet )
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/files/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
$this->_skinSet = $skinSet;
$this->_group = $group;
}
public function getChildren()
{
$output = array();
/* Group data or CSS */
if ( $this->_group != 'css' )
{
$templates = $this->skinFunctions->fetchTemplates( $this->_skinSet['set_id'], 'groupTemplatesNoContent', $this->_group );
/* templates */
foreach( $templates as $title => $data )
{
$output[] = new sabre_file_templates( $this->_skinSet, $data, $title, $this->_group );
}
}
else
{
$css = $this->skinFunctions->fetchCSS( $this->_skinSet['set_id'] );
/* templates */
foreach( $css as $title => $data )
{
$output[] = new sabre_file_templates( $this->_skinSet, $data, $title, 'css' );
}
}
return $output;
}
public function getChild( $title )
{
if ( ! $title || $title == '.' || strtolower( $title == '.ds_store' ) || $title == 'Thumbs.db' || $title == 'desktop.ini' )
{
return false;
}
$title = preg_replace( '#^(.*)\.(css|html)$#', '\1', $title );
/* Group data or CSS */
if ( $this->_group != 'css' )
{
/* Fetch template */
$_templates = $this->skinFunctions->fetchTemplates( $this->_skinSet['set_id'], 'groupTemplates', $this->_group );
$template = $_templates[ strtolower( $title ) ];
if ( $template )
{
return new sabre_file_templates( $this->_skinSet, $template, $title, $this->_group );
}
else
{
return new sabre_file_templates( $this->_skinSet, null, $title, $this->_group );
}
}
else
{
$css = $this->skinFunctions->fetchCSS( $this->_skinSet['set_id'] );
return new sabre_file_templates( $this->_skinSet, $css[ strtolower($title) ], $title, 'css' );
}
}
public function getName()
{
if ( strstr( $this->_group, 'skin_' ) )
{
return preg_replace( '#^skin_(.*)$#', '\1', IPSText::alphanumericalClean( $this->_group ) );
}
else if ( $this->_group == 'css' )
{
return '0.css';
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since Friday 18th March 2011
* @version $Revision: 10914 $
*/
class sabre_directory_groups extends Sabre_DAV_Directory
{
protected $_skinSet = array();
protected $_group = '';
public function __construct( $group, $skinSet )
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/files/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
$this->_skinSet = $skinSet;
$this->_group = $group;
}
public function getChildren()
{
$output = array();
/* Group data or CSS */
if ( $this->_group != 'css' )
{
$templates = $this->skinFunctions->fetchTemplates( $this->_skinSet['set_id'], 'groupTemplatesNoContent', $this->_group );
/* templates */
foreach( $templates as $title => $data )
{
$output[] = new sabre_file_templates( $this->_skinSet, $data, $title, $this->_group );
}
}
else
{
$css = $this->skinFunctions->fetchCSS( $this->_skinSet['set_id'] );
/* templates */
foreach( $css as $title => $data )
{
$output[] = new sabre_file_templates( $this->_skinSet, $data, $title, 'css' );
}
}
return $output;
}
public function getChild( $title )
{
if ( ! $title || $title == '.' || strtolower( $title == '.ds_store' ) || $title == 'Thumbs.db' || $title == 'desktop.ini' )
{
return false;
}
$title = preg_replace( '#^(.*)\.(css|html)$#', '\1', $title );
/* Group data or CSS */
if ( $this->_group != 'css' )
{
/* Fetch template */
$_templates = $this->skinFunctions->fetchTemplates( $this->_skinSet['set_id'], 'groupTemplates', $this->_group );
$template = $_templates[ strtolower( $title ) ];
if ( $template )
{
return new sabre_file_templates( $this->_skinSet, $template, $title, $this->_group );
}
else
{
return new sabre_file_templates( $this->_skinSet, null, $title, $this->_group );
}
}
else
{
$css = $this->skinFunctions->fetchCSS( $this->_skinSet['set_id'] );
return new sabre_file_templates( $this->_skinSet, $css[ strtolower($title) ], $title, 'css' );
}
}
public function getName()
{
if ( strstr( $this->_group, 'skin_' ) )
{
return preg_replace( '#^skin_(.*)$#', '\1', IPSText::alphanumericalClean( $this->_group ) );
}
else if ( $this->_group == 'css' )
{
return '0.css';
}
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -1,79 +1,79 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @link http://hatynka.in
* @since Friday 18th March 2011
* @version $Revision: 8229 $
*/
class sabre_directory_templates extends Sabre_DAV_Directory
{
protected $_skinSet = array();
public function __construct( $skinSet )
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/groups.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/files/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
$this->_skinSet = $skinSet;
}
public function getChildren()
{
$templates = $this->skinFunctions->fetchTemplates( $this->_skinSet['set_id'], 'groupNames');
$output = array();
/* Add in css */
$output[] = new sabre_directory_groups( 'css', $this->_skinSet );
foreach( $templates as $group => $data )
{
$output[] = new sabre_directory_groups( $group, $this->_skinSet );
}
return $output;
}
public function getChild( $title )
{
if ( strstr( $title, '.css' ) )
{
return new sabre_directory_groups( 'css', $this->_skinSet );
}
else
{
return new sabre_directory_groups( 'skin_' . $title, $this->_skinSet );
}
}
public function getName()
{
return $this->_skinSet['set_id'] . '__' . IPSText::alphanumericalClean( $this->_skinSet['set_name'] );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since Friday 18th March 2011
* @version $Revision: 10914 $
*/
class sabre_directory_templates extends Sabre_DAV_Directory
{
protected $_skinSet = array();
public function __construct( $skinSet )
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/groups.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/files/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
$this->_skinSet = $skinSet;
}
public function getChildren()
{
$templates = $this->skinFunctions->fetchTemplates( $this->_skinSet['set_id'], 'groupNames');
$output = array();
/* Add in css */
$output[] = new sabre_directory_groups( 'css', $this->_skinSet );
foreach( $templates as $group => $data )
{
$output[] = new sabre_directory_groups( $group, $this->_skinSet );
}
return $output;
}
public function getChild( $title )
{
if ( strstr( $title, '.css' ) )
{
return new sabre_directory_groups( 'css', $this->_skinSet );
}
else
{
return new sabre_directory_groups( 'skin_' . $title, $this->_skinSet );
}
}
public function getName()
{
return $this->_skinSet['set_id'] . '__' . IPSText::alphanumericalClean( $this->_skinSet['set_name'] );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -1,329 +1,329 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2011-07-25 15:07:16 -0400 (Mon, 25 Jul 2011) $
* </pre>
*
* @author $Author: mmecham $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @link http://hatynka.in
* @since Friday 18th March 2011
* @version $Revision: 9313 $
*/
class sabre_file_templates extends Sabre_DAV_File
{
protected $_skinSet = array();
protected $_template = '';
protected $_title = '';
protected $_group = '';
protected $_content = null;
public function __construct( $skinSet, $template=null, $title=null, $group=null )
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/groups.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
$this->_skinSet = $skinSet;
$this->_group = $group;
if ( $template )
{
$this->_template = $template;
$this->_title = ( $this->_group == 'css' ) ? $template['css_group'] : $template['template_name'];
}
else
{
$this->_title = $title;
}
}
public function getName()
{
return $this->_title . '.' . ( $this->_group == 'css' ? 'css' : 'html' );
}
public function getLastModified()
{
return intval( $this->_group == 'css' ? $this->_template['css_updated'] : $this->_template['template_updated'] );
}
public function getETag()
{
$content = $this->_getTemplateContent();
return ( $content === false ) ? 'new' : md5( $content );
}
public function get()
{
$content = $this->_getTemplateContent();
return ( $content === false ) ? '' : $content;
}
public function getSize()
{
$content = $this->_getTemplateContent();
return ( $content === false ) ? 0 : strlen( $content );
}
public function getContentType()
{
if ( $this->_group != 'css' )
{
return 'text/html';
}
else if ( $this->_group == 'css' )
{
return 'text/css';
}
else
{
return null;
}
}
public function put( $data )
{
$content = stream_get_contents( $data );
if ( ! $this->_title || $this->_title == '.' || strtolower( $this->_title == '.ds_store' ) || $this->_title == 'Thumbs.db' || $this->_title == 'desktop.ini' )
{
return false;
}
/* Do what now? */
return ( $this->_group == 'css' ) ? $this->_putCss( $content ) : $this->_putTemplate( $content );
}
public function delete()
{
try
{
if ( $this->_template )
{
if ( $this->_group != 'css' )
{
$this->skinFunctions->revertTemplateBit( $this->_template['template_id'], $this->_skinSet['set_id'] );
}
else
{
$this->skinFunctions->revertCSS( $this->_template['css_id'], $this->_skinSet['set_id'] );
}
}
}
catch( Exception $err )
{
/* Catch error - it might have come from a tmp save file being renamed */
if ( $this->_group != 'css' )
{
$test = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_set_id=' . $this->_skinSet['set_id'] . ' AND template_group=\'' . $this->DB->addSlashes( $this->_group ) . '\'',
'order' => 'template_id DESC',
'limit' => array( 0, 1 ) ) );
if ( $test['template_added_to'] > 0 && $test['template_updated'] > time() - 240 && $test['template_removable'] && $test['template_added_to'] == $this->_skinSet['set_id'] )
{
return true;
}
}
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
}
public function setName($title)
{
$title = preg_replace( '#^(.*)\.(css|html)$#', '\1', $title );
try
{
if ( $this->_group != 'css' )
{
if ( $this->_template )
{
$this->skinFunctions->renameTemplateName( $this->_template['template_id'], $title );
/* Got a master skin of the same name? Then it's a simple edit */
$test = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_set_id=0 AND template_master_key=\'' . $this->_skinSet['set_master_key'] . '\' AND template_name=\'' . $this->DB->addSlashes( $this->_title ) . '\' AND template_group=\'' . $this->DB->addSlashes( $this->_group ) . '\'' ) );
if ( $test['template_name'] )
{
/* Reset added to */
$this->DB->update( 'skin_templates', array( 'template_added_to' => 0 ), 'template_id=' . $this->_template['template_id'] );
}
}
}
else
{
if ( $this->_template )
{
$this->skinFunctions->renameCssName( $this->_template['css_id'], $title );
}
}
}
catch( Exception $err )
{
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
return true;
}
/**
* Put CSS
* @param string $content
* @throws Sabre_DAV_Exception_Forbidden
* @return boolean
*/
protected function _putCss( $content )
{
/* Clear cache */
$this->_content = null;
/* Save it! */
try
{
if ( ! empty( $this->_template['css_id'] ) && $this->_skinSet['set_id'] )
{
$this->skinFunctions->saveCSSFromEdit( $this->_template['css_id'], $this->_skinSet['set_id'], $content, $this->_title, $this->_template['css_position'], $this->_template['css_attributes'], $this->_template['css_app'], $this->_template['css_app_hide'], $this->_template['css_modules'] );
}
else
{
$this->skinFunctions->saveCSSFromAdd( $this->_skinSet['set_id'], $content, $this->_title, $this->_template['css_position'], $this->_template['css_attributes'], $this->_template['css_app'], $this->_template['css_app_hide'], $this->_template['css_modules'] );
}
}
catch( Exception $err )
{
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
return true;
}
/**
* Put template ...
* @param string $content
* @throws Sabre_DAV_Exception_Forbidden
* @return boolean
*/
protected function _putTemplate( $content )
{
/* Got a data tag? */
$params = '';
$template = '';
if ( stristr( $content, '<ips:template parameters="' ) )
{
preg_match( '#<ips:template parameters="(.+?)" />(\n)?#', $content, $match );
if ( $match[1] )
{
$params = $match[1];
$template = str_replace( $match[0], '', $content );
}
}
else
{
$template = $content;
}
/* Clear cache */
$this->_content = null;
/* Save it! */
try
{
if ( ! empty( $this->_template['template_id'] ) && $this->_skinSet['set_id'] )
{
$this->skinFunctions->saveTemplateBitFromEdit( $this->_template['template_id'], $this->_skinSet['set_id'], $template, $params );
}
else
{
$newId = $this->skinFunctions->saveTemplateBitFromAdd( $this->_skinSet['set_id'], $template, $params, $this->_group, $this->_title );
/* If webdav client adds, then renames… - in delete, if trying to delete master and set specific exists, allow without error but don't delete */
if ( $newId )
{
/* Got a master skin of the same name? Then it's a simple edit */
$test = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_set_id=0 AND template_master_key=\'' . $this->_skinSet['set_master_key'] . '\' AND template_name=\'' . $this->DB->addSlashes( $this->_title ) . '\' AND template_group=\'' . $this->DB->addSlashes( $this->_group ) . '\'' ) );
if ( $test['template_name'] )
{
/* Update new */
$this->DB->update( 'skin_templates', array( 'template_set_id' => $this->_skinSet['set_id'], 'template_master_key' => '' ), 'template_id=' . $newId );
$this->_template['template_set_id'] = $this->_skinSet['set_id'];
$this->_template['template_id'] = $newId;
}
}
}
}
catch( Exception $err )
{
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
return true;
}
protected function _getTemplateContent()
{
if ( ! $this->_template )
{
return false;
}
if ( $this->_content === null )
{
if ( $this->_group != 'css' )
{
$template = $this->skinFunctions->fetchTemplateBitForEdit( $this->_template['template_id'], $this->_skinSet['set_id'] );
$data = $template['template_data'];
if ( ! empty( $data ) )
{
$template['_template_content'] = '<ips:template parameters="' . IPSText::formToText( $data ) . '" />' . "\n" . $template['_template_content'];
}
$this->_content = ( isset( $template['_template_content'] ) ) ? $template['_template_content'] : false;
}
else
{
$template = $this->skinFunctions->fetchCSSForEdit( $this->_template['css_id'], $this->_skinSet['set_id'] );
$this->_content = ( isset( $template['css_content'] ) ) ? $template['css_content'] : false;
}
}
return $this->_content;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since Friday 18th March 2011
* @version $Revision: 10914 $
*/
class sabre_file_templates extends Sabre_DAV_File
{
protected $_skinSet = array();
protected $_template = '';
protected $_title = '';
protected $_group = '';
protected $_content = null;
public function __construct( $skinSet, $template=null, $title=null, $group=null )
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/groups.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
$this->_skinSet = $skinSet;
$this->_group = $group;
if ( $template )
{
$this->_template = $template;
$this->_title = ( $this->_group == 'css' ) ? $template['css_group'] : $template['template_name'];
}
else
{
$this->_title = $title;
}
}
public function getName()
{
return $this->_title . '.' . ( $this->_group == 'css' ? 'css' : 'html' );
}
public function getLastModified()
{
return intval( $this->_group == 'css' ? $this->_template['css_updated'] : $this->_template['template_updated'] );
}
public function getETag()
{
$content = $this->_getTemplateContent();
return ( $content === false ) ? 'new' : md5( $content );
}
public function get()
{
$content = $this->_getTemplateContent();
return ( $content === false ) ? '' : $content;
}
public function getSize()
{
$content = $this->_getTemplateContent();
return ( $content === false ) ? 0 : strlen( $content );
}
public function getContentType()
{
if ( $this->_group != 'css' )
{
return 'text/html';
}
else if ( $this->_group == 'css' )
{
return 'text/css';
}
else
{
return null;
}
}
public function put( $data )
{
$content = stream_get_contents( $data );
if ( ! $this->_title || $this->_title == '.' || strtolower( $this->_title == '.ds_store' ) || $this->_title == 'Thumbs.db' || $this->_title == 'desktop.ini' )
{
return false;
}
/* Do what now? */
return ( $this->_group == 'css' ) ? $this->_putCss( $content ) : $this->_putTemplate( $content );
}
public function delete()
{
try
{
if ( $this->_template )
{
if ( $this->_group != 'css' )
{
$this->skinFunctions->revertTemplateBit( $this->_template['template_id'], $this->_skinSet['set_id'] );
}
else
{
$this->skinFunctions->revertCSS( $this->_template['css_id'], $this->_skinSet['set_id'] );
}
}
}
catch( Exception $err )
{
/* Catch error - it might have come from a tmp save file being renamed */
if ( $this->_group != 'css' )
{
$test = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_set_id=' . $this->_skinSet['set_id'] . ' AND template_group=\'' . $this->DB->addSlashes( $this->_group ) . '\'',
'order' => 'template_id DESC',
'limit' => array( 0, 1 ) ) );
if ( $test['template_added_to'] > 0 && $test['template_updated'] > time() - 240 && $test['template_removable'] && $test['template_added_to'] == $this->_skinSet['set_id'] )
{
return true;
}
}
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
}
public function setName($title)
{
$title = preg_replace( '#^(.*)\.(css|html)$#', '\1', $title );
try
{
if ( $this->_group != 'css' )
{
if ( $this->_template )
{
$this->skinFunctions->renameTemplateName( $this->_template['template_id'], $title );
/* Got a master skin of the same name? Then it's a simple edit */
$test = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_set_id=0 AND template_master_key=\'' . $this->_skinSet['set_master_key'] . '\' AND template_name=\'' . $this->DB->addSlashes( $this->_title ) . '\' AND template_group=\'' . $this->DB->addSlashes( $this->_group ) . '\'' ) );
if ( $test['template_name'] )
{
/* Reset added to */
$this->DB->update( 'skin_templates', array( 'template_added_to' => 0 ), 'template_id=' . $this->_template['template_id'] );
}
}
}
else
{
if ( $this->_template )
{
$this->skinFunctions->renameCssName( $this->_template['css_id'], $title );
}
}
}
catch( Exception $err )
{
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
return true;
}
/**
* Put CSS
* @param string $content
* @throws Sabre_DAV_Exception_Forbidden
* @return boolean
*/
protected function _putCss( $content )
{
/* Clear cache */
$this->_content = null;
/* Save it! */
try
{
if ( ! empty( $this->_template['css_id'] ) && $this->_skinSet['set_id'] )
{
$this->skinFunctions->saveCSSFromEdit( $this->_template['css_id'], $this->_skinSet['set_id'], $content, $this->_title, $this->_template['css_position'], $this->_template['css_attributes'], $this->_template['css_app'], $this->_template['css_app_hide'], $this->_template['css_modules'] );
}
else
{
$this->skinFunctions->saveCSSFromAdd( $this->_skinSet['set_id'], $content, $this->_title, $this->_template['css_position'], $this->_template['css_attributes'], $this->_template['css_app'], $this->_template['css_app_hide'], $this->_template['css_modules'] );
}
}
catch( Exception $err )
{
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
return true;
}
/**
* Put template ...
* @param string $content
* @throws Sabre_DAV_Exception_Forbidden
* @return boolean
*/
protected function _putTemplate( $content )
{
/* Got a data tag? */
$params = '';
$template = '';
if ( stristr( $content, '<ips:template parameters="' ) )
{
preg_match( '#<ips:template parameters="(.+?)" />(\n)?#', $content, $match );
if ( $match[1] )
{
$params = $match[1];
$template = str_replace( $match[0], '', $content );
}
}
else
{
$template = $content;
}
/* Clear cache */
$this->_content = null;
/* Save it! */
try
{
if ( ! empty( $this->_template['template_id'] ) && $this->_skinSet['set_id'] )
{
$this->skinFunctions->saveTemplateBitFromEdit( $this->_template['template_id'], $this->_skinSet['set_id'], $template, $params );
}
else
{
$newId = $this->skinFunctions->saveTemplateBitFromAdd( $this->_skinSet['set_id'], $template, $params, $this->_group, $this->_title );
/* If webdav client adds, then renames... - in delete, if trying to delete master and set specific exists, allow without error but don't delete */
if ( $newId )
{
/* Got a master skin of the same name? Then it's a simple edit */
$test = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'skin_templates',
'where' => 'template_set_id=0 AND template_master_key=\'' . $this->_skinSet['set_master_key'] . '\' AND template_name=\'' . $this->DB->addSlashes( $this->_title ) . '\' AND template_group=\'' . $this->DB->addSlashes( $this->_group ) . '\'' ) );
if ( $test['template_name'] )
{
/* Update new */
$this->DB->update( 'skin_templates', array( 'template_set_id' => $this->_skinSet['set_id'], 'template_master_key' => '' ), 'template_id=' . $newId );
$this->_template['template_set_id'] = $this->_skinSet['set_id'];
$this->_template['template_id'] = $newId;
}
}
}
}
catch( Exception $err )
{
throw new Sabre_DAV_Exception_Forbidden( $err->getMessage() );
}
return true;
}
protected function _getTemplateContent()
{
if ( ! $this->_template )
{
return false;
}
if ( $this->_content === null )
{
if ( $this->_group != 'css' )
{
$template = $this->skinFunctions->fetchTemplateBitForEdit( $this->_template['template_id'], $this->_skinSet['set_id'] );
$data = $template['template_data'];
if ( ! empty( $data ) )
{
$template['_template_content'] = '<ips:template parameters="' . IPSText::formToText( $data ) . '" />' . "\n" . $template['_template_content'];
}
$this->_content = ( isset( $template['_template_content'] ) ) ? $template['_template_content'] : false;
}
else
{
$template = $this->skinFunctions->fetchCSSForEdit( $this->_template['css_id'], $this->_skinSet['set_id'] );
$this->_content = ( isset( $template['css_content'] ) ) ? $template['css_content'] : false;
}
}
return $this->_content;
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -1,35 +1,35 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @link http://hatynka.in
* @since Friday 18th March 2011
* @version $Revision: 8229 $
*/
class sabre_lock_nolocks extends Sabre_DAV_Locks_Backend_Abstract
{
public function getLocks( $uri )
{
return array();
}
public function lock( $uri, Sabre_DAV_Locks_LockInfo $lockInfo )
{
return true;
}
public function unlock( $uri, Sabre_DAV_Locks_LockInfo $lockInfo )
{
return true;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since Friday 18th March 2011
* @version $Revision: 10914 $
*/
class sabre_lock_nolocks extends Sabre_DAV_Locks_Backend_Abstract
{
public function getLocks( $uri )
{
return array();
}
public function lock( $uri, Sabre_DAV_Locks_LockInfo $lockInfo )
{
return true;
}
public function unlock( $uri, Sabre_DAV_Locks_LockInfo $lockInfo )
{
return true;
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -1,78 +1,78 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @link http://hatynka.in
* @since Friday 18th March 2011
* @version $Revision: 8229 $
*/
class sabre_root_skins extends Sabre_DAV_Directory
{
public function __construct()
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/files/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
}
public function getChildren()
{
/* Show all skins */
$this->DB->build( array( 'select' => '*',
'from' => 'skin_collections',
'order' => 'set_id ASC' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$output[] = new sabre_directory_templates( $row );
}
return $output;
}
public function getChild( $directoryName )
{
/* Fetch ID */
$skinId = preg_replace( '#^([0-9]+?)__.*$#', '\1', $directoryName );
if ( is_numeric( $skinId ) )
{
$skinSet = $this->skinFunctions->fetchSkinData( intval( $skinId ) );
return new sabre_directory_templates( $skinSet );
}
}
public function getName()
{
return 'PublicTemplates';
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Sabre classes by Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @link http://www.invisionpower.com
* @since Friday 18th March 2011
* @version $Revision: 10914 $
*/
class sabre_root_skins extends Sabre_DAV_Directory
{
public function __construct()
{
$this->registry = ipsRegistry::instance();
$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();
/* Require some files for our sabre implementation */
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/root/skins.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/directory/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/files/templates.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/sabre/lock/nolocks.php' );/*noLibHook*/
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( $this->registry );
}
public function getChildren()
{
/* Show all skins */
$this->DB->build( array( 'select' => '*',
'from' => 'skin_collections',
'order' => 'set_id ASC' ) );
$o = $this->DB->execute();
while( $row = $this->DB->fetch( $o ) )
{
$output[] = new sabre_directory_templates( $row );
}
return $output;
}
public function getChild( $directoryName )
{
/* Fetch ID */
$skinId = preg_replace( '#^([0-9]+?)__.*$#', '\1', $directoryName );
if ( is_numeric( $skinId ) )
{
$skinSet = $this->skinFunctions->fetchSkinData( intval( $skinId ) );
return new sabre_directory_templates( $skinSet );
}
}
public function getName()
{
return 'PublicTemplates';
}
}