Commit 9489d4f7 authored by Benjamin Sonntag's avatar Benjamin Sonntag

Merge branch 'master' of alternc.org:alternc

parents 566980a5 b2f5a132
......@@ -605,6 +605,7 @@ nightlybuild/READMEFIRST -text
nightlybuild/build.sh -text
nightlybuild/mchroot.sh -text
nightlybuild/nightly.key -text
phpunit/tests/_datasets/domaines.yml -text
po/alternc-admintools.pot -text
po/fr/LC_MESSAGES/.svnignore -text
po/fr/LC_MESSAGES/alternc-admintools.po -text
......@@ -614,7 +615,6 @@ roundcube/class/m_roundcube.php -text
roundcube/roundcube-install -text
roundcube/roundcube_alternc_logo.png -text
roundcube/templates/apache2/roundcube.conf -text
roundcube/templates/logrotate.d/roundcube-core -text
roundcube/templates/roundcube/main.inc.php -text
roundcube/templates/roundcube/plugins/managesieve/config.inc.php -text
roundcube/templates/roundcube/plugins/password/config.inc.php -text
......@@ -663,6 +663,7 @@ src/quota-warning.sh -text
src/quota_delete -text
src/quota_edit -text
src/quota_get -text
src/quota_get_all -text
src/quota_init -text
src/rebuild_all_webconf.sh -text
src/sendmail -text
......
......@@ -35,24 +35,18 @@ if (!$admin->enabled) {
}
$fields = array (
"d" => array ("request", "array", array()),
"accountList" => array ("request", "array", array()),
"del_confirm" => array("request", "string", ""),
);
getFields($fields);
if($del_confirm == "y"){
if (!is_array($accountList)) {
$accountList[] = $accountList;
}
reset($accountList);
while (list($key,$val)=each($accountList)) {
$error = "";
foreach ($accountList as $key => $val) {
if (!$admin->checkcreator($val)) {
__("This page is restricted to authorized staff");
exit();
}
$error = "";
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
$error .= sprintf(_("Member '%s' does not exist"),$val)."<br />";
} else {
......@@ -77,12 +71,14 @@ if($del_confirm == "y"){
<input type="hidden" name="del_confirm" value="y" />
<p class="alert alert-warning"><?php __("WARNING : Confirm the deletion of the users"); ?></p>
<p>
<?php
foreach($accountList as $userid){
$membre = $admin->get($userid);
echo "<input type=\"hidden\" name=\"d[]\" value=\"$userid\" />".$membre['login']."<br/>";
}
?>
<ul>
<?php
foreach($accountList as $userid){
$membre = $admin->get($userid);
echo "<li><input type=\"hidden\" name=\"accountList[]\" value=\"$userid\" />".$membre['login']."</li>";
}
?>
</ul>
</p>
<blockquote>
<input type="submit" class="inb ok" name="confirm" value="<?php __("Yes, delete those accounts"); ?>" />&nbsp;&nbsp;
......
......@@ -174,7 +174,7 @@ if (!is_array($accountList) || empty($accountList)) {
<?php if ($val["su"]) { ?>
<td id="user_<?php echo $val["uid"]; ?>">&nbsp;</td>
<?php } else { ?>
<td><input type="checkbox" class="inc" name="d[]" id="user_<?php echo $val["uid"]; ?>" value="<?php echo $val["uid"]; ?>" /></td>
<td><input type="checkbox" class="inc" name="accountList[]" id="user_<?php echo $val["uid"]; ?>" value="<?php echo $val["uid"]; ?>" /></td>
<?php } // val['su'] ?>
<td <?php if ($val["su"]) echo 'style="color: red"'; ?>><label for="user_<?php echo $val["uid"]; ?>"><b><?php echo $val["login"] ?></b></label></td>
<td><a title="<?php __("Send an email"); ?>" href="mailto:<?php echo $val["mail"]; ?>"><?php echo $val["nom"] . " " . $val["prenom"] ?></a>&nbsp;</td>
......@@ -250,7 +250,7 @@ if ($mem->user["admlist"] == 1) { // SHORT MODE
if ($val["su"]) {
echo '<td>&nbsp;</td>';
} else {
echo '<td align="center"><input type="checkbox" class="inc" name="d[]" value="' . $val["uid"] . '" id="id_c_' . $val["uid"] . '" /></td>';
echo '<td align="center"><input type="checkbox" class="inc" name="accountList[]" value="' . $val["uid"] . '" id="id_c_' . $val["uid"] . '" /></td>';
} // if $val["su"]
?>
<td align="center">
......
......@@ -51,7 +51,7 @@ if ($newlogin) {
// Add an account
if ($mail->add_slave_account($newlogin,$newpass)) {
$error=_("The requested account address has been created. It is now allowed.");
$newlogin=false;$newpass=false;
$newlogin='';$newpass='';
}
}
......
......@@ -138,7 +138,7 @@ function var_input($infotype, $name, $value='') {
break;
case "boolean":
echo "<input type='hidden' name='$name' value='0' />"; // This way, there is allways something send, even if checkbox is unchecked
echo "<input type='checkbox' id='add_$id' name='$name' value='1' ";cbox($value);echo " />";
echo "<input type='checkbox' id='add_$id' name='$name' value='1' ";cbox((bool)$value);echo " />";
break;
default:
echo "WTF ? Dunno what to do with a ".$infotype['type'];
......@@ -251,7 +251,7 @@ foreach ( $variables->strata_order as $strata) {
foreach ($allvars['FQDN_CREATOR'] as $ttk => $ttv ) {
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." &rarr; ";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
edit_var($ttv[$var]);
}
echo "<br/>";
......@@ -267,7 +267,7 @@ foreach ( $variables->strata_order as $strata) {
foreach ($allvars['FQDN'] as $ttk => $ttv ) {
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
echo sprintf(_("Overwritted by %s"), $panel_url[$ttk])." &rarr; ";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
edit_var($ttv[$var]);
}
echo "<br/>";
......@@ -283,7 +283,7 @@ foreach ( $variables->strata_order as $strata) {
foreach ($allvars['CREATOR'] as $ttk => $ttv ) {
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." &rarr; ";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
edit_var($ttv[$var]);
}
echo "<br/>";
......@@ -299,7 +299,7 @@ foreach ( $variables->strata_order as $strata) {
foreach ($allvars['MEMBER'] as $ttk => $ttv ) {
if ( isset($ttv[$var]) && is_array( $ttv[$var])) {
echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." &rarr; ";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
echo "<a href='javascript:edit_var(".$ttv[$var]['id'].");'>"; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "</a>";
edit_var($ttv[$var]);
}
echo "<br/>";
......
......@@ -92,7 +92,7 @@ echo _("See the vars for the account")." ";
echo "<select name='member_id'>";eoption($ml, $member_id);echo "</select>";
echo " "._("logged via")." ";
echo "<select name='fqdn_id'>";eoption($dom->get_panel_url_list(), $fqdn_id );echo "</select> ";
echo "<input type='submit' class='ina' value=\""; echo ehe(_("View")); echo "\" />";
echo "<input type='submit' class='ina' value=\""; ehe(_("View")); echo "\" />";
?>
</form>
......
......@@ -37,14 +37,17 @@ if (!isset($charset) || ! $charset) $charset="UTF-8";
if (file_exists("styles/style-custom.css") ) {
echo '<link rel="stylesheet" href="styles/style-custom.css" type="text/css" />';
}
$favicon = variable_get('favicon', 'favicon.ico' ,'You can specify a favicon, for example /images/my_logo.ico', array(array('desc'=>'URL','type'=>'string')));
?>
<link rel="stylesheet" href="styles/style-empty.css" type="text/css" title="Default - Desktop TNG"/>
<link rel="alternate stylesheet" href="styles/style-bluedesktop10.css" type="text/css" title="Blue Desktop 1.0" />
<link rel="alternate stylesheet" href="styles/style-hw.css" type="text/css" title="Halloween" />
<link rel="Shortcut Icon" href="favicon.ico" type="image/ico" />
<link rel="icon" href="favicon.ico" type="image/ico" />
<link rel="Shortcut Icon" href="<?php echo $favicon;?>" type="image/ico" />
<link rel="icon" href="<?php echo $favicon;?>" type="image/ico" />
<script src="js/alternc.js" type="text/javascript" ></script>
<script src="js/jquery.min_embedded.js" type="text/javascript"></script>
......
......@@ -35,11 +35,12 @@ reset($_POST);
while (list($key,$val)=each($_POST)) {
if (substr($key,0,4)=="del_") {
// Effacement du dossier $val
$r=$hta->DelDir($val);
if (!$r) {
$error.=$err->errstr()."<br />";
// $r=$hta->DelDir($val);
$return = $hta->DelDir($val);
if (!$return) {
$error.= $err->errstr()."<br />";
} else {
$error.=sprintf(_("The protected folder %s has been successfully unprotected"),$val)."<br />";
$error.= sprintf(_("The protected folder %s has been successfully unprotected"),$val)."<br />";
}
}
}
......
......@@ -143,7 +143,7 @@ class system_bind {
*
* @global m_dom $dom
* @param string $domain
* @return string
* @return array
*/
function get_domain_summary($domain=false) {
global $dom;
......
This diff is collapsed.
......@@ -50,7 +50,7 @@ class m_action {
function do_action() {
global $err, $L_INOTIFY_DO_ACTION;
$err->log("action", "do_action");
if( ! touch($L_INOTIFY_DO_ACTION) ){
if( ! @touch($L_INOTIFY_DO_ACTION) ){
return FALSE;
}
return TRUE;
......
......@@ -569,11 +569,11 @@ class m_admin {
* @param int $duration
* @param string $notes
* @param integer $force
* @param boolean $create_dom
* @param string $create_dom
* @param int $db_server_id
* @return boolean Returns FALSE if an error occurs, TRUE if not.
*/
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes = "", $force=0, $create_dom=false, $db_server_id) {
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass=1, $type='default', $duration=0, $notes = "", $force=0, $create_dom='', $db_server_id) {
global $err,$quota,$classes,$cuid,$mem,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$hooks,$action;
$err->log("admin","add_mem",$login."/".$mail);
if (!$this->enabled) {
......@@ -1135,7 +1135,7 @@ EOF;
function checkalldom() {
global $db,$L_NS1,$L_NS2,$L_MX,$L_PUBLIC_IP;
$checked=array();
$r=$db->query("SELECT * FROM domaines ORDER BY domaine;");
$db->query("SELECT * FROM domaines ORDER BY domaine;");
$dl=array();
while ($db->next_record()) {
$dl[$db->Record["domaine"]]=$db->Record;
......@@ -1179,10 +1179,14 @@ EOF;
// Check the IP:
$out=array();
exec("dig +short A ".escapeshellarg($d["sub"].(($d["sub"]!="")?".":"").$c["domaine"]),$out);
if (!in_array($L_PUBLIC_IP,$out)) {
$errstr.="subdomain '".$d["sub"]."' don't point to $L_PUBLIC_IP but to ".implode(",",$out)."\n";
$errno=1;
}
if (! is_array($out)) { // exec dig can fail
$errno=1; $errstr.="Fail to get the DNS information. Try again.\n";
} else {
if (!in_array($L_PUBLIC_IP,$out)) {
$errstr.="subdomain '".$d["sub"]."' don't point to $L_PUBLIC_IP but to ".implode(",",$out)."\n";
$errno=1;
}
}
}
}
}
......@@ -1362,7 +1366,6 @@ EOF;
global $db,$classes,$hooks;
$tmp1=array();
$tmp2=array();
$tmp3=array();
$policies=array();
$db->query("SELECT * FROM policy;");
while ($db->next_record()) {
......
This diff is collapsed.
......@@ -435,7 +435,7 @@ class m_dom {
$this->lock();
// function add_domain($domain,$dns,$noerase=0,$force=0,$isslave=0,$slavedom="")
if (! $this->add_domain($domain, true, false, 1) ) {
if (! $this->add_domain($domain, true, false, true) ) {
$err->raise('dom', "Error adding domain");
return false;
}
......@@ -646,13 +646,13 @@ class m_dom {
* appelle lors de l'installation d'un nouveau domaine.</p>
*
* @param string $dom nom fqdn du domaine installer
* @param integer $dns 1 ou 0 pour hberger le DNS du domaine ou pas.
* @param integer $noerase 1 ou 0 pour rendre le domaine inamovible ou non
* @param integer $force 1 ou 0, si 1, n'effectue pas les tests de DNS.
* @param boolean $dns 1 ou 0 pour hberger le DNS du domaine ou pas.
* @param boolean $noerase 1 ou 0 pour rendre le domaine inamovible ou non
* @param boolean $force 1 ou 0, si 1, n'effectue pas les tests de DNS.
* force ne devrait tre utilis que par le super-admin.
$ @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
*/
function add_domain($domain,$dns,$noerase=0,$force=0,$isslave=0,$slavedom="") {
function add_domain($domain,$dns,$noerase=false,$force=false,$isslave=false,$slavedom="") {
global $db,$err,$quota,$classes,$L_MX,$L_FQDN,$tld,$cuid,$bro,$hooks;
$err->log("dom","add_domain",$domain);
......@@ -1608,6 +1608,10 @@ class m_dom {
return $res;
}
/**
*
* @return array
*/
function get_domain_all_summary() {
global $db,$err;
$res=array();
......
This diff is collapsed.
......@@ -669,6 +669,7 @@ ORDER BY
$db->query("UPDATE mailbox SET quota=".intval($quotamb)." WHERE address_id=".$mail_id.";");
}
$recipients=preg_replace('/[\r\t\s]/', "\n", $recipients); // Handle space AND new line
$r=explode("\n",$recipients);
$red="";
foreach($r as $m) {
......
......@@ -134,7 +134,7 @@ class m_variables {
case 'DEFAULT':
// $variables = $this->variable_merge(array(),$arr_var['DEFAULT'][NULL]);
$variablesList = current($arr_var["DEFAULT"]);
$variablesList = current($arr_var["DEFAULT"]);
$variables = $this->variable_merge(array(),$variablesList);
break;
case 'GLOBAL':
......@@ -372,7 +372,7 @@ class m_variables {
$output = "";
if (isset($tab[$strata][$id][$varname]['value'])) {
$v = $tab[$strata][$id][$varname]['value'];
$output .= $this->display_valueraw_html($v, $varname);
$output .= $this->display_valueraw_html($v, $varname, false);
} else {
$output .= "<em>"._("None defined")."</em>";
}
......
alterncpanel ALL = NOPASSWD : /usr/bin/quota, /usr/sbin/setquota, /usr/lib/alternc/fixperms.sh, /usr/lib/alternc/mem_add, /usr/lib/alternc/mem_del, /usr/lib/alternc/quota_edit, /usr/lib/alternc/quota_get, /usr/lib/alternc/du.pl, /usr/lib/alternc/update_mails.sh
alterncpanel ALL = NOPASSWD : /usr/bin/quota, /usr/sbin/setquota, /usr/lib/alternc/fixperms.sh, /usr/lib/alternc/mem_add, /usr/lib/alternc/mem_del, /usr/lib/alternc/quota_edit, /usr/lib/alternc/quota_get, /usr/lib/alternc/du.pl, /usr/lib/alternc/update_mails.sh, /usr/sbin/repquota
vmail ALL = NOPASSWD : /usr/lib/dovecot/deliver
......@@ -216,14 +216,13 @@ CREATE TABLE IF NOT EXISTS sub_domaines (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
compte int(10) unsigned NOT NULL default '0',
domaine varchar(255) NOT NULL default '',
sub varchar(100) NOT NULL default '',
sub varchar(255) NOT NULL default '',
valeur varchar(255) default NULL,
type varchar(30) NOT NULL default 'LOCAL',
web_action enum ('OK','UPDATE','DELETE') NOT NULL default 'UPDATE',
web_result varchar(255) not null default '',
enable enum ('ENABLED', 'ENABLE', 'DISABLED', 'DISABLE') NOT NULL DEFAULT 'ENABLED',
PRIMARY KEY (id),
UNIQUE (compte,domaine,sub,type,valeur)
PRIMARY KEY (id)
-- ,FOREIGN KEY (type) REFERENCES (domaines_type)
) ENGINE=MyISAM;
......@@ -716,8 +715,7 @@ CREATE TABLE IF NOT EXISTS `default_subdomains` (
`domain_type_parameter` varchar(255) NOT NULL,
`concerned` enum('BOTH','MAIN','SLAVE') NOT NULL DEFAULT 'MAIN',
`enabled` boolean not null default true,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_row` (`sub`,`domain_type`,`domain_type_parameter`,`concerned`)
PRIMARY KEY (`id`)
) ENGINE=MyISAM COMMENT='Contains the defaults subdomains created on domains creation';
INSERT IGNORE INTO `default_subdomains` (`sub`, `domain_type`, `domain_type_parameter`, `concerned`) VALUES
......
......@@ -156,4 +156,4 @@ $mem = new \m_mem();
$err = new \m_err();
$authip = new \m_authip();
$hooks = new \m_hooks();
$bro = new \m_bro();
......@@ -21,16 +21,27 @@ abstract class AlterncTest extends PHPUnit_Extensions_Database_TestCase
* @return \PHPUnit_Extensions_Database_DataSet_YamlDataSet
* @throws \Exception
*/
public function loadDataSet($file_name)
public function loadDataSet($fileList)
{
$file = PHPUNIT_DATASETS_PATH."/$file_name";
if( !is_file($file) ){
throw new \Exception("missing $file");
if (empty($fileList)) {
throw new \Exception("No files specified");
}
$dataSet = new PHPUnit_Extensions_Database_DataSet_YamlDataSet($file);
if( !is_array($fileList)){
$fileList = array($fileList);
}
$datasetList = array();
foreach ($fileList as $file_name) {
$file = PHPUNIT_DATASETS_PATH."/$file_name";
if( !is_file($file) ){
throw new \Exception("missing $file");
}
$dataSet = new PHPUnit_Extensions_Database_DataSet_YamlDataSet($file);
$datasetList[] = $dataSet;
}
$compositeDataSet = new PHPUnit_Extensions_Database_DataSet_CompositeDataSet($datasetList);
return $dataSet;
}
}
\ No newline at end of file
}
domaines:
-
id : 1
compte : 2001
domaine : example.tld
gesdns : 1
gesmx : 1
noerase : 0
dns_action : OK
dns_result : 0
zonettl : 86400
membres:
-
uid : 0
uid : 2000
login : admin
pass : admin
enabled : 1
......@@ -11,6 +11,7 @@ membres:
lastfail : 0
lastip : 127.0.0.1
-
uid : 2001
login : phpunit
pass : phpunit
enabled : 1
......@@ -19,4 +20,4 @@ membres:
show_help : 1
lastlogin : 2014-01-01 00:00:00
lastfail : 0
lastip : 127.0.0.1
\ No newline at end of file
lastip : 127.0.0.1
......@@ -9,6 +9,9 @@ class m_htaTest extends PHPUnit_Framework_TestCase
*/
protected $object;
const PATH_HTACCESS = "/tmp/.htaccess";
const PATH_HTPASSWD = "/tmp/.htpasswd";
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
......@@ -16,6 +19,10 @@ class m_htaTest extends PHPUnit_Framework_TestCase
protected function setUp()
{
parent::setUp();
touch(self::PATH_HTACCESS);
touch(self::PATH_HTPASSWD);
$file_content = "AuthUserFile \"/tmp/.htpasswd\"\nAuthName \"Restricted area\"\nAuthType Basic\nrequire valid-user\n";
file_put_contents(self::PATH_HTACCESS,$file_content);
$this->object = new m_hta;
}
......@@ -26,6 +33,12 @@ class m_htaTest extends PHPUnit_Framework_TestCase
protected function tearDown()
{
parent::tearDown();
if(file_exists(self::PATH_HTACCESS)){
unlink (self::PATH_HTACCESS);
}
if(file_exists(self::PATH_HTPASSWD)){
unlink (self::PATH_HTPASSWD);
}
}
/**
......@@ -114,14 +127,26 @@ class m_htaTest extends PHPUnit_Framework_TestCase
/**
* @covers m_hta::DelDir
* @todo Implement testDelDir().
*/
public function testDelDir()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$result = $this->object->DelDir("/tmp",TRUE);
$this->assertTrue($result);
$this->assertFileNotExists(self::PATH_HTACCESS);
$this->assertFileNotExists(self::PATH_HTPASSWD);
}
/**
* @covers m_hta::DelDir
*/
public function testDelDirNotEmpty()
{
file_put_contents(self::PATH_HTACCESS, "\nphpunit", FILE_APPEND);
$result = $this->object->DelDir("/tmp",TRUE);
$this->assertTrue($result);
$this->assertFileExists(self::PATH_HTACCESS);
$this->assertFileNotExists(self::PATH_HTPASSWD);
$this->assertTrue("phpunit" == trim(file_get_contents(self::PATH_HTACCESS)));
}
/**
......
......@@ -2,7 +2,7 @@
/**
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-13 at 15:55:58.
*/
class m_mailTest extends PHPUnit_Framework_TestCase
class m_mailTest extends AlterncTest
{
/**
* @var m_mail
......@@ -19,6 +19,15 @@ class m_mailTest extends PHPUnit_Framework_TestCase
$this->object = new m_mail;
}
/**
* @return PHPUnit_Extensions_Database_DataSet_IDataSet
*/
public function getDataSet()
{
return parent::loadDataSet("domaines.yml");
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
......@@ -310,10 +319,7 @@ class m_mailTest extends PHPUnit_Framework_TestCase
*/
public function testCreate_alias()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
// Test #1580
}
/**
......
......@@ -28,7 +28,7 @@ then
# cp -f /etc/alternc/templates/roundcube/avelsieve-config.php /etc/alternc/templates/roundcube/apache.conf /etc/roundcube/
# cp -f /etc/alternc/templates/javascript-common/javascript-common.conf /etc/javascript-common/
LOGIN="2000_roundcube"
LOGIN="0000_roundcube"
PASSWORD="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)'`"
DESKEY="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..24)'`"
......@@ -40,7 +40,6 @@ then
# Configuration template location
TEMPLATE_DIR="/etc/alternc/templates"
CONFIG_FILES="etc/roundcube/main.inc.php etc/roundcube/plugins/password/config.inc.php etc/roundcube/plugins/managesieve/config.inc.php"
LOGROTATE_FILES="etc/logrotate.d/roundcube-core"
cat > $SED_SCRIPT <<EOF
s\\%%ALTERNC_LOC%%\\$ALTERNC_LOC\\;
......@@ -62,14 +61,6 @@ EOF
echo " Done"
for file in $LOGROTATE_FILES; do
TEMPLATE="$TEMPLATE_DIR/${file##etc/}"
echo -n " $file"
if [ -f "$TEMPLATE" ]; then
cat $TEMPLATE > /$file
fi
done
echo " Done"
. /usr/lib/alternc/functions.sh
......@@ -99,10 +90,3 @@ EOF
fi
#This is necessary because upgrading roundcube from 7.1 to 7.2 changes this setting
if [ "$1" = "end" ]; then
chown alternc-roundcube:root /etc/roundcube/main.inc.php
fi
<VirtualHost *:80>
ServerName %%fqdn%%
AssignUserId alternc-roundcube nogroup
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
AssignUserId www-data www-data
SetEnv LOGIN "0000-roundcube"
DocumentRoot /var/lib/roundcube
# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory /var/lib/roundcube/>
Options +FollowSymLinks
# This is needed to parse /var/lib/roundcube/.htaccess. See its
# content before setting AllowOverride to None.
AllowOverride All
order allow,deny
allow from all
</Directory>
# Protecting basic directories:
<Directory /var/lib/roundcube/config>
Options -FollowSymLinks
# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
</Directory>
Order allow,deny
allow from all
</Directory>
<Directory /var/lib/roundcube/temp>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>
<Directory /var/lib/roundcube/>
Options +FollowSymLinks
# This is needed to parse /var/lib/roundcube/.htaccess. See its
# content before setting AllowOverride to None.
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory /var/lib/roundcube/logs>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>
# Protecting basic directories:
<Directory /var/lib/roundcube/config>
Options -FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/lib/roundcube/temp>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>
<Directory /var/lib/roundcube/logs>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>
Alias /javascript /usr/share/javascript/
......
######
# Configuration file of Roundcube's logrotate for AlternC
#
# /!\ WARNING /!\ Do not edit this file, edit the one in