summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77f1e56)
raw | patch | inline | side by side (parent: 77f1e56)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 3 Dec 2007 07:18:09 +0000 (07:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 3 Dec 2007 07:18:09 +0000 (07:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7969 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_goKioskService.inc | patch | blob | history | |
plugins/admin/systems/goKioskService.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_goKioskService.inc b/plugins/admin/systems/class_goKioskService.inc
index 83f2624fafdbd53b61ebd8c679a805bfddcd58e5..583a489ae36245b48ac663394f4f19aa9bde6c55 100644 (file)
/* This plugin only writes its objectClass */
var $objectclasses = array("goEnvironmentServer");
- var $attributes = array("gotoKioskProfile");
+ var $attributes = array("gotoKioskProfile","cn");
var $StatusFlag = "";
/* This class can't be assigned twice so it conflicts with itsself */
var $baseDir = "../kiosk";
var $filesToAttach = array();
var $cn = "unknown";
- var $gotoKioskProfiles = array();
- var $gotoKioskProfile = array();
+ var $gotoKioskProfiles= array();
+ var $gotoKioskProfile = array();
+
+ var $server_path = "http://%cn/kiosk";
function goKioskService(&$config,$dn)
{
if(isset($this->attrs['gotoKioskProfile']) && is_array($this->attrs['gotoKioskProfile'])){
for($i = 0 ; $i < $this->attrs['gotoKioskProfile']['count']; $i ++){
$url = $this->attrs['gotoKioskProfile'][$i];
- $name= preg_replace("/^.*\/kiosk\//","",$url);
-
+ $this->server_path = preg_replace("/\/[^\/]*$/","",$url);
+ $this->server_path = preg_replace("/".normalizePreg($this->cn)."/","%cn",$this->server_path);
+ $name= preg_replace("/^.*\//","",$url);
$this->gotoKioskProfiles[] = array('url' => $url ,
'name' => $name ,
'initial' =>TRUE,
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
}
+ $smarty->assign("server_path",$this->server_path);
return($smarty->fetch(get_template_path("goKioskService.tpl",TRUE,dirname(__FILE__))));
}
{
goService::save();
- /* Create server url */
- if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
- $method="https://".$this->cn."/kiosk/";
- }else{
- $method="http://".$this->cn."/kiosk/";
- }
-
+ $method = preg_replace("/%cn/",$this->cn,$this->server_path."/");
+ $method = preg_replace("/\/\/*$/","/",$method);
$this->attrs['gotoKioskProfile'] = array();
foreach($this->gotoKioskProfiles as $profile){
if(!$profile['initial']){
show_ldap_error($ldap->get_error(),_("Wohl kaum"));
}
+
+ function save_object()
+ {
+ if(isset($_POST['goKioskPosted'])){
+ goService::save_object();
+ if(isset($_POST['server_path'])){
+ $this->server_path = get_post("server_path");
+ }
+ }
+ }
+
+
/* Return plugin informations for acl handling */
static function plInfo()
{
index 18d076d4eec1fdaaa07d13e43af7074c05430bbd..63ad5e645723d4588713ab5ac178f7edee2ccd5c 100644 (file)
<input type="hidden" name="dialogissubmitted" value="1">
+{t}Server path{/t} <input name="server_path" value="{$server_path}"><br>
{$divlist}
<input type="file" size=50 name="newProfile" value="{t}Browse{/t}">
<input type="submit" name="profileAdd" value="{t}Add{/t}">
<input type='submit' name='CancelService' value='{t}Cancel{/t}'>
</div>
-<input type="hidden" name="goCupsServerPosted" value="1">
+<input type="hidden" name="goKioskPosted" value="1">
<script language="JavaScript" type="text/javascript">
<!-- // First input field on page