Commit 602e2499 authored by Mayoro Diagne's avatar Mayoro Diagne

first release of xellplan

parent a38e5ed6
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
parts = instance
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
source = ${application:location}
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
lampconfigure_directory = ${buildout:bin-directory}/lampconfigure
httpd_binary = ${apache:location}/bin/httpd
mysql_binary = ${mariadb:location}/bin/mysql
mysql_install_binary = ${mariadb:location}/bin/mysql_install_db
mysql_upgrade_binary = ${mariadb:location}/bin/mysql_upgrade
mysqld_binary = ${mariadb:location}/libexec/mysqld
delete = install.php
table_name = sheets
constraint = `sheet_id`>=0
[buildout]
versions = versions
parts =
template
apache-php
mariadb
eggs
instance-recipe-egg
downloadcache-workaround
extends =
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/lamp:/stack/lamp.cfg
http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/stack/shacache-client.cfg
[application]
recipe = hexagonit.recipe.download
url = http://sunet.dl.sourceforge.net/project/xellplan/xellplan/xellplan-1.3/xellplan-1.3.tar.bz2
md5sum = 37880217917367eb2d4a0a33c4a7fb65
#If provided tarball does not contain top directory, option shall be changed to false
strip-top-level-dir = true
[application-template]
recipe = slapos.recipe.download
url = https://gitorious.org/~mayoro/slapos/yoro-slapos/blobs/raw/master/software/xellplan/template/sfx.php.in
#md5sum = Student may put here md5sum of this file, this is good idea
download-only = True
filename = template.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[application-configuration]
location = inc/sfx.php
[instance-recipe]
egg = slapos.cookbook
module = lamp.simple
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
#md5sum = Student shall put md5 of instance.cfg here
output = ${buildout:directory}/template.cfg
mode = 0644
[instance-recipe-egg]
recipe = zc.recipe.egg
python = python2.7
eggs =
${mysql-python:egg}
${instance-recipe:egg}
slapos.toolbox[lampconfigure]
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-010
[downloadcache-workaround]
# workaround irritating problem of hexagonit.recipe.cmmi which automatically
# creates download cache, which in turn switches builout to "semi-offline" mode
recipe = plone.recipe.command
# in hexagonit.recipe.cmmi if there is no ${buildout:download-cache} set it resolves
# to ${buildout:directory}/downloads but this variable is available late, that's
# why it is hardcoded only for required case
download-cache = ${buildout:directory}/downloads
command = [ -d ${:download-cache} ] && rm -fr ${:download-cache}/* || exit 0
update-command = ${:command}
stop-on-error = True
<?php
#----------------------------------------------------------------------
# config begin
$SITE_TITLE = "XellPlan";
# default language, ("de","en" are valid choices for now)
$LANGUAGE = "en";
$DB_NAME = "%(mysql_database)s";
$DB_HOST = "%(mysql_host)s";
$DB_USER = "%(mysql_user)s";
$DB_PASS = "%(mysql_password)s";
$DB_PREFIX = "xp_";
$CREATE_PASSWORD = "genesis"; # you need this one to create new plans
$MASTER_PASSWORD = "god"; # universal user and admin password
# config end - don't modify anything below this line
#----------------------------------------------------------------------
include("lang/".$LANGUAGE.".php");
function db_connect() {
global $DB_LINK, $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME, $CLUBS, $PLAN;
$DB_LINK = mysql_pconnect( $DB_HOST, $DB_USER, $DB_PASS );
mysql_select_db( $DB_NAME );
}
function SfxRedirectPage($url,$Message,$time=2) {
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="std.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Christoph Luehr">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="content-language" content="de">
<meta http-equiv="refresh" content="<?php echo $time; ?>;URL=<?php echo $url; ?>">
<title>XCell-Plan: <?php echo $Message; ?></title>
</head>
<body>
<br/>
<h1><?php echo $Message; ?></h1>
<br></br>
</body>
</html>
<?php
exit; // finish after a redirect
}
function SfxDateSel($varname, $default="today") {
if ( $default == "today" ) $default= date('Y-m-d');
echo '<input type="text" name="'.$varname.
'" id="'.$varname.'" value="'.$default.
'" size="10" maxlength="10" readonly="true" />';
echo '<input type="button" '.
'onClick="showCalendar(this,document.getElementById(\''.
$varname.'\'),\'yyyy-mm-dd\',\''.$GLOBALS['LANGUAGE'].'\',1)" value="..." />&nbsp;';
}
function SfxTimeSel($varname,$default="12:00:00") {
echo '<select name="'.$varname.'">';
for ($h=0; $h<24;$h++) {
if (strlen($h)<2 ) $h="0".$h; # evil
foreach( array('00','30') as $m ) {
$sel="";
if ( $default == $h.":".$m.":00") $sel=" selected";
echo '<option value="'.$h.':'.$m.':00"'.$sel.'>'.$h.':'.$m.'</option>';
}
}
echo '</select>'."\n";
}
function SfxBegin() {
db_connect();
}
function filterVar($value) {
// recursive treatment for arrays
if (is_array($value)) {
$ret = array();
foreach ($value as $k => $v) {
$ret[filterVar($k)] = filterVar($v);
}
return $ret;
}
// filter ascii control chars
$value = preg_replace('/[\x00-\x1f]+/', '', $value);
$value = str_replace('\\', '\\\\', $value);
$value = str_replace('\'', '\\\'', $value);
return $value;
}
function getInputVar($name) {
if (isset($GLOBALS[$name])) {
return $GLOBALS[$name];
}
if (isset($_GET[$name])) {
return filterVar($_GET[$name]);
}
if (isset($_POST[$name])) {
return filterVar($_POST[$name]);
}
return '';
}
SfxBegin(); // start DB connection
// get often used vars
$ID = getInputVar('ID');
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment