Metadata for the backend Kolab Zpush 1) storage The metadatas for the kolab backend will be stored in the folder annotation the entry will be : /vendor/kolab/activesync value.priv All the annotations are per user and are private The global setting will be stored in the root folder INBOX The per folder setting will be stored in each folder 2) Data representation The data will be stored as a serialized JSON Format with specific keys (php instruction json_encode() and json_decode() ) Example : {"APPL023Z34":{"SYNC":1,"ALARM":1}} that is the serialized data : array ( 'APPL023Z34' => array ( 'SYNC' => 1, 'ALARM' => 1, ), ) 3) Global data The globals data will be stored directly in INBOX folder $meta["DEVICE"][]["TYPE"]="type of the mobile" $meta["DEVICE"][]["MODE"]= -1 | 0 | 1 -1 (the global mode set for the backend) (DEFAULT) 0 Flat mode 1 Folder mode Example: $meta["DEVICE"]["APPL023Z34"]["TYPE"]="iphone"; $meta["DEVICE"]["APPL023Z34"]["MODE"]= -1; $meta["DEVICE"]["ANDRO099393939"]["TYPE"]="android"; $meta["DEVICE"]["ANDRO099393939"]["MODE"]= 0; the annotation will be : {"DEVICE":{"APPL023Z34":{"TYPE":"iphone","MODE":-1},"ANDRO099393939":{"TYPE":"android","MODE":0}}} The serials will be collected by the backend at the connexion. if the keyword MODE doesnt exist or if it s equal to -1 for a device the Golbal setting will be applied Object to administrate it We wrote a class to manage the data include_once('kolabActivesyncData.php'); //try a false serialisation $d=new GlobalParam(); if ($d->unserialize("{"DEVICE":{"APPL023Z34":{"TYPE":"iphone","MODE":-1},"ANDRO099393939":{"TYPE":"android","MODE":0}}}")) { echo "Error can t unserialize"; } // add more devices $d->setDevice("ABCBEDBEEB192","iphone"); $d->setDevice("ZERREEEAAZEER","android"); $d->setDevice("AAAAAAAAAAA","iphone",1) ; /list devices $arr=$d->deviceList(); foreach($arr as $dev) { echo "Device" . $dev ."
"; } //save $JsonData=$d->serialize; 4) per Folder Setting Politic rule for the synchronization INBOX/* all the folders in this namespace will be synchronised by default, except if the parameter is set to no user/* all folders won t be synchronised by default, except if the parameter is set to yes shared.* same The same politic will be applied for the Alarms $meta["FOLDER"][]["SYNC"]= 0 | 1 1 the folder will be sync , 0 the folder won t be sync $meta["FOLDER"][]["ALARM"]=0 | 1 1 the Alarms will shown Example: $meta["FOLDER"]["APPL023Z34"]["SYNC"]=1; $meta["FOLDER"]["APPL023Z34"]["ALARM"]= 1; $meta["FOLDER"]["ANDRO099393939"]["SYNC"]=0; $meta["FOLDER"]["ANDRO099393939"]["ALARM"]= 0; the annotation will be : {"FOLDER":{"APPL023Z34":{"SYNC":1,"ALARM":1},"ANDRO099393939":{"SYNC":0,"ALARM":0}}} $f=new FolderParam(); $f->setFolder("INBOX/Calendar"); $f->setForSync("ABCEEDDDDE"); $f->setForSync("IEUUDUENNNE"); $dd=$f->serialize(); $f1=new FolderParam(); $f1->unserialize($dd); $f1->setFolder("INBOX/Calendar"); if ($f1->isForSync("INEXXXXX")) { echo "this folder is for sync"; }