summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ce5c54e)
raw | patch | inline | side by side (parent: ce5c54e)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Dec 2006 11:21:57 +0000 (11:21 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Dec 2006 11:21:57 +0000 (11:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5431 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_sambaMungedDial.inc | patch | blob | history |
index 0f387658196c4e705b6c7cdc5d1b21625ae31a3f..03a5b8c30f4528e4b334c824bcde186664d7c30e 100644 (file)
"20002000200020002000200020002000".
"20002000200020002000200020002000".
"5000");
+/* This is the old header, it is needed to automatically convert old mungedDials to new ones */
+define ("FILEHEADER_OLD",
+ "6d000800200020002000200020002000".
+ "20002000200020002000200020002000".
+ "20002000200020002000200064000100".
+ "20002000200020002000200020002000".
+ "20002000200020002000200020002000".
+ "20002000200020002000200020002000".
+ "50001000");
class sambaMungedDial
{
/* These parameters are treated as time values and get converted */
var $timeParams= array("CtxMaxConnectionTime", "CtxMaxDisconnectionTime", "CtxMaxIdleTime");
+ var $old_behavior= false;
function strhex($string)
{
/*
* Remove base64 encoding and skip FILEHEADER.
* The '4' is added, because the FILEHEADER has been stripped by 4 chars.
- * These is the number of attributes follow - we don't need this now - only when writing.
+ * This is the number of attributes following - we don't need this at read time, only when writing.
*/
- $ctxField= substr(base64_decode($munge), (strlen(FILEHEADER)+4) / 2);
+ if(substr(base64_decode($munge),0,2)=="6d") {
+ $this->old_behavior=true;
+ }
+
+ $ctxField="";
+ if($this->old_behavior==true) {
+ $ctxField= substr(base64_decode($munge), (strlen(FILEHEADER_OLD)) / 2);
+ } else {
+ $ctxField= substr(base64_decode($munge), (strlen(FILEHEADER)+4) / 2);
+ }
/* Decode parameters */
while ($ctxField!=""){
*/
function getShadow ()
{
- $result= substr($this->ctx['CtxShadow'], 1, 1);
+ if($this->old_behavior==true) {
+ $result= substr($this->ctx['CtxCfgFlags1'], 1, 1);
+ } else {
+ $result= substr($this->ctx['CtxShadow'], 1, 1);
+ }
return $result;
}
function setShadow ($checked, $value)
{
if ($checked) {
+ if($this->old_behavior==true) {
+ // We need to reset the old setting
+ $this->ctx['CtxCfgFlags1'][1]= sprintf('%1X', $value);
+ }
$this->ctx['CtxShadow'][1]= sprintf('%1x', $value);
}
}