parent
1fafc84198
commit
688dd2adf2
9 changed files with 164 additions and 23 deletions
@ -0,0 +1,11 @@ |
||||
#!/usr/bin/perl -w |
||||
|
||||
use esmith::Build::CreateLinks qw(:all); |
||||
|
||||
# Templates to expand |
||||
templates2events("/etc/e-smith/sql/init/opensondage", qw(bootstrap-console-save webapps-update)); |
||||
templates2events("/usr/share/limesurvey/application/config/config.php", qw(bootstrap-console-save webapps-update)); |
||||
|
||||
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-begin"); |
||||
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-end"); |
||||
|
@ -0,0 +1 @@ |
||||
PERMS=0755 |
@ -0,0 +1,3 @@ |
||||
PERMS=0660 |
||||
UID="root" |
||||
GID="www" |
@ -0,0 +1,47 @@ |
||||
{ |
||||
my $db = ${'limesurvey'}{'DbName'} || 'limesurvey'; |
||||
my $user = ${'limesurvey'}{'DbUser'} || 'limesurvey'; |
||||
my $pass = ${'limesurvey'}{'DbPassword'} || 'secret'; |
||||
|
||||
my $schema = "/usr/share/limesurvey/installer/sql/create-mysql.sql"; |
||||
|
||||
$OUT .= <<"END"; |
||||
#! /bin/sh |
||||
if [ ! -d /var/lib/mysql/$db ]; then |
||||
/usr/bin/mysql -e 'create database $db' |
||||
cat $schema | perl -pe 's/prefix_//g' | /usr/bin/mysql $db |
||||
fi |
||||
|
||||
|
||||
/usr/bin/mysql <<EOF |
||||
USE mysql; |
||||
|
||||
REPLACE INTO user ( |
||||
host, |
||||
user, |
||||
password) |
||||
VALUES ( |
||||
'localhost', |
||||
'$user', |
||||
PASSWORD ('$pass')); |
||||
|
||||
|
||||
REPLACE INTO db ( |
||||
host, |
||||
db, |
||||
user, |
||||
select_priv, insert_priv, update_priv, delete_priv, |
||||
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv, |
||||
grant_priv, lock_tables_priv, references_priv) |
||||
VALUES ( |
||||
'localhost', |
||||
'$db', |
||||
'$user', |
||||
'Y', 'Y', 'Y', 'Y', |
||||
'Y', 'Y', 'Y', 'Y', 'Y', |
||||
'N', 'Y', 'Y'); |
||||
|
||||
FLUSH PRIVILEGES; |
||||
EOF |
||||
END |
||||
} |
@ -0,0 +1 @@ |
||||
if (!defined('BASEPATH')) exit('No direct script access allowed'); |
@ -0,0 +1,39 @@ |
||||
return array( |
||||
'basePath' => dirname(dirname(__FILE__)), |
||||
'runtimePath' => dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'runtime', |
||||
'name' => 'LimeSurvey', |
||||
'defaultController' => 'survey', |
||||
'import' => array( |
||||
'application.core.*', |
||||
'application.models.*', |
||||
'application.controllers.*', |
||||
'application.modules.*', |
||||
), |
||||
'components' => array( |
||||
'db' => array( |
||||
'connectionString' => 'mysql:unix_socket=/var/lib/mysql/mysql.sock;dbname={$limesurevey{'DbName'} || 'limesurvey'};', |
||||
'emulatePrepare' => true, |
||||
'username' => '{$limesurevey{'DbUser'} || 'limesurvey'}', |
||||
'password' => '{$limesurevey{'DbPassword'} || 'limesurvey'}', |
||||
'charset' => 'utf8', |
||||
'tablePrefix' => '', |
||||
), |
||||
'urlManager' => array( |
||||
'urlFormat' => 'path', |
||||
'rules' => require('routes.php'), |
||||
'showScriptName' => true, |
||||
), |
||||
|
||||
), |
||||
'config'=>array( |
||||
'debug'=>0, |
||||
'debugsql'=>0, |
||||
'auth_webserver' => true, |
||||
'auth_webserver_autocreate_user' => true, |
||||
'siteadminemail' => 'admin@'.{$DomainName}, |
||||
'emailmethod' => 'smtp', |
||||
'protocol' => 'smtp', |
||||
'emailsmtphost' => 'localhost', |
||||
) |
||||
); |
||||
|
@ -0,0 +1,48 @@ |
||||
{ |
||||
|
||||
my $lang = $sysconfig{'Language'} || 'en_US'; |
||||
$lang = substr $lang, 0, 2; |
||||
|
||||
$OUT .=<<"EOF"; |
||||
|
||||
function hook_get_auth_webserver_profile(\$user_name) { |
||||
if (!isset(\$_SERVER['REMOTE_USER'])){ |
||||
return false; |
||||
} |
||||
\$login = \$_SERVER['REMOTE_USER']; |
||||
if (isset(\$_SERVER['HTTP_USER_NAME'])){ |
||||
\$name = \$_SERVER['HTTP_USER_NAME']; |
||||
} |
||||
else{ |
||||
\$name = \$login; |
||||
} |
||||
if (isset(\$_SERVER['HTTP_USER_EMAIL'])){ |
||||
\$email = \$_SERVER['HTTP_USER_EMAIL']; |
||||
} |
||||
else{ |
||||
\$email = \$login . '\@$DomainName'; |
||||
} |
||||
if (isset(\$_SERVER['HTTP_USER_GROUPS']) && in_array('admins', preg_split("/; /", \$_SERVER['HTTP_USER_GROUPS']))){ |
||||
\$admin = 1; |
||||
} |
||||
else{ |
||||
\$admin = 0; |
||||
} |
||||
return Array( |
||||
'full_name' => \$name, |
||||
'email' => \$email, |
||||
'lang' => '$lang', |
||||
'htmleditormode' => 'inline', |
||||
'templatelist' => 'default,basic,MyOrgTemplate', |
||||
'create_survey' => 1, |
||||
'create_user' => \$admin, |
||||
'delete_user' => \$admin, |
||||
'superadmin' => \$admin, |
||||
'configurator' => \$admin, |
||||
'manage_template' => \$admin, |
||||
'manage_label' => \$admin |
||||
); |
||||
} |
||||
|
||||
EOF |
||||
} |
Loading…
Reference in new issue