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