Merge remote-tracking branch 'origin/stable-3.0.5'
Conflicts:
interface/lib/classes/remoting.inc.php
server/cron_daily.php
11 files modified
1 files added
| | |
| | | if(is_file('/var/lib/mailman/data/aliases')) unlink('/var/lib/mailman/data/aliases'); |
| | | if(!is_link('/var/lib/mailman/data/aliases')) symlink('/etc/mailman/aliases', '/var/lib/mailman/data/aliases'); |
| | | exec('postalias /var/lib/mailman/data/aliases'); |
| | | if(!is_file('/var/lib/mailman/data/virtual-mailman')) touch('/var/lib/mailman/data/virtual-mailman'); |
| | | exec('postmap /var/lib/mailman/data/virtual-mailman'); |
| | | if(!is_file('/etc/mailman/virtual-mailman')) touch('/etc/mailman/virtual-mailman'); |
| | | exec('postmap /etc/mailman/virtual-mailman'); |
| | | if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman'); |
| | | exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); |
| | | |
New file |
| | |
| | | ALTER TABLE `sys_config` DROP `config_id`, |
| | | ADD PRIMARY KEY (`group`, `name`); |
| | |
| | | -- |
| | | |
| | | CREATE TABLE `sys_config` ( |
| | | `config_id` int(11) unsigned NOT NULL, |
| | | `group` varchar(64) NOT NULL, |
| | | `name` varchar(64) NOT NULL, |
| | | `value` varchar(255) NOT NULL |
| | | `value` varchar(255) NOT NULL, |
| | | PRIMARY KEY (`group`, `name`) |
| | | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
| | | |
| | | |
| | |
| | | -- Dumping data for table `sys_config` |
| | | -- |
| | | |
| | | INSERT INTO sys_config VALUES ('1','db','db_version','3.0.5.3'); |
| | | INSERT INTO sys_config VALUES ('2','interface','session_timeout','0'); |
| | | INSERT INTO sys_config VALUES ('db','db_version','3.0.5.3'); |
| | | INSERT INTO sys_config VALUES ('interface','session_timeout','0'); |
| | | |
| | | SET FOREIGN_KEY_CHECKS = 1; |
| | |
| | | virtual_alias_domains = |
| | | virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf |
| | | virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, proxy:mysql:{config_dir}/mysql-virtual_email2email.cf, hash:/etc/mailman/virtual-mailman |
| | | virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf |
| | | virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf |
| | | virtual_mailbox_base = {vmail_mailbox_base} |
| | |
| | | private $_wb; |
| | | private $_loaded_classes = array(); |
| | | private $_conf; |
| | | |
| | | public $loaded_plugins = array(); |
| | | |
| | | public function __construct() { |
| | | global $conf; |
| | |
| | | if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_REQUEST['s']) || isset($_REQUEST['s_old']) || isset($_REQUEST['conf'])) { |
| | | die('Internal Error: var override attempt detected'); |
| | | } |
| | | |
| | | |
| | | $this->_conf = $conf; |
| | | if($this->_conf['start_db'] == true) { |
| | | $this->load('db_'.$this->_conf['db_type']); |
| | |
| | | if($this->_conf['start_session'] == true) { |
| | | |
| | | $this->uses('session'); |
| | | $tmp = $this->db->queryOneRecord("SELECT `value` FROM sys_config WHERE `config_id` = 2 AND `group` = 'interface' AND `name` = 'session_timeout'"); |
| | | if($tmp && $tmp['value'] > 0) { |
| | | $sess_timeout = $this->conf('interface', 'session_timeout'); |
| | | if($sess_timeout) { |
| | | /* check if user wants to stay logged in */ |
| | | if(isset($_POST['s_mod']) && isset($_POST['s_pg']) && $_POST['s_mod'] == 'login' && $_POST['s_pg'] == 'index' && isset($_POST['stay']) && $_POST['stay'] == '1') { |
| | | /* check if staying logged in is allowed */ |
| | |
| | | $tmp = $this->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); |
| | | $tmp = $this->ini_parser->parse_ini_string(stripslashes($tmp['config'])); |
| | | if(!isset($tmp['misc']['session_allow_endless']) || $tmp['misc']['session_allow_endless'] != 'y') { |
| | | $this->session->set_timeout($tmp['value']); |
| | | session_set_cookie_params(($tmp['value'] * 60) + 300); // make the cookie live 5 minutes longer |
| | | $this->session->set_timeout($sess_timeout); |
| | | session_set_cookie_params(($sess_timeout * 60) + 300); // make the cookie live 5 minutes longer |
| | | } else { |
| | | // we are doing login here, so we need to set the session data |
| | | $this->session->set_permanent(true); |
| | |
| | | session_set_cookie_params(365 * 24 * 3600); // make the cookie live 5 minutes longer |
| | | } |
| | | } else { |
| | | $this->session->set_timeout($tmp['value']); |
| | | session_set_cookie_params(($tmp['value'] * 60) + 300); // make the cookie live 5 minutes longer |
| | | $this->session->set_timeout($sess_timeout); |
| | | session_set_cookie_params(($sess_timeout * 60) + 300); // make the cookie live 5 minutes longer |
| | | } |
| | | } else { |
| | | session_set_cookie_params(0); // until browser is closed |
| | |
| | | $this->uses('auth,plugin'); |
| | | } |
| | | |
| | | public function __get($prop) { |
| | | if(property_exists($this, $prop)) return $this->{$prop}; |
| | | |
| | | $this->uses($prop); |
| | | if(property_exists($this, $prop)) return $this->{$prop}; |
| | | else return null; |
| | | } |
| | | |
| | | public function __destruct() { |
| | | session_write_close(); |
| | | } |
| | |
| | | foreach($cl as $classname) { |
| | | $classname = trim($classname); |
| | | //* Class is not loaded so load it |
| | | if(!array_key_exists($classname, $this->_loaded_classes)) { |
| | | if(!array_key_exists($classname, $this->_loaded_classes) && is_file(ISPC_CLASS_PATH."/$classname.inc.php")) { |
| | | include_once ISPC_CLASS_PATH."/$classname.inc.php"; |
| | | $this->$classname = new $classname(); |
| | | $this->_loaded_classes[$classname] = true; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public function conf($plugin, $key, $value = null) { |
| | | if(is_null($value)) { |
| | | $tmpconf = $this->db->queryOneRecord("SELECT `value` FROM `sys_config` WHERE `group` = '" . $this->db->quote($plugin) . "' AND `name` = '" . $this->db->quote($key) . "'"); |
| | | if($tmpconf) return $tmpconf['value']; |
| | | else return null; |
| | | } else { |
| | | if($value === false) { |
| | | $this->db->query("DELETE FROM `sys_config` WHERE `group` = '" . $this->db->quote($plugin) . "' AND `name` = '" . $this->db->quote($key) . "'"); |
| | | return null; |
| | | } else { |
| | | $this->db->query("REPLACE INTO `sys_config` (`group`, `name`, `value`) VALUES ('" . $this->db->quote($plugin) . "', '" . $this->db->quote($key) . "', '" . $this->db->quote($value) . "')"); |
| | | return $value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** Priority values are: 0 = DEBUG, 1 = WARNING, 2 = ERROR */ |
| | | |
| | |
| | | <?php |
| | | |
| | | $function_list['server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_add,server_ip_update,server_ip_delete'] = 'Server functions'; |
| | | $function_list['server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete'] = 'Server functions'; |
| | | $function_list['admin_record_permissions'] = 'Record permission changes'; |
| | | |
| | | ?> |
| | |
| | | } elseif($section == 'mail') { |
| | | if($new_config['smtp_pass'] == '') $new_config['smtp_pass'] = $server_config_array['mail']['smtp_pass']; |
| | | } elseif($section == 'misc' && $new_config['session_timeout'] != $server_config_array['misc']['session_timeout']) { |
| | | $app->db->query("DELETE FROM sys_config WHERE `config_id` = 2 AND `group` = 'interface' AND `name` = 'session_timeout'"); |
| | | $app->db->query("INSERT INTO sys_config (`config_id`, `group`, `name`, `value`) VALUES (2, 'interface', 'session_timeout', '" . intval($new_config['session_timeout']) . "')"); |
| | | $app->conf('interface', 'session_timeout', intval($new_config['session_timeout'])); |
| | | } |
| | | $server_config_array[$section] = $new_config; |
| | | $server_config_str = $app->ini_parser->get_ini_string($server_config_array); |
| | |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_dkim_txt'] = 'Resync DKIM-Keys'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | ?> |
| | |
| | | |
| | | //* Resyncing Databases |
| | | if(isset($_POST['resync_db']) && $_POST['resync_db'] == 1) { |
| | | $db_table = 'web_database_user'; |
| | | $index_field = 'database_user_id'; |
| | | $sql = "SELECT * FROM ".$db_table." WHERE 1"; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= "Resynced Database user: ".$rec['database_user'].'<br />'; |
| | | } |
| | | } |
| | | $db_table = 'web_database'; |
| | | $index_field = 'database_id'; |
| | | $sql = "SELECT * FROM ".$db_table." WHERE active = 'y'"; |
| | |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= "Resynced Mailbox: ".$rec['email'].'<br />'; |
| | | } |
| | | } |
| | | $db_table = 'mail_forwarding'; |
| | | $index_field = 'forwarding_id'; |
| | | $sql = "SELECT * FROM ".$db_table; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= "Resynced Alias: ".$rec['source'].'<br />'; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | //* Resyncing Clients |
| | | if(isset($_POST['resync_client']) && $_POST['resync_client'] == 1) { |
| | | $tform_def_file = "form/client.tform.php"; |
| | | $app->uses('tpl,tform,tform_actions'); |
| | | $app->load('tform_actions'); |
| | | |
| | | $db_table = 'client'; |
| | | $index_field = 'client_id'; |
| | | $sql = "SELECT * FROM ".$db_table; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $tmp = new tform_actions; |
| | | $tmp->id = $rec[$index_field]; |
| | | $tmp->dataRecord = $rec; |
| | | $tmp->oldDataRecord = $rec; |
| | | $app->plugin->raiseEvent('client:client:on_after_update', $tmp); |
| | | $msg .= "Resynced Client: ".$rec['contact_name'].'<br />'; |
| | | unset($tmp); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | $app->tpl->setVar('msg', $msg); |
| | | $app->tpl->setVar('error', $error); |
| | | |
| | |
| | | <input id="resync_dns" type="checkbox" value="1" name="resync_dns" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_client_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_client" type="checkbox" value="1" name="resync_client" /> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <tmpl_if name="msg"> |
| | |
| | | if($web_config['security_level'] == 20) { |
| | | |
| | | $app->system->chmod($data['new']['document_root'], 0755); |
| | | $app->system->chmod($data['new']['document_root'].'/web', 0710); |
| | | $app->system->chmod($data['new']['document_root'].'/web', 0711); |
| | | $app->system->chmod($data['new']['document_root'].'/webdav', 0710); |
| | | $app->system->chmod($data['new']['document_root'].'/private', 0710); |
| | | $app->system->chmod($data['new']['document_root'].'/ssl', 0755); |
| | |
| | | if($web_config['security_level'] == 20) { |
| | | |
| | | $app->system->chmod($data['new']['document_root'], 0755); |
| | | $app->system->chmod($data['new']['document_root'].'/web', 0710); |
| | | $app->system->chmod($data['new']['document_root'].'/web', 0711); |
| | | //$app->system->chmod($data['new']['document_root'].'/webdav',0710); |
| | | $app->system->chmod($data['new']['document_root'].'/private', 0710); |
| | | $app->system->chmod($data['new']['document_root'].'/ssl', 0755); |