Commit 532ae591 authored by latham's avatar latham

Remove DOS line returns lathama

parent 4e7e4c3c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# diff openssl.cnf /usr/lib/ssl/openssl.cnf
68c68
< default_days = 3653 # how long to certify for
---
> default_days = 365 # how long to certify for
125c125
< countryName_default = YOURCOUNTRY
---
> countryName_default = AU
130c130
< stateOrProvinceName_default = YOURPROVINCE
---
> stateOrProvinceName_default = Some-State
135c135
< 0.organizationName_default = YOURDOMAIN
---
> 0.organizationName_default = Internet Widgits Pty Ltd
142c142
< organizationalUnitName_default = ISP
---
> #organizationalUnitName_default =
145d144
< commonName_default = YOURHOSTNAME
149d147
< emailAddress_default = postmaster@YOURDOMAIN
# diff openssl.cnf /usr/lib/ssl/openssl.cnf
68c68
< default_days = 3653 # how long to certify for
---
> default_days = 365 # how long to certify for
125c125
< countryName_default = YOURCOUNTRY
---
> countryName_default = AU
130c130
< stateOrProvinceName_default = YOURPROVINCE
---
> stateOrProvinceName_default = Some-State
135c135
< 0.organizationName_default = YOURDOMAIN
---
> 0.organizationName_default = Internet Widgits Pty Ltd
142c142
< organizationalUnitName_default = ISP
---
> #organizationalUnitName_default =
145d144
< commonName_default = YOURHOSTNAME
149d147
< emailAddress_default = postmaster@YOURDOMAIN
#!/bin/bash
# Script to configuring an ispconfig3 server in a Debian VPS
# by calocen [at] gmail [dot] com
# getting some enviromment values
myhostname=`hostname -f`
mydomain=`hostname -d`
myip=`hostname -i`
[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin
mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","`
myprovince=`geoiplookup $myip | cut -f5 -d" "`
# reconfiguring webalizer, postfix
# could be cool to modify here webalizer values
dpkg-reconfigure -u webalizer
postconf -e "myhostname = $myhostname"
postconf -e "mydestination = $myhostname, localhost"
echo $myhostname > /etc/mailname
dpkg-reconfigure -u postfix
# request new password
oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "`
read -p "mysql password: [$oldpwd] " mysqlpwd
[ -z $mysqlpwd ] && mysqlpwd=$oldpwd
echo $mysqlpwd
#read -p "Are you sure? (y/n) " sure
## who said fear ##
set -x
mysqladmin -u root -p$oldpwd password $mysqlpwd
mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd
cat << EOF > /root/.my.cnf
[client]
password = $mysqlpwd
EOF
chmod 600 /root/.my.cnf
# changing mydns password
mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )"
mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )"
cp -ax /etc/mydns.conf /etc/mydns.conf~
sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf
# enabling mydns
mydns --create-tables > /tmp/mydns.sql
mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;"
rm /tmp/mydns.*
invoke-rc.d mydns restart
# preparing server installation
mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~
sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf |
sed s/"YOURDOMAIN"/"$mydomain"/g | \
sed s/"YOURCOUNTRY"/"$mycountry"/g | \
sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf
tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src
# here would be some stuff to update from SVN
cd /usr/local/src/ispconfig3_install/install/
php -q install.php
#!/bin/bash
# Script to configuring an ispconfig3 server in a Debian VPS
# by calocen [at] gmail [dot] com
# getting some enviromment values
myhostname=`hostname -f`
mydomain=`hostname -d`
myip=`hostname -i`
[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin
mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","`
myprovince=`geoiplookup $myip | cut -f5 -d" "`
# reconfiguring webalizer, postfix
# could be cool to modify here webalizer values
dpkg-reconfigure -u webalizer
postconf -e "myhostname = $myhostname"
postconf -e "mydestination = $myhostname, localhost"
echo $myhostname > /etc/mailname
dpkg-reconfigure -u postfix
# request new password
oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "`
read -p "mysql password: [$oldpwd] " mysqlpwd
[ -z $mysqlpwd ] && mysqlpwd=$oldpwd
echo $mysqlpwd
#read -p "Are you sure? (y/n) " sure
## who said fear ##
set -x
mysqladmin -u root -p$oldpwd password $mysqlpwd
mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd
cat << EOF > /root/.my.cnf
[client]
password = $mysqlpwd
EOF
chmod 600 /root/.my.cnf
# changing mydns password
mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )"
mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )"
cp -ax /etc/mydns.conf /etc/mydns.conf~
sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf
# enabling mydns
mydns --create-tables > /tmp/mydns.sql
mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;"
rm /tmp/mydns.*
invoke-rc.d mydns restart
# preparing server installation
mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~
sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf |
sed s/"YOURDOMAIN"/"$mydomain"/g | \
sed s/"YOURCOUNTRY"/"$mycountry"/g | \
sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf
tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src
# here would be some stuff to update from SVN
cd /usr/local/src/ispconfig3_install/install/
php -q install.php
#!/bin/bash
set -x
echo "" > /etc/resolv.conf
echo "" > /etc/hostname
echo "" > /etc/mailname
rm -f /etc/ssh/ssh_host_*
cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
dpkg-reconfigure -u webalizer
postconf -e "myhostname = $(hostname -f)"
postconf -e "mydestination = $(hostname -f), localhost"
echo $(hostname -f) > /etc/mailname
dpkg-reconfigure -u postfix
rm -f \$0
EOF
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash
set -x
echo "" > /etc/resolv.conf
echo "" > /etc/hostname
echo "" > /etc/mailname
rm -f /etc/ssh/ssh_host_*
cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
dpkg-reconfigure -u webalizer
postconf -e "myhostname = $(hostname -f)"
postconf -e "mydestination = $(hostname -f), localhost"
echo $(hostname -f) > /etc/mailname
dpkg-reconfigure -u postfix
rm -f \$0
EOF
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
---------------------------------------------------------------------------------
- Developer README
---------------------------------------------------------------------------------
When you add or modify a database field or table in the ISPConfig database,
then follow these steps:
1) Add the field or table in the ispconfig3.sql file. This file contains the
complete database dump which is used when ISPConfig gets installed.
2) Create a new file in the "incremental" subfolder wich contains the alter
table, or if it is a complete new table then the add table, statement(s) in
MySQL syntax which is/are required to modify the current ispconfig database
during update. The naming scheme of the sql patch update files is
upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that
you choose for the new file is a +1 increment of the number of the last
existing file and that the number is formatted with 4 digits.
A patch file may contain one or more alter table statements. Every patch file
gets executed once in the database, so do not modify older (already released)
patch files, they will not get executed again if the update was already run
once on a system.
After a patch has been executed, the dbversion field in the server table gets
increeased to the version number of the last installed patch.
If you like to run a patch file again for testing purposes on your dev machine,
then set the number in "dbversion" field of the server table to be lower then
the number of your patch.
Note: Incremental patches are supported for installed ISPConfig versions > 3.0.3.
If the installed version is < 3.0.3, then the full update method is used.
In other words, ISPConfig 3.0.3 is the patch release (dbversion) 0 as the
incremental update feature has been introduced in 3.0.3.
---------------------------------------------------------------------------------
- Developer README
---------------------------------------------------------------------------------
When you add or modify a database field or table in the ISPConfig database,
then follow these steps:
1) Add the field or table in the ispconfig3.sql file. This file contains the
complete database dump which is used when ISPConfig gets installed.
2) Create a new file in the "incremental" subfolder wich contains the alter
table, or if it is a complete new table then the add table, statement(s) in
MySQL syntax which is/are required to modify the current ispconfig database
during update. The naming scheme of the sql patch update files is
upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that
you choose for the new file is a +1 increment of the number of the last
existing file and that the number is formatted with 4 digits.
A patch file may contain one or more alter table statements. Every patch file
gets executed once in the database, so do not modify older (already released)
patch files, they will not get executed again if the update was already run
once on a system.
After a patch has been executed, the dbversion field in the server table gets
increeased to the version number of the last installed patch.
If you like to run a patch file again for testing purposes on your dev machine,
then set the number in "dbversion" field of the server table to be lower then
the number of your patch.
Note: Incremental patches are supported for installed ISPConfig versions > 3.0.3.
If the installed version is < 3.0.3, then the full update method is used.
In other words, ISPConfig 3.0.3 is the patch release (dbversion) 0 as the
incremental update feature has been introduced in 3.0.3.
ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
CREATE TABLE IF NOT EXISTS `mail_mailinglist` (
`mailinglist_id` int(11) unsigned NOT NULL auto_increment,
`sys_userid` int(11) unsigned NOT NULL default '0',
`sys_groupid` int(11) unsigned NOT NULL default '0',
`sys_perm_user` varchar(5) NOT NULL,
`sys_perm_group` varchar(5) character set ucs2 NOT NULL,
`sys_perm_other` varchar(5) NOT NULL,
`server_id` int(11) unsigned NOT NULL default '0',
`domain` varchar(255) NOT NULL,
`listname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`mailinglist_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1;
ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
CREATE TABLE IF NOT EXISTS `mail_mailinglist` (
`mailinglist_id` int(11) unsigned NOT NULL auto_increment,
`sys_userid` int(11) unsigned NOT NULL default '0',
`sys_groupid` int(11) unsigned NOT NULL default '0',
`sys_perm_user` varchar(5) NOT NULL,
`sys_perm_group` varchar(5) character set ucs2 NOT NULL,
`sys_perm_other` varchar(5) NOT NULL,
`server_id` int(11) unsigned NOT NULL default '0',
`domain` varchar(255) NOT NULL,
`listname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
PRIMARY KEY (`mailinglist_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1;
DROP TABLE `mail_mailman_domain`;
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="refresh" content="0;URL=web/index.php">
</head>
<body>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="refresh" content="0;URL=web/index.php">
</head>
<body>
</body>
</html>
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class auth {
var $client_limits = null;
public function get_user_id()
{
return $_SESSION['s']['user']['userid'];
}
public function is_admin() {
if($_SESSION['s']['user']['typ'] == 'admin') {
return true;
} else {
return false;
}
}
public function has_clients($userid) {
global $app, $conf;
$userid = intval($userid);
$client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
if($client['limit_client'] > 0) {
return true;
} else {
return false;
}
}
//** This function adds a given group id to a given user.
public function add_group_to_user($userid,$groupid) {
global $app;
$userid = intval($userid);
$groupid = intval($groupid);
if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
$groups = explode(',',$user['groups']);
if(!in_array($groupid,$groups)) $groups[] = $groupid;
$groups_string = implode(',',$groups);
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
$app->db->query($sql);
return true;
} else {
return false;
}
}
//** This function returns given client limit as integer, -1 means no limit
public function get_client_limit($userid, $limitname)
{
global $app;
// simple query cache
if($this->client_limits===null)
$this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
// isn't client -> no limit
if(!$this->client_limits)
return -1;
if(isset($this->client_limits['limit_'.$limitname])) {
return $this->client_limits['limit_'.$limitname];
}
}
//** This function removes a given group id from a given user.
public function remove_group_from_user($userid,$groupid) {
global $app;
$userid = intval($userid);
$groupid = intval($groupid);
if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
$groups = explode(',',$user['groups']);
$key = array_search($groupid,$groups);
unset($groups[$key]);
$groups_string = implode(',',$groups);
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
$app->db->query($sql);
return true;
} else {
return false;
}
}
public function check_module_permissions($module) {
// Check if the current user has the permissions to access this module
if(!stristr($_SESSION["s"]["user"]["modules"],$module)) {
// echo "LOGIN_REDIRECT:/index.php";
header("Location: /index.php");
exit;
}
}
}
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class auth {
var $client_limits = null;
public function get_user_id()
{
return $_SESSION['s']['user']['userid'];
}
public function is_admin() {
if($_SESSION['s']['user']['typ'] == 'admin') {
return true;
} else {
return false;
}
}
public function has_clients($userid) {
global $app, $conf;
$userid = intval($userid);
$client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
if($client['limit_client'] > 0) {
return true;
} else {
return false;
}
}
//** This function adds a given group id to a given user.
public function add_group_to_user($userid,$groupid) {
global $app;
$userid = intval($userid);
$groupid = intval($groupid);
if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
$groups = explode(',',$user['groups']);
if(!in_array($groupid,$groups)) $groups[] = $groupid;
$groups_string = implode(',',$groups);
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
$app->db->query($sql);
return true;
} else {
return false;
}
}
//** This function returns given client limit as integer, -1 means no limit
public function get_client_limit($userid, $limitname)
{
global $app;
// simple query cache
if($this->client_limits===null)
$this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
// isn't client -> no limit
if(!$this->client_limits)
return -1;
if(isset($this->client_limits['limit_'.$limitname])) {
return $this->client_limits['limit_'.$limitname];
}
}
//** This function removes a given group id from a given user.
public function remove_group_from_user($userid,$groupid) {
global $app;
$userid = intval($userid);
$groupid = intval($groupid);
if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
$groups = explode(',',$user['groups']);
$key = array_search($groupid,$groups);
unset($groups[$key]);
$groups_string = implode(',',$groups);
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
$app->db->query($sql);
return true;
} else {
return false;
}
}
public function check_module_permissions($module) {
// Check if the current user has the permissions to access this module
if(!stristr($_SESSION["s"]["user"]["modules"],$module)) {
// echo "LOGIN_REDIRECT:/index.php";
header("Location: /index.php");
exit;
}
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.