Index: trunk/admin/category/addimage.php =================================================================== diff -u -N -r2853 -r4645 --- trunk/admin/category/addimage.php (.../addimage.php) (revision 2853) +++ trunk/admin/category/addimage.php (.../addimage.php) (revision 4645) @@ -21,7 +21,7 @@ // new startup: end /* set the destination of the image upload, relative to the root path */ -$DestDir = "kernel/images/"; +$DestDir = 'kernel/images/'; require_once ($pathtoroot.$admin."/include/elements.php"); require_once ($pathtoroot."kernel/admin/include/navmenu.php"); Index: trunk/kernel/include/image.php =================================================================== diff -u -N -r4077 -r4645 --- trunk/kernel/include/image.php (.../image.php) (revision 4077) +++ trunk/kernel/include/image.php (.../image.php) (revision 4645) @@ -272,7 +272,7 @@ $Dest_Dir = $DestDir; if($this->Pending) $Dest_Dir .= "pending/"; - + if(((int)$file["error"]==0) && (substr($file["type"],0,6)=="image/") && @getimagesize($file["tmp_name"]) ) { $parts = pathinfo($file["name"]); @@ -301,7 +301,7 @@ $result = copy($file["tmp_name"],$destination); if($result) { - @chmod($Dest_Dir.$filename, 0666); + @chmod($destination, 0666); return $Dest_Dir.$filename; } else Index: trunk/core/kernel/application.php =================================================================== diff -u -N -r4636 -r4645 --- trunk/core/kernel/application.php (.../application.php) (revision 4636) +++ trunk/core/kernel/application.php (.../application.php) (revision 4645) @@ -194,6 +194,7 @@ $this->ConfigHash = $this->Conn->GetCol('SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'ConfigurationValues', 'VariableName'); $rewrite_on = $this->ConfigValue('UseModRewrite'); + // admin=1 - when front is browsed using admin session $admin_on = getArrayValue($_REQUEST, 'admin') || $this->IsAdmin(); define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0); @@ -952,13 +953,18 @@ unset($params['no_amp']); } - if ($this->RewriteURLs($ssl)) + $no_rewrite = false; + if( isset($params['__NO_REWRITE__']) ) { + $no_rewrite = true; + unset($params['__NO_REWRITE__']); + } + if ($this->RewriteURLs($ssl) && !$no_rewrite) + { $session =& $this->recallObject('Session'); if( $session->NeedQueryString() ) $params['sid'] = $this->GetSID(); $url = $this->BuildEnv_NEW($t, $params, $pass, $pass_events); $ret = $this->BaseURL($prefix, $ssl).$url.$map_link; - } else { Index: trunk/core/kernel/utility/http_query.php =================================================================== diff -u -N -r4637 -r4645 --- trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 4637) +++ trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 4645) @@ -158,7 +158,7 @@ } } - if ($this->Application->RewriteURLs()) { + if ($this->Application->RewriteURLs() || $this->Get('_mod_rw_url_')) { if( $this->Application->isDebugMode() ) { $this->Application->Debugger->profileStart('url_parsing'); @@ -535,6 +535,13 @@ } }while (!$template_found && $template_parts); + + if (!$template_found && $this->Application->GetVar('admin')) { + // used when admin is clicking on non-existing in-cms page + $template_found = true; + $template_path = implode('/', $url_parts); + } + } } @@ -789,8 +796,15 @@ $admin_mark = $this->Application->IsAdmin() ? 'ADMIN' : 'FRONT'; $data = '['.date('D M d H:i:s Y').'] '.$admin_mark.'; ip: '.$_SERVER['REMOTE_ADDR'].'; user_id: '.$user_id.'; sid: '.$this->Application->GetSID().'; request: '."\n"; - $data .= "_GET:\n".print_r($this->Get, true)."_POST:\n".print_r($this->Post, true)."_COOKIE:\n".print_r($this->Cookie, true)."\n".str_repeat('=', 100)."\n"; + if ($this->Get) { + $data .= "_GET:\n".print_r($this->Get, true); + } + if ($this->Post) { + $data .= "_POST:\n".print_r($this->Post, true); + } + $data .= str_repeat('=', 100)."\n"; + fwrite($fp, $data); fclose($fp); } Index: trunk/admin/users/user_editgroup.php =================================================================== diff -u -N -r2853 -r4645 --- trunk/admin/users/user_editgroup.php (.../user_editgroup.php) (revision 2853) +++ trunk/admin/users/user_editgroup.php (.../user_editgroup.php) (revision 4645) @@ -21,7 +21,7 @@ // new startup: end /* set the destination of the image upload, relative to the root path */ -$DestDir = "kernel/images/"; +$DestDir = 'kernel/images/'; $pathtolocal = $pathtoroot."kernel/"; require_once ($pathtoroot.$admin."/include/elements.php"); Index: trunk/admin/config/addtheme.php =================================================================== diff -u -N -r2853 -r4645 --- trunk/admin/config/addtheme.php (.../addtheme.php) (revision 2853) +++ trunk/admin/config/addtheme.php (.../addtheme.php) (revision 4645) @@ -21,7 +21,7 @@ // new startup: end /* set the destination of the image upload, relative to the root path */ -$DestDir = "kernel/images/"; +$DestDir = 'kernel/images/'; $pathtolocal = $pathtoroot."kernel/"; require_once ($pathtoroot.$admin."/include/elements.php"); Index: trunk/admin/users/user_addimage.php =================================================================== diff -u -N -r2853 -r4645 --- trunk/admin/users/user_addimage.php (.../user_addimage.php) (revision 2853) +++ trunk/admin/users/user_addimage.php (.../user_addimage.php) (revision 4645) @@ -21,7 +21,7 @@ // new startup: end /* set the destination of the image upload, relative to the root path */ -$DestDir = "kernel/images/"; +$DestDir = 'kernel/images/'; $pathtolocal = $pathtoroot."kernel/"; require_once ($pathtoroot.$admin."/include/elements.php"); Index: trunk/kernel/action.php =================================================================== diff -u -N -r4490 -r4645 --- trunk/kernel/action.php (.../action.php) (revision 4490) +++ trunk/kernel/action.php (.../action.php) (revision 4645) @@ -1721,7 +1721,7 @@ $objImageList->SourceTable = $objSession->GetEditTable("Images"); $LocalImage=0; $LocalThumb=0; - $DestDir = "kernel/images/"; + $DestDir = 'kernel/images/'; $UserThumbSource = (int)$_POST["imgLocalThumb"]; $LocalThumb = $UserThumbSource; @@ -1817,7 +1817,7 @@ $FULLFile = $_FILES["imgFullFile"]; $THFile = $_FILES["imgThumbFile"]; - $DestDir = "kernel/images/"; + $DestDir = 'kernel/images/'; $img->Pending = FALSE; $SameImagesN = 0; Index: trunk/core/kernel/utility/formatters.php =================================================================== diff -u -N -r4029 -r4645 --- trunk/core/kernel/utility/formatters.php (.../formatters.php) (revision 4029) +++ trunk/core/kernel/utility/formatters.php (.../formatters.php) (revision 4645) @@ -627,6 +627,7 @@ } else { + @chmod($file_name, 0666); if(getArrayValue($options, 'size_field')) { $object->SetDBField($options['size_field'], $value['size']); Index: trunk/admin/config/email_edit.php =================================================================== diff -u -N -r2853 -r4645 --- trunk/admin/config/email_edit.php (.../email_edit.php) (revision 2853) +++ trunk/admin/config/email_edit.php (.../email_edit.php) (revision 4645) @@ -21,7 +21,7 @@ // new startup: end /* set the destination of the image upload, relative to the root path */ -$DestDir = "kernel/images/"; +$DestDir = 'kernel/images/'; require_once ($pathtoroot.$admin."/include/elements.php"); require_once ($pathtoroot."kernel/admin/include/navmenu.php");