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