mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 07:02:00 +01:00
adding new domain fix
This commit is contained in:
parent
900f7df86d
commit
fbdefb8254
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define('BUILD', '2013-10-24 846');
|
||||||
|
|
||||||
$config = array();
|
$config = array();
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,21 +100,24 @@ class ModelDomainDomain extends Model {
|
|||||||
if($domain == "" || $mapped == "") { return 0; }
|
if($domain == "" || $mapped == "") { return 0; }
|
||||||
|
|
||||||
$query = $this->db->query("INSERT INTO " . TABLE_DOMAIN . " (domain, mapped, ldap_id) VALUES (?,?,?)", array($mapped, $mapped, $ldap_id));
|
$query = $this->db->query("INSERT INTO " . TABLE_DOMAIN . " (domain, mapped, ldap_id) VALUES (?,?,?)", array($mapped, $mapped, $ldap_id));
|
||||||
|
$rc = $this->db->countAffected();
|
||||||
|
if($rc == 1) {
|
||||||
|
LOGGER("add domain: $domain (rc=$rc)");
|
||||||
|
}
|
||||||
|
|
||||||
$domains = explode("\n", $domain);
|
$domains = explode("\n", $domain);
|
||||||
|
|
||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
$domain = rtrim($domain);
|
$domain = rtrim($domain);
|
||||||
$query = $this->db->query("INSERT INTO " . TABLE_DOMAIN . " (domain, mapped, ldap_id) VALUES (?,?,?)", array($domain, $mapped, $ldap_id));
|
if($domain != $mapped) {
|
||||||
|
$query = $this->db->query("INSERT INTO " . TABLE_DOMAIN . " (domain, mapped, ldap_id) VALUES (?,?,?)", array($domain, $mapped, $ldap_id));
|
||||||
|
$rc = $this->db->countAffected();
|
||||||
|
|
||||||
$rc = $this->db->countAffected();
|
LOGGER("add domain: $domain (rc=$rc)");
|
||||||
|
}
|
||||||
LOGGER("add domain: $domain (rc=$rc)");
|
|
||||||
|
|
||||||
if($rc != 1){ return 0; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return $rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user