Baseline
[www.vanrenterghem.biz.git] / phpBB2_old / admin / xs_chmod.php
1 <?php
3 /***************************************************************************
4  *                                xs_chmod.php
5  *                                ------------
6  *   copyright            : (C) 2003, 2004 CyberAlien
7  *   support              : http://www.phpbbstyles.com
8  *
9  *   version              : 2.0.1
10  *
11  *   file revision        : 46
12  *   project revision     : 51
13  *   last modified        : 25 Aug 2004  11:51:47
14  *
15  ***************************************************************************/
17 /***************************************************************************
18  *
19  *   This program is free software; you can redistribute it and/or modify
20  *   it under the terms of the GNU General Public License as published by
21  *   the Free Software Foundation; either version 2 of the License, or
22  *   (at your option) any later version.
23  *
24  ***************************************************************************/
26 define('IN_PHPBB', 1);
27 $phpbb_root_path = "./../";
28 $no_page_header = true;
29 require($phpbb_root_path . 'extension.inc');
30 require('./pagestart.' . $phpEx);
32 // check if mod is installed
33 if(empty($template->xs_version) || $template->xs_version !== 5)
34 {
35         message_die(GENERAL_ERROR, 'eXtreme Styles mod is not installed. You forgot to upload includes/template.php');
36 }
38 define('IN_XS', true);
39 include_once('xs_include.' . $phpEx);
41 $template->assign_block_vars('nav_left',array('ITEM' => '&raquo; <a href="' . append_sid('xs_config.'.$phpEx) . '">' . $lang['xs_configuration'] . '</a>'));
42 $template->assign_block_vars('nav_left',array('ITEM' => '&raquo; <a href="' . append_sid('xs_chmod.'.$phpEx) . '">' . $lang['xs_chmod'] . '</a>'));
44 $lang['xs_chmod_return'] = str_replace('{URL}', append_sid('xs_config.'.$phpEx), $lang['xs_chmod_return']);
45 $lang['xs_chmod_message1'] .= $lang['xs_chmod_return'];
46 $lang['xs_chmod_error1'] .= $lang['xs_chmod_return'];
48 if(defined('DEMO_MODE'))
49 {
50         xs_error($lang['xs_permission_denied']);
51 }
53 if(!get_ftp_config(append_sid('xs_chmod.'.$phpEx), array(), false))
54 {
55         exit;
56 }
57 xs_ftp_connect(append_sid('xs_chmod.'.$phpEx), array(), true);
59 if($ftp === XS_FTP_LOCAL)
60 {
61         @mkdir('../cache', 0777);
62         @chmod('../cache', 0777);
63         if(xs_dir_writable('../cache'))
64         {
65                 xs_message($lang['Information'], $lang['xs_chmod_message1']);
66         }
67         xs_error($lang['xs_chmod_error1']);
68 }
70 $str = ftp_pwd($ftp);
72 if(strlen($str) && substr($str, strlen($str) - 1) !== '/')
73 {
74         $str .= '/';
75 }
76 $res = @ftp_site($ftp, "CHMOD 0777 {$str}cache");
77 if(!$res)
78 {
79         @ftp_mkdir($ftp, 'cache');
80         $res = @ftp_site($ftp, "CHMOD 0777 {$str}cache");
81 }
82 @ftp_quit($ftp);
83 if($res)
84 {
85         xs_message($lang['Information'], $lang['xs_chmod_message1']);
86 }
87 else
88 {
89         xs_error($lang['xs_chmod_error1']);
90 }
92 ?>