Index: phpgwapi/templates/classic/login_celepar.php =================================================================== --- phpgwapi/templates/classic/login_celepar.php (revisão 1705) +++ phpgwapi/templates/classic/login_celepar.php (cópia de trabalho) @@ -141,7 +141,7 @@ if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) { - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason); + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason.'&phpgw_forward='.urlencode($_GET['phpgw_forward'])); } else { @@ -167,7 +167,7 @@ } if ($GLOBALS['phpgw_info']['server']['use_https'] != 2) { - $forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes')); + $forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($_GET['phpgw_forward'].'?cd=yes')); echo ""; } else Index: phpgwapi/templates/default/login_default.php =================================================================== --- phpgwapi/templates/default/login_default.php (revisão 1705) +++ phpgwapi/templates/default/login_default.php (cópia de trabalho) @@ -160,7 +160,7 @@ if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) { - $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason); + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason.'&phpgw_forward='.urlencode($_GET['phpgw_forward'])); } else { @@ -186,7 +186,7 @@ } if ($GLOBALS['phpgw_info']['server']['use_https'] != 2) { - $forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($forward.'?cd=yes')); + $forward = 'http://'.$_SERVER['HTTP_HOST'].($GLOBALS['phpgw']->link($_GET['phpgw_forward'].'?cd=yes')); echo ""; } else Index: expressoMail1_2/index.php =================================================================== --- expressoMail1_2/index.php (revisão 1705) +++ expressoMail1_2/index.php (cópia de trabalho) @@ -91,7 +91,34 @@ $template->set_var("lang_search_user", lang("Search user") . '...'); $template->set_var("upload_max_filesize",ini_get('upload_max_filesize')); $template->set_var("msg_folder",$_GET['msgball']['folder']); - $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']); + + $geto = $_GET['to']; + + function prepareurl($urlde) { + $urlde = str_replace('%0D%0A','
',$urlde); // replace '\r\n', '
' + if( preg_match('[%]',$urlde) ) { + $extra_vars_tmp = explode('&',$urlde); + $extra_new = ""; + foreach($extra_vars_tmp as $param) { // v=%20%25%20nosn%020&a=1 => // v=n%10%2o => v=> não => + $val = explode('=', $param); + $de = urldecode($val[1]); + $u2i = utf8_decode($de); + $pu2i = prepareurl($u2i); + $param2 = urlencode($pu2i); + $extra_new .= $val[0].'='.$param2.'&'; + } + return str_replace('+','%20',$extra_new); + } + return $urlde; + } + + + if($geto) { + $geto = @eregi_replace("^\"|\"$","",$geto); + $geto = prepareurl($geto); + } + //$template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']); + $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $geto); $template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']); $acc = CreateObject('phpgwapi.accounts'); $template->set_var("user_organization", $acc->get_organization($GLOBALS['phpgw_info']['user']['account_dn'])); Index: expressoMail1_2/js/main.js =================================================================== --- expressoMail1_2/js/main.js (revisão 1705) +++ expressoMail1_2/js/main.js (cópia de trabalho) @@ -898,7 +898,52 @@ function new_message_to(email) { var new_border_ID = new_message('new','null'); - document.getElementById("to_" + new_border_ID).value=email; + title = get_lang("New Message"); + + var variaveis=email.split(/\?|&/); + variaveis[0] = "to="+variaveis[0]; + var qs=[]; + for(var i=0;i"); + + var bbb = ""; + if(qs['body']) { + bbb = bbb + ""+qs['body']+""; + } + if (preferences.use_signature == "1") { + bbb = bbb + "
" + signature; + } + bbb = bbb + ""; + body.contentWindow.document.write(bbb); } function new_message(type, border_ID){ @@ -1223,31 +1268,48 @@ break; case "new": title = get_lang("New Message"); + var booleanmailtocontinue=false; + if(Element('msg_number').value) { var _to = Element('msg_number').value; - var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; - if(!reEmail.test(_to)){ - var array_contacts = contacts.split(','); - for(i = 0; i < array_contacts.length;i++) { - if(array_contacts[i].lastIndexOf(_to) != "-1"){ - var _group = array_contacts[i].split(";"); - _to = '"'+_group[0]+'" <'+_group[1]+'>'; - break; + + var qs = _to.split("mailto:"); + if(qs.length==2) { + var unemm = unescape(qs[1]); + var mm = unemm.replace("?","&"); + mm = mm.replace("\r\n","
"); + booleanmailtocontinue=true; + Element('msg_number').value=mm; + delete_border(new_border_ID,'true'); + new_message_to(mm); + } + else { + var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; + if(!reEmail.test(_to)){ + var array_contacts = contacts.split(','); + for(i = 0; i < array_contacts.length;i++) { + if(array_contacts[i].lastIndexOf(_to) != "-1"){ + var _group = array_contacts[i].split(";"); + _to = '"'+_group[0]+'" <'+_group[1]+'>'; + break; + } } } + Element("to_" + new_border_ID).value = _to +','; } - Element("to_" + new_border_ID).value = _to +','; Element('msg_number').value = ''; } var body = document.getElementById("body_" + new_border_ID); - body.contentWindow.document.open(); - // Insert the signature automaticaly at message body if use_signature preference is set - if (preferences.use_signature == "1") { - body.contentWindow.document.write("" + "
" + signature + ""); + if(booleanmailtocontinue==false) { + body.contentWindow.document.open(); + // Insert the signature automaticaly at message body if use_signature preference is set + if (preferences.use_signature == "1") { + body.contentWindow.document.write("" + "
" + signature + ""); + } + else { + body.contentWindow.document.write(""); + } } - else { - body.contentWindow.document.write(""); - } body.contentWindow.document.close(); body.contentWindow.document.designMode = "on"; config_events( body.contentWindow.document, 'onkeyup', function( e )