Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 13 files changed
  • 0 comments
  • 2 contributors
0  files/index.html b/web/files/index.html
No changes.
22  web/concrete/blocks/dashboard_site_activity/controller.php
@@ -24,17 +24,19 @@ public function view() {
24 24
 				$timeStr = '%x ' . t('at') . ' %I:%M %p';
25 25
 			} else {
26 26
 				$timeStr = '%x ' . t('at') . ' %l:%M %p';
27  
-			}		
28  
-			$this->set('uLastLogin', strftime($timeStr, $ui->getLastLogin('user')));
29  
-			$this->set('uName', $ui->getUserName());
30  
-			$this->set('lastEditSite', strftime($timeStr, strtotime(PageStatistics::getSiteLastEdit('user'))));
31  
-			$llu = UserStatistics::getLastLoggedInUser();
32  
-			if ($llu->getUserID() == $u->getUserID()) {
33  
-				$this->set('lastLoginSite', t('Your login is the most recent.'));		
34  
-			} else { 
35  
-				$this->set('lastLoginSite', strftime($timeStr, $llu->getLastLogin()));
36 27
 			}
37  
-			Loader::block('form');
  28
+			if (is_object($ui)) { 
  29
+				$this->set('uLastLogin', strftime($timeStr, $ui->getLastLogin('user')));
  30
+				$this->set('uName', $ui->getUserName());
  31
+				$this->set('lastEditSite', strftime($timeStr, strtotime(PageStatistics::getSiteLastEdit('user'))));
  32
+				$llu = UserStatistics::getLastLoggedInUser();
  33
+				if ($llu->getUserID() == $u->getUserID()) {
  34
+					$this->set('lastLoginSite', t('Your login is the most recent.'));		
  35
+				} else { 
  36
+					$this->set('lastLoginSite', strftime($timeStr, $llu->getLastLogin()));
  37
+				}
  38
+				Loader::block('form');
  39
+			}				
38 40
 			$this->set('totalFormSubmissions', FormBlockStatistics::getTotalSubmissions());
39 41
 			$this->set('totalFormSubmissionsToday', FormBlockStatistics::getTotalSubmissions(date('Y-m-d')));
40 42
 		}
4  web/concrete/config/base.php
@@ -107,6 +107,10 @@
107 107
 
108 108
 define("LANGUAGE_DOMAIN_CORE", "messages");
109 109
 
  110
+if (!defined('FILE_PERMISSIONS_MODE')) {
  111
+	define('FILE_PERMISSIONS_MODE', 0775);
  112
+}
  113
+
110 114
 # Path to the core files shared between all concrete 5 installations
111 115
 if (!defined('DIR_BASE_CORE')) {
112 116
 	define('DIR_BASE_CORE', dirname(__FILE__) . '/..');
2  web/concrete/config/version.php
... ...
@@ -1,3 +1,3 @@
1 1
 <?
2 2
 defined('C5_EXECUTE') or die("Access Denied.");
3  
-$APP_VERSION = '5.5.2a1';
  3
+$APP_VERSION = '5.5.1.1';
32  web/concrete/controllers/install.php
@@ -124,7 +124,7 @@ private function setOptionalItems() {
124 124
 			$this->set('diffTest', false);
125 125
 		}
126 126
 		
127  
-		if (version_compare(PHP_VERSION, '5.2.0', '>')) {
  127
+		if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
128 128
 			$phpVtest = true;
129 129
 		} else {
130 130
 			$phpVtest = false;
@@ -187,6 +187,7 @@ public function run_routine($pkgHandle, $routine) {
187 187
 		} catch(Exception $e) {
188 188
 			$js->error = true;
189 189
 			$js->message = $e->getMessage();
  190
+			$this->reset();
190 191
 		}
191 192
 		print $jsx->encode($js);
192 193
 		exit;
@@ -230,6 +231,23 @@ protected function validateDatabase($e) {
230 231
 		return $e;
231 232
 	}
232 233
 	
  234
+	public function reset() {
  235
+		// remove site.php so that we can try again ?
  236
+		if (is_resource($this->fp)) {
  237
+			fclose($this->fp);
  238
+		}
  239
+		if (file_exists(DIR_CONFIG_SITE . '/site_install.php')) {
  240
+			unlink(DIR_CONFIG_SITE . '/site_install.php');
  241
+		}
  242
+		if (file_exists(DIR_CONFIG_SITE . '/site_install_user.php')) {
  243
+			unlink(DIR_CONFIG_SITE . '/site_install_user.php');
  244
+		}
  245
+
  246
+		if (file_exists(DIR_CONFIG_SITE . '/site.php')) {
  247
+			unlink(DIR_CONFIG_SITE . '/site.php');
  248
+		}
  249
+	}
  250
+	
233 251
 	public function configure() {	
234 252
 		try {
235 253
 
@@ -302,7 +320,9 @@ public function configure() {
302 320
 					$res = fwrite($this->fpu, $configuration);
303 321
 					fclose($this->fpu);
304 322
 					chmod(DIR_CONFIG_SITE . '/site_install_user.php', 0700);
305  
-					$this->redirect('/');
  323
+					if (PHP_SAPI != 'cli') {
  324
+						$this->redirect('/');
  325
+					}
306 326
 				} else {
307 327
 					throw new Exception(t('Unable to open config/site_user.php for writing.'));
308 328
 				}
@@ -317,13 +337,7 @@ public function configure() {
317 337
 			}
318 338
 			
319 339
 		} catch (Exception $e) {
320  
-			// remove site.php so that we can try again ?
321  
-			if (is_resource($this->fp)) {
322  
-				fclose($this->fp);
323  
-			}
324  
-			if (file_exists(DIR_CONFIG_SITE . '/site.php')) {
325  
-				unlink(DIR_CONFIG_SITE . '/site.php');
326  
-			}
  340
+			$this->reset();
327 341
 			$this->set('error', $e);
328 342
 		}
329 343
 	}
2  web/concrete/elements/collection_metadata_fields.php
@@ -24,12 +24,10 @@
24 24
 	<h6><?=t("All Attributes")?></h6>
25 25
 	<div class="ccm-block-type-search-wrapper ">
26 26
 
27  
-		<form onsubmit="return ccmPageAttributeSearchFormCheckResults()">
28 27
 		<div class="ccm-block-type-search">
29 28
 		<?=$form->text('ccmSearchAttributeListField', array('tabindex' => 1, 'autocomplete' => 'off', 'style' => 'width: 155px'))?>
30 29
 		</div>
31 30
 		
32  
-		</form>
33 31
 	</div>
34 32
 	
35 33
 	<?
14  web/concrete/helpers/concrete/file.php
@@ -92,16 +92,24 @@ public function mapSystemPath($prefix, $filename, $createDirectories = false, $b
92 92
 				$d3 = substr($prefix, 8);
93 93
 				
94 94
 				if ($createDirectories) { 
  95
+					if (!is_dir($base)) { 
  96
+						@mkdir($base, FILE_PERMISSIONS_MODE, TRUE); 
  97
+						@chmod($base, FILE_PERMISSIONS_MODE); 
  98
+						@touch($base . '/' . $d1 . '/index.html');
  99
+					} 
95 100
 					if (!is_dir($base . '/' . $d1)) { 
96  
-						@mkdir($base . '/' . $d1, 0777, TRUE); 
  101
+						@mkdir($base . '/' . $d1, FILE_PERMISSIONS_MODE, TRUE); 
  102
+						@chmod($base . '/' . $d1, FILE_PERMISSIONS_MODE); 
97 103
 						@touch($base . '/' . $d1 . '/index.html');
98 104
 					} 
99 105
 					if (!is_dir($base . '/' . $d1 . '/' . $d2)) { 
100  
-						@mkdir($base . '/' . $d1 . '/' . $d2, 0777, TRUE); 
  106
+						@mkdir($base . '/' . $d1 . '/' . $d2, FILE_PERMISSIONS_MODE, TRUE); 
  107
+						@chmod($base . '/' . $d1 . '/' . $d2, FILE_PERMISSIONS_MODE); 
101 108
 						@touch($base . '/' . $d1 . '/' . $d2 . '/index.html');
102 109
 					} 
103 110
 					if (!is_dir($base . '/' . $d1 . '/' . $d2 . '/' . $d3)) { 
104  
-						@mkdir($base . '/' . $d1 . '/' . $d2 . '/' . $d3, 0777, TRUE); 
  111
+						@mkdir($base . '/' . $d1 . '/' . $d2 . '/' . $d3, FILE_PERMISSIONS_MODE, TRUE); 
  112
+						@chmod($base . '/' . $d1 . '/' . $d2 . '/' . $d3, FILE_PERMISSIONS_MODE); 
105 113
 						@touch($base . '/' . $d1 . '/' . $d2 . '/' . $d3 . '/index.html');
106 114
 					} 
107 115
 				}
5  web/concrete/helpers/file.php
@@ -63,7 +63,7 @@ public function unfilename($filename) {
63 63
 	 * @param string $target Place to copy the source
64 64
 	 * @param int $mode What to chmod the file to
65 65
 	 */
66  
-	public function copyAll($source, $target, $mode = 0777) {
  66
+	public function copyAll($source, $target, $mode = FILE_PERMISSIONS_MODE) {
67 67
 		if (is_dir($source)) {
68 68
 			@mkdir($target, $mode);
69 69
 			@chmod($target, $mode);
@@ -139,7 +139,8 @@ public function forceDownload($file) {
139 139
 	 */
140 140
 	public function getTemporaryDirectory() {
141 141
 		if (!is_dir(DIR_TMP)) {
142  
-			mkdir(DIR_TMP, 0777);
  142
+			mkdir(DIR_TMP, FILE_PERMISSIONS_MODE);
  143
+			chmod(DIR_TMP, FILE_PERMISSIONS_MODE);
143 144
 			touch(DIR_TMP . '/index.html');
144 145
 		}
145 146
 		return DIR_TMP;
2  web/concrete/helpers/image.php
@@ -178,6 +178,8 @@ public function create($originalPath, $newPath, $width, $height, $crop = false)
178 178
 				}
179 179
 			}
180 180
 		}
  181
+		
  182
+		@chmod($newPath, FILE_PERMISSIONS_MODE);
181 183
 	}
182 184
 	
183 185
 	/** 
4  web/concrete/libraries/file/importer.php
@@ -91,7 +91,9 @@ private function storeFile($prefix, $pointer, $filename, $fr = false) {
91 91
 		if ($path == false) {
92 92
 			$path = $fi->mapSystemPath($prefix, $filename, true);
93 93
 		}
94  
-		return @copy($pointer, $path);
  94
+		$r = @copy($pointer, $path);
  95
+		@chmod($path, FILE_PERMISSIONS_MODE);
  96
+		return $r;
95 97
 	}
96 98
 	
97 99
 	/** 
16  web/concrete/models/package/starting_point.php
@@ -155,22 +155,28 @@ public function make_directories() {
155 155
 		Cache::flush();
156 156
 		
157 157
 		if (!is_dir(DIR_FILES_UPLOADED_THUMBNAILS)) {
158  
-			mkdir(DIR_FILES_UPLOADED_THUMBNAILS);
  158
+			mkdir(DIR_FILES_UPLOADED_THUMBNAILS, FILE_PERMISSIONS_MODE);
  159
+			chmod(DIR_FILES_UPLOADED_THUMBNAILS, FILE_PERMISSIONS_MODE);
159 160
 		}
160 161
 		if (!is_dir(DIR_FILES_INCOMING)) {
161 162
 			mkdir(DIR_FILES_INCOMING);
  163
+			chmod(DIR_FILES_INCOMING, FILE_PERMISSIONS_MODE);
162 164
 		}
163 165
 		if (!is_dir(DIR_FILES_TRASH)) {
164  
-			mkdir(DIR_FILES_TRASH);
  166
+			mkdir(DIR_FILES_TRASH, FILE_PERMISSIONS_MODE);
  167
+			chmod(DIR_FILES_TRASH, FILE_PERMISSIONS_MODE);
165 168
 		}
166 169
 		if (!is_dir(DIR_FILES_CACHE)) {
167  
-			mkdir(DIR_FILES_CACHE);
  170
+			mkdir(DIR_FILES_CACHE, FILE_PERMISSIONS_MODE);
  171
+			chmod(DIR_FILES_CACHE, FILE_PERMISSIONS_MODE);
168 172
 		}
169 173
 		if (!is_dir(DIR_FILES_CACHE_DB)) {
170  
-			mkdir(DIR_FILES_CACHE_DB);
  174
+			mkdir(DIR_FILES_CACHE_DB, FILE_PERMISSIONS_MODE);
  175
+			chmod(DIR_FILES_CACHE_DB, FILE_PERMISSIONS_MODE);
171 176
 		}
172 177
 		if (!is_dir(DIR_FILES_AVATARS)) {
173  
-			mkdir(DIR_FILES_AVATARS);
  178
+			mkdir(DIR_FILES_AVATARS, FILE_PERMISSIONS_MODE);
  179
+			chmod(DIR_FILES_AVATARS, FILE_PERMISSIONS_MODE);
174 180
 		}
175 181
 	}
176 182
 	
4  web/concrete/models/user.php
@@ -71,9 +71,9 @@ protected static function regenerateSession() {
71 71
 			unset($_SESSION['dashboardMenus']);
72 72
 			$tmpSession = $_SESSION; 
73 73
 			session_write_close(); 
74  
-			setcookie(session_name(), session_id(), time()-100000);
  74
+			@setcookie(session_name(), session_id(), time()-100000);
75 75
 			session_id(sha1(mt_rand())); 
76  
-			session_start(); 
  76
+			@session_start(); 
77 77
 			$_SESSION = $tmpSession; 
78 78
 		}
79 79
 		
10  web/concrete/startup/url_check.php
@@ -5,9 +5,12 @@
5 5
 if (REDIRECT_TO_BASE_URL == true) {
6 6
 	$protocol = 'http://';
7 7
 	$base_url = BASE_URL;
8  
-	if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']) && ($base_url_ssl = Config::get('BASE_URL_SSL'))) {
  8
+	if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) {
9 9
 		$protocol = 'https://';
10  
-		$base_url = $base_url_ssl;
  10
+		$base_url_ssl = Config::get('BASE_URL_SSL');
  11
+		if ($base_url_ssl) {
  12
+			$base_url = $base_url_ssl;
  13
+		}
11 14
 	}
12 15
 
13 16
 	$uri = $_SERVER['REQUEST_URI'];
@@ -21,5 +24,4 @@
21 24
 		exit;
22 25
 	}
23 26
 
24  
-}
25  
-
  27
+}

No commit comments for this range

Something went wrong with that request. Please try again.