Subversion Repositories slis

Compare Revisions

Ignore whitespace Rev 6101 → Rev 6102

/slim/sources/trunk/slis-slim/include/lang/en/msgs.php
292,6 → 292,7
"Voulez-vous réellement supprimer le groupe %s ?" => "Do you really want to delete group %s?",
"Admin" => "Admin",
"slis admin" => "Slis administration",
"web admin" => "Web admin interfaces",
"RootShell" => "Root shell",
"Administrateurs" => "Admin users",
"Liste des administrateurs" => "Admin users list",
/slim/sources/trunk/slis-slim/include/lang/fr/msgs.php
301,6 → 301,7
"Admin" => "Admin",
 
"slis admin" => "Administration Slis",
"web admin" => "Interfaces web d'administration",
"RootShell" => "Shell root",
"Choix d'un utilisateur et d'un groupe de SLIS" => "Choix d'un utilisateur et d'un groupe de SLIS" ,
"Choix d'un groupe de SLIS et d'un profile" => "Choix d'un groupe de SLIS et d'un profile" ,
686,7 → 687,7
"by default" =>"par défaut",
"filename" => "Nom de fichier",
"Fichiers disponibles" => "Fichiers disponibles",
"Voulez-vous éffacer ce fichier?" =>"Voulez-vous effacer ce fichier?",
"Voulez-vous éffacer ce fichier?" =>"Voulez-vous éffacer ce fichier?",
"File Managment" => "Gestionnaire de fichiers",
"No more item to add" => "Aucun élément à ajouter",
"Col 1" => "Colone 1" ,
754,7 → 755,7
"SLIS 4.1 - lcs.conf" => "SLIS 4.1 - lcs.conf",
"SLIS 3.x - 4.0" => "SLIS 3.x - 4.0",
"SLIS 4.1 / LCS 2.0" => "SLIS 4.1 / LCS 2.0",
"Last generated version" => "Dernière version générée"
"Last generated version" => "Dernière version générée"
);
?>
/slim/sources/trunk/slis-slim/scripts/Slis/view.php
262,10 → 262,14
$form = new Form("interface.php");
$form->setTarget("_blank");
$form->add_field(new HiddenField("","", "slis admin"));
$form->add_field(new HiddenField("","", "web admin"));
$form->add_field(new HiddenField("name", $slis->name));
// $form->add_field(new CheckboxField("newWindow","Dans une nouvelle fenêtre","t"));
$form->add_button(new Button("go"));
$form->add_button(new Button("SLIS", "goSLIS"));
if ($slis->version > 4.0) {
$form->add_button(new Button("LCS", "goLCS"));
}
 
return $form->build_code()."\n";
 
}else
/slim/sources/trunk/slis-slim/scripts/Slis/interface.php
43,9 → 43,76
return "http{$s}://{$slis->name}.{$hadmin_domain}:{$hadmin_port}";
}
//*************************************************
function get_hadmin_url_with_pass($slis)
{
global $hadmin_superuser,$hadmin_url,$hadmin_domain,$hadmin_port;
$pass= get_passwd($slis->name,"hadmin",$err);
return "https://$hadmin_superuser:$pass@{$slis->name}.{$hadmin_domain}:{$hadmin_port}";
}
//*************************************************
function lcs_remote_ip()
{
if(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} elseif (getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} else {
$ip = getenv("REMOTE_ADDR");
}
$ip = getenv("REMOTE_ADDR");
return $ip;
}
 
 
function log_to_lcs($slis) {
global $hadmin_superuser,$hadmin_domain;
$pass= get_passwd($slis->name,"lcs_admin",$err);
 
$slis_dns = $slis->name.".".$hadmin_domain;
 
echo "
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN\ http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<body>
<script type='text/javascript' src='http://".$slis_dns."/lcs/crypto.js'></script>
<script type='text/javascript' src='http://".$slis_dns."/lcs/public_key.js'></script>
<script type='text/javascript'>
<!--
// Input data
var login = '".$hadmin_superuser."';
var pass = '".$pass."';
var user_ip = '".lcs_remote_ip()."';
var lcs_ip = '".$slis_dns."';
 
// Data generated by the javascript
// now.getTime() returns a time 1000x greater than the real timestamp
// in seconds since javascript returns a value in milliseconds but at
// least it avoids login failures due to login delay elapsed...
var now = new Date();
var encode = pass + '|' + user_ip + '|' + now.getTime() + '|10';
var string_auth = rsaEncode(public_key_e, public_key_pq, encode);
 
// Option 2: standard LCS login form
document.write(\"<form name='formlcs' method='post' action='http://\" + '".$slis_dns. "' + \"/lcs/auth.php'>\");
document.write(\"<input type='hidden' name='login' value='\" + login + \"'/>\");
document.write(\"<input type='hidden' name='string_auth' value='\" + string_auth.replace(\"'\", \"&apos;\") + \"'/>\");
//document.write(\"<input type='submit' value='Login to LCS via usal form'/>\");
document.write(\"</form>\");
 
document.forms['formlcs'].submit()
 
-->
</script>
 
</body>
</html>
";
}
//*************************************************
 
 
 
if ($loc){
if (substr($loc,0,4)!="http"){
$loc=base64_decode($loc);
64,27 → 131,39
}
 
if ($slis && $slim_user->has_slis_right("log_to_hadmin_slis", $slis->name)){
$passwd = get_hadmin_pass($slis);
 
if ($passwd) {
// $log_pass="$hadmin_superuser:".get_hadmin_pass($slis);
$log_pass="$hadmin_superuser:$passwd";
//echo "logpass=".$log_pass;exit();
if ($loc) {
$url=$loc;
} else {
$url= get_hadmin_url($slis);
}
// syslog(LOG_ERR, "hop url : $url");
print getPage($slis->name ,$url ,$log_pass , get_defined_vars());
//print ("url=".get_hadmin_url($slis). " login= $hadmin_superuser:".get_hadmin_pass($slis));
if ( isset ($goLCS)) {
// Log to LCS
log_to_lcs($slis);
} else {
// Log to SLIS
$passwd = get_hadmin_pass($slis);
 
if ($passwd) {
// $log_pass="$hadmin_superuser:".get_hadmin_pass($slis);
$log_pass="$hadmin_superuser:$passwd";
//echo "logpass=".$log_pass;exit();
if ($loc) {
$url=$loc;
} else {
$url= get_hadmin_url($slis);
}
// syslog(LOG_ERR, "hop url : $url");
 
//print getPage($slis->name ,$url ,$log_pass , get_defined_vars());
if ( preg_match("/^(1|2|3)\..*/",$slis->version) ) {
print getPage($slis->name ,$url ,$log_pass , get_defined_vars());
} else {
header('Location: ' . get_hadmin_url_with_pass($slis));
}
 
 
//print ("url=".get_hadmin_url($slis). " login= $hadmin_superuser:".get_hadmin_pass($slis));
}
else {
print "No passwd!";
}
}
else {
print "No passwd!";
}
}else {
html_error("Operation not allowed");
}