summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5b71c4d)
raw | patch | inline | side by side (parent: 5b71c4d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 28 Mar 2006 05:08:41 +0000 (05:08 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 28 Mar 2006 05:08:41 +0000 (05:08 +0000) |
Added some more checks for dns.
Fixed undefined index for groupGeneric.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2912 594d385d-05f5-0310-b6e9-bd551577e9d8
Fixed undefined index for groupGeneric.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2912 594d385d-05f5-0310-b6e9-bd551577e9d8
index 4fff769d7da205ce7a76589ee0cccdb3a4ad2a2f..982b7c91f288c0f1b3ea39ea7fcfbe39de4e4310 100644 (file)
--- a/TODO
+++ b/TODO
LDAP-Error: Cannot modify object class (structural object class modification from 'person' to 'inetOrgPerson' not allowed)
* Test DNS plugin. Add some more checks
- Fix slang! Woha - what are "free hand entries"?
-
-* Phone account is not removable if the mysql database is not reachable.
- This is no real problem, but I'd like to see the hint message for it.
* Enhance the export xls to export the whole three with a maximum of attributes in each sheet ( OpenSides )
diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc
index de07e7d4c1c6487f3bdcf5881e3cb329c23a9a0f..b693f7064ca554ff3d3ab658004e34ab287e18f4 100644 (file)
$gufilter= get_global('gufilter');
$gufilter['SubSearchGroup'] = false;
- $gufilter['dselect'] = $_SESSION['groupfilter']['depselect'];
+ $gufilter['dselect'] = $_SESSION['gufilter']['dselect'];
register_global('gufilter',$gufilter);
diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc
index faf29d198257ca3f5c207d4da2ea9425193a4483..9265bf61d975d9c78fbd61a62d2618f2fcc7dc54 100644 (file)
var $Devices = array();
var $InitDevices = array();
- var $FreeHosts = array();
- var $InitFreeHosts= array();
-
var $zoneName = ""; // ZoneName of currently edited Zone
var $reverseName = ""; // ReverseZone of the currently edited Zone
-
+
var $RecordTypes= array(); // Possible record type. They will be set in contrucktor
- // and some types will be added later (cName/Ptr)
+ // and some types will be added later (cName/Ptr)
function servDNSeditZoneEntries ($config, $dn= NULL,$zoneName,$reverseName,$RTypes)
{
$this->zoneName = $zoneName;
$this->reverseName = $reverseName;
$this->RecordTypes = $RTypes;
-
+
/* Add records types which are not allowed in zones
*/
$this->RecordTypes['cNAMERecord'] = "relativeDomainName";
$this->RecordTypes['pTRRecord'] = "relativeDomainName";
$this->RecordTypes['tXTRecord'] = "tXTRecord";
-
+
/* Get ldap connection
*/
$ldap = $this->config->get_ldap_link();
}
}
}
-
+
/* Add additional informations
to all catched objects ( ObjectInformations)
*/
$this->Devices[$dn]['OrigCn'] = $attrs['cn'][0];
}
- /* Add Free Hand entries
- * Free hand entries are entries which are not directly assigned
+ /* Add free entries
+ * Free entries are entries which are not directly assigned
* to an existing network object like a WS or a Terminal.
- * They will be found in a subtree within this zone.
+ * They will be found in a subtrees within a zone.
* For example :
- * The object name is FreeHand1,
+ * The object name is free1,
* zoneName=test.de,cn=server ...
* // ObjectContainer
- * relativeDomainName=FreeHand1,zoneName=....
+ * relativeDomainName=Free1,zoneName=....
* // Dns entry
- * relativeDomainName=FreeHand1, relativeDomainName=FreeHand1,zoneName=....
+ * relativeDomainName=Free1, relativeDomainName=Free1,zoneName=....
* // cName entry ....
- * relativeDomainName=terminal12, relativeDomainName=FreeHand1,zone...
+ * relativeDomainName=terminal12, relativeDomainName=Free1,zone...
*/
$ldap->cd ("zoneName=".$this->zoneName.",".$this->dn);
$ldap->ls ("(&(objectClass=dNSZone)(!(relativeDomainName=@)))","zoneName=".$this->zoneName.",".$this->dn,array("*"));
-
+
$GetSubInformations = array();
while($attrs = $ldap->fetch()){
$GetSubInformations [] = $dn;
}
-
+
/* Get sub informations
CName or pTR records are stored in a sub entry.
-
- // The base entry with aRecords/tXTrecords/....
- relativeDomainName=Keks, relativeDomainName=Keks, zoneName=....
- // And the sub entries like this one
- relativeDomainName=10.2.64.in-addr.arpa, relativeDomainName=Keks, zoneName =...
- ( They can't be stored in a single entry, so i decided to store them this way ).
+ // The base entry with aRecords/tXTrecords/....
+ relativeDomainName=Keks, relativeDomainName=Keks, zoneName=....
+
+ // And the sub entries like this one
+ relativeDomainName=10.2.64.in-addr.arpa, relativeDomainName=Keks, zoneName =...
+ ( They can't be stored in a single entry, so i decided to store them this way ).
*/
foreach($GetSubInformations as $dn){
$ldap->ls("(&(objectClass=dNSZone)(!(relativeDomainName=@)))",$dn,array("*"));
}
}
}
-
+
$this->Devices;
$this->InitDevices = $this->Devices;
}
function execute()
{
- plugin::execute();
+ plugin::execute();
/* Check posts for operations ...
*/
$once = true;
foreach($_POST as $name => $value){
-
+
/* Add a new Record in given object
*/
if((preg_match("/^AddRecord_/",$name)) && ($once)){
$tmp = preg_replace("/^AddRecord_/","",$name);
$tmp = preg_replace("/_.*$/","",$tmp);
$tmp2 = split("\|",$tmp);
-
+
$dn = base64_decode($tmp2[0]);
$record = $tmp2[1];
$numrec = $tmp2[2];
-
+
$this->Devices[$dn]['RECORDS'][$record][] = "";
}
-
+
/* Remove record from given dn
*/
if((preg_match("/^RemoveRecord_/",$name)) && ($once)){
$tmp = preg_replace("/^RemoveRecord_/","",$name);
$tmp = preg_replace("/_.*$/","",$tmp);
$tmp2 = split("\|",$tmp);
-
+
$dn = base64_decode($tmp2[0]);
$record = $tmp2[1];
$numrec = $tmp2[2];
-
- unset($this->Devices[$dn]['RECORDS'][$record][$numrec]);
-
+
+ unset($this->Devices[$dn]['RECORDS'][$record][$numrec]);
+
if(count($this->Devices[$dn]['RECORDS'][$record]) == 0){
unset($this->Devices[$dn]['RECORDS'][$record]);
if(count($this->Devices[$dn]['RECORDS']) ==0){
}
}
-
- /* Don't know how i should implement this ...
+
+ /* Add new host entry
*/
if((preg_match("/^UserRecord_/",$name)) && ($once)){
$once = false;
$display.= $smarty->fetch(get_template_path('servDNSeditZoneEntries.tpl', TRUE));
return($display);
}
-
+
/* Create html table out of given entry
*/
}else{
$str = "<h3>".sprintf(_("Settings for '%s'"),$obj_dn)." : </h3>";
}
-
+
$hostNameOnce = true;
/* Walk through all defined records
*/
$str .= "<tr>
<td style='width:80px;'>";
-
+
if($hostNameOnce){
$hostNameOnce = false;
$str .="<input type='text' name='RenameHost_".$name."' value='".$objectName."'>";
}else{
$str .=$objectName;
}
-
+
$str .="
</td>
<td style='width:80px;'>
- ".$this->createRecordTypeSelection($id,$name)."
+ ".$this->createRecordTypeSelection($id,$name)."
</td>
<td>
- <input type='text' value='".$type."' name='ValueSelection_".$name."' style='width:250px;'>
+ <input type='text' value='".$type."' name='ValueSelection_".$name."' style='width:250px;'>
</td>
<td style='width:30px;text-align:right;'>
- <input type='image' name='AddRecord_".$name."' src='images/crossref.png' alt='"._("Add")."' title='"._("Add")."'>
+ <input type='image' name='AddRecord_".$name."' src='images/crossref.png' alt='"._("Add")."' title='"._("Add")."'>
</td>
<td style='width:60px;text-align:right;'>
- <input type='image' name='UserRecord_".$name."' src='images/select_default.png' alt='"._("New")."' title='"._("New")."'>
- <input type='image' name='RemoveRecord_".$name."' src='images/edittrash.png' alt='"._("Remove")."' title='"._("Remove")."'>
+ <input type='image' name='UserRecord_".$name."' src='images/select_default.png' alt='"._("New")."' title='"._("New")."'>
+ <input type='image' name='RemoveRecord_".$name."' src='images/edittrash.png' alt='"._("Remove")."' title='"._("Remove")."'>
</td>
- </tr>";
+ </tr>";
}
}
- $str .="</table>";
+ $str .="</table>";
return($str);
}
$n2 = strtolower($dev['OBJECT']['cn'][0]);
$tmp[$n2] = $n2;
}
-
+
if(!isset($tmp[strtolower($value)])){
$this->Devices[$dn]['OBJECT']['cn'][0] = $value;
}
function check()
{
$message= array();
-
+
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
-
+
+ $names = array();
foreach($this->Devices as $devDN => $device){
- /* check: if given name for Free Hand entry is valid.
+ /* check: if given name for host entry is valid.
* cn exists ? invalid characters ? ...
*/
if($device['Type'] == "Free"){
*/
if(!is_uid($device['OBJECT']['cn'][0])){
$message[] = sprintf(_("Entry name '%s' contains invalid characters."), $device['OBJECT']['cn'][0]);
-
}
/* Check if we have renamed the server, hich we are currently editing.
if(strcmp($devDN,$this->dn) ==0 ){
$new = $device['OBJECT']['cn'][0];
$old = $this->InitDevices[$devDN]['OBJECT']['cn'][0];
-
+
if($new != $old){
$message[] = sprintf(_("Can't rename the server '%s' to '%s', the server contains this zone."),$old,$new);
}
if($ldap->count()){
$message[] = sprintf(_("Can't rename '%s' to '%s',the destination name already exists."),$device['OrigCn'],$cn);
}
-
+
if(!is_uid($cn)){
$message[] = sprintf(_("Can't rename '%s' to '%s',the destination name contains invalid characters."),$device['OrigCn'],$cn);
}
}
+ /* Check names
+ */
+ if(!isset($names[$device['OBJECT']['cn'][0]])){
+ $names[$device['OBJECT']['cn'][0]] = "";
+ }else{
+ $message[] = sprintf(_("The name '%s' is used more than once."),$device['OBJECT']['cn'][0]);
+ }
+
+ /* Names should be written in lowercase
+ */
+ if(strtolower($device['OBJECT']['cn'][0]) != $device['OBJECT']['cn'][0]){
+ $message[] = sprintf(_("The host name '%s' should be written in lowercase."), $device['OBJECT']['cn'][0]);
+ }
+
/* Check records
*/
$singleEntries = array("cNAMERecord","pTRRecord");
$tmp2 = array();
foreach($device['RECORDS'] as $type => $entries){
-
+
/* Check for multiple use of unique record types
*/
if((in_array($type,$singleEntries)) && (count($entries) > 1)){
}
/* Check for empty / duplicate entries in record array
- */
+ */
$tmp = array();
foreach($entries as $entry){
{
/* Set all initial records to array()
This means they will be removed from the entry
- if they won't be overwritten
+ if they won't be overwritten
*/
foreach($this->InitDevices as $dn => $obj){
$attrs[$dn]= array();
echo $key;
}
}
-
+
/* Rename entries
- !! Terminals / WS / etc will be renamed too
+ !! Terminals / WS / etc will be renamed too
*/
foreach($tmp['rename'] as $old => $new){
$ldap->cat($old);
if($obj != NULL){
/* Both type must be handled different
- * Free / Exists
+ * free / Exists
*/
if($obj["Type"] == "Free"){
$objectName = $obj['OBJECT']['cn'][0];
$objectName = $obj['OrigCn'];
}
-
- /* If type is Free, check
+
+ /* If type is free, check
*/
if($obj['Type'] == "Free"){
if($obj['Type'] == "Free"){
$useDn = $dn2;
}
-
+
if(isset($this->InitDevices[$useDn]['RECORDS']['cNAMERecord'])){
foreach($this->InitDevices[$useDn]['RECORDS']['cNAMERecord'] as $warmal){
$delete['relativeDomainName='.$warmal.','.$useDn] = "";
/* Special handling for ptrrecord
*/
if($type == "pTRRecord"){
-
+
$useDn = $dn;
if($obj['Type'] == "Free"){
$useDn = $dn2;
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index f67504caeea04325ff1502cf997052adb8fa5a48..47a221067c92a1d7018b05286ad8aade4513a821 100644 (file)
if(array_key_exists('config', $_SESSION) &&
array_key_exists('SERVERS', $_SESSION['config']->data) &&
- array_key_exists('FON', $_SESSION['config']->data['SERVERS'])) {
+ array_key_exists('FON', $_SESSION['config']->data['SERVERS']) &&
+ is_callable("mysql_pconnect")) {
// Get Configuration for Mysql database Server
$a_SETUP = $_SESSION['config']->data['SERVERS']['FON'];
$s_parameter ="";
return false;
}
}
+ }else{
+ print_red(_("Can't remove phone account, the mysql extension is not present in php configuration."));
+ return false;
}
/* unset macro attr, it will cause an error */
$this->attrs['telephoneNumber']= array();
}
+
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ldap->search("(objectClass=goFonQueue)", array("member"));
/* Optionally execute a command after we're done */
@mysql_close($r_con);
+ echo "was successfull";
$this->handle_post_events('remove');
}