[Web] Fix init_db, init json when attributes are null
[Web] Do not fail when _sogo_static_view fails to updatemaster
parent
784beb112c
commit
77ce1bf43a
|
@ -1026,10 +1026,15 @@ if (php_sapi_name() == "cli") {
|
||||||
$res = $stmt->fetch(PDO::FETCH_ASSOC);
|
$res = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if (intval($res['OK_C']) === 2) {
|
if (intval($res['OK_C']) === 2) {
|
||||||
// Be more precise when replacing into _sogo_static_view, col orders may change
|
// Be more precise when replacing into _sogo_static_view, col orders may change
|
||||||
$stmt = $pdo->query("REPLACE INTO _sogo_static_view (`c_uid`, `domain`, `c_name`, `c_password`, `c_cn`, `mail`, `aliases`, `ad_aliases`, `kind`, `multiple_bookings`)
|
try {
|
||||||
SELECT `c_uid`, `domain`, `c_name`, `c_password`, `c_cn`, `mail`, `aliases`, `ad_aliases`, `kind`, `multiple_bookings` from sogo_view");
|
$stmt = $pdo->query("REPLACE INTO _sogo_static_view (`c_uid`, `domain`, `c_name`, `c_password`, `c_cn`, `mail`, `aliases`, `ad_aliases`, `kind`, `multiple_bookings`)
|
||||||
$stmt = $pdo->query("DELETE FROM _sogo_static_view WHERE `c_uid` NOT IN (SELECT `username` FROM `mailbox` WHERE `active` = '1');");
|
SELECT `c_uid`, `domain`, `c_name`, `c_password`, `c_cn`, `mail`, `aliases`, `ad_aliases`, `kind`, `multiple_bookings` from sogo_view");
|
||||||
echo "Fixed _sogo_static_view" . PHP_EOL;
|
$stmt = $pdo->query("DELETE FROM _sogo_static_view WHERE `c_uid` NOT IN (SELECT `username` FROM `mailbox` WHERE `active` = '1');");
|
||||||
|
echo "Fixed _sogo_static_view" . PHP_EOL;
|
||||||
|
}
|
||||||
|
catch ( Exception $e ) {
|
||||||
|
// Dunno
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$m = new Memcached();
|
$m = new Memcached();
|
||||||
|
|
Loading…
Reference in New Issue