Commit 3b6487e2 authored by Carsten Schmitz's avatar Carsten Schmitz

Dev Putting back changes lost due to roll-back

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9648 b72ed6b6-b9f8-46b5-92b4-906544132732
parent 712265b3
......@@ -24,52 +24,52 @@ if (isset($_SESSION['loginID']))
$action=returnglobal('action');
if ( $action == "dumpdb" )
{
$accesssummary .= "<p>".$clang->gT("You are not allowed dump the database!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed dump the database!")."<br />";
$accesssummary .= "<a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "dumplabel")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed export a label set!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed export a label set!")."<br />";
$accesssummary .= "<a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "edituser")
{
$accesssummary .= $clang->gT("You are not allowed to change user data!");
$accesssummary .= "<p>".$clang->gT("You are not allowed to change user data!");
$accesssummary .= "<br /><br /><a href='$scriptname?action=editusers'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "newsurvey")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to create new surveys!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to create new surveys!")."<br />";
$accesssummary .= "<a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "deletesurvey")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to delete this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to delete this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "addquestion")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to add new questions for this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to add new questions for this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "activate")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to activate this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to activate this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "deactivate")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to deactivate this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to deactivate this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "addgroup")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to add a group to this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to add a group to this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "ordergroups")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to order groups in this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to order groups in this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "editsurvey")
......@@ -124,7 +124,7 @@ if (isset($_SESSION['loginID']))
}
elseif($action == "FakeGET")
{
$accesssummary .= "<p><span class='errortitle'>".$clang->gT("Security alert")."</span>: ".$clang->gT("Someone may be trying to use your LimeSurvey session by using dangerous GET requests (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").'<br>'.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."</p>";
$accesssummary .= "<p><span class='errortitle'>".$clang->gT("Security alert")."</span>: ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").'<br>'.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."</p>";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
else
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
include_once('globalsettings.php');
include_once('database.php');
if($subaction=='bounceprocessing')
{
if(empty($cron))
{
$surveyidoriginal = $_GET['sid'];
}
$settings=getSurveyInfo($surveyidoriginal);
if ($settings['bounceprocessing']=='N')
{
}
else
{
$bouncetotal=0;
$checktotal=0;
if($settings['bounceprocessing']=='G')
{
$accounttype=getGlobalSetting('bounceaccounttype');
$hostname=getGlobalSetting('bounceaccounthost');
$username=getGlobalSetting('bounceaccountuser');
$pass=getGlobalSetting('bounceaccountpass');
$hostencryption=getGlobalSetting('bounceencryption');
}
else
{
$accounttype=$settings['bounceaccounttype'];
$hostname=$settings['bounceaccounthost'];
$username=$settings['bounceaccountuser'];
$pass=$settings['bounceaccountpass'];
$hostencryption=$settings['bounceaccountencryption'];
}
if($accounttype=='IMAP')
{
if($hostencryption=='SSL')
{
$finalhostname='{'.$hostname.'/imap/ssl}INBOX';
}
elseif($hostencryption=='TLS')
{
$finalhostname='{'.$hostname.'/imap/tls}INBOX';
}
else
{
$finalhostname='{'.$hostname.'/imap}INBOX';
}
if(@$mbox=imap_open($finalhostname,$username,$pass))
{
@$count=imap_num_msg($mbox);
$lasthinfo=imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$gettimestamp = "select bouncetime from ".db_table_name("surveys")." where sid='$surveyidoriginal';";
$datelcufiles = $connect->Execute($gettimestamp);
$datelcufile = substr($datelcufiles,11);
while($datelcu > $datelcufile)
{
$lasthinfo=imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$header = explode("\r\n", imap_body($mbox,$count));
foreach ($header as $item)
{
if (preg_match('/^X-surveyid/',$item))
{
$surveyid=explode(": ",$item);
}
if (preg_match('/^X-tokenid/',$item))
{
$token=explode(": ",$item);
if($surveyidoriginal == $surveyid[1])
{
$bouncequery = "UPDATE ".db_table_name("tokens_$surveyidoriginal")." set emailstatus='bounced' where token='$token[1]';";
$anish=$connect->Execute($bouncequery);
$bouncetotal++;
}
}
}
$count--;
$lasthinfo=imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$checktotal++;
}
@$count=imap_num_msg($mbox);
@$lastcheckedinfo=imap_headerinfo($mbox,$count);
$datelcfinal=$lastcheckedinfo->date;
$datelcfinalu = strtotime($datelcfinal);
$entertimestamp = "update ".db_table_name("surveys")." set bouncetime='$datelcfinalu' where sid='$surveyidoriginal';";
$executetimestamp = $connect->Execute($entertimestamp);
}
else
{
echo "Please check your settings";
}
}
elseif($accounttype='POP')
{
if($hostencryption=='SSL')
{
$finalhostname='{'.$hostname.'/pop3/ssl/novalidate-cert}INBOX';
}
elseif($hostencryption=='TLS')
{
$finalhostname='{'.$hostname.'/pop3/tls/novalidate-cert}INBOX';
}
else
{
$finalhostname='{'.$hostname.'/pop3/novalidate-cert}INBOX';
}
if(@$mbox=imap_open($finalhostname,$username,$pass))
{
@$count=imap_num_msg($mbox);
while($count>0)
{ @$header = explode("\r\n", imap_body($mbox,$count));
foreach ($header as $item)
{
if (preg_match('/^X-surveyid/',$item))
{
$surveyid=explode(": ",$item);
}
if (preg_match('/^X-tokenid/',$item))
{
$token=explode(": ",$item);
if($surveyidoriginal == $surveyid[1])
{
$bouncequery = "UPDATE ".db_table_name("tokens_$surveyidoriginal")." set emailstatus='bounced' where token='$token[1]';";
$anish=$connect->Execute($bouncequery) or safe_die ("Couldn't update sent field<br />$query<br />".$connect->ErrorMsg());
$bouncetotal++;
}
}
}
$count--;
$checktotal++;
}
imap_errors();
imap_close($mbox);
}
else
{
echo "Please check your settings";
}
}
if($bouncetotal>0)
{
echo "<div id='dialog-modal'>$checktotal messages were scanned out of which $bouncetotal were marked as bounce by the system. <br><br><br>Please reload the browse table to view results</div>";
}
else
{
echo "<div id ='dialog-modal'>$checktotal messages were scanned out of which $bouncetotal were marked as bounce by the system.</div>";
}
}
}
?>
This diff is collapsed.
This diff is collapsed.
<?php
/**
* GTranslate - A class to comunicate with Google Translate(TM) Service
* Google Translate(TM) API Wrapper
* More info about Google(TM) service can be found on http://code.google.com/apis/ajaxlanguage/documentation/reference.html
* This code has o affiliation with Google (TM) , its a PHP Library that allows to comunicate with public a API
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Jose da Silva <jose@josedasilva.net>
* @since 2009/11/18