mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 05:31:58 +01:00
google fixes
This commit is contained in:
parent
2c7e4ac3eb
commit
18dff068df
@ -327,7 +327,7 @@ create index `audit_idx5` on `audit`(`domain`);
|
|||||||
|
|
||||||
|
|
||||||
create table if not exists `google` (
|
create table if not exists `google` (
|
||||||
`id` bigint unsigned not null primary key,
|
`id` char(32) not null primary key,
|
||||||
`email` char(128) not null unique,
|
`email` char(128) not null unique,
|
||||||
`access_token` char(255) default null,
|
`access_token` char(255) default null,
|
||||||
`refresh_token` char(255) default null,
|
`refresh_token` char(255) default null,
|
||||||
@ -336,7 +336,7 @@ create table if not exists `google` (
|
|||||||
|
|
||||||
|
|
||||||
create table if not exists `google_imap` (
|
create table if not exists `google_imap` (
|
||||||
`id` bigint unsigned not null,
|
`id` char(32) not null primary key,
|
||||||
`email` char(128) not null,
|
`email` char(128) not null,
|
||||||
`last_msg_id` bigint default 0,
|
`last_msg_id` bigint default 0,
|
||||||
key(`email`)
|
key(`email`)
|
||||||
|
@ -26,3 +26,6 @@ alter table ldap add column ldap_account_objectclass varchar(128) default null;
|
|||||||
alter table ldap add column ldap_distributionlist_attr varchar(128) default null;
|
alter table ldap add column ldap_distributionlist_attr varchar(128) default null;
|
||||||
alter table ldap add column ldap_distributionlist_objectclass varchar(128) default null;
|
alter table ldap add column ldap_distributionlist_objectclass varchar(128) default null;
|
||||||
|
|
||||||
|
alter table google change column id id char(32) not null primary key;
|
||||||
|
alter table google_imap change column id id char(32) not null primary key;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
ini_set("session.save_path", "/tmp");
|
||||||
|
|
||||||
$webuidir = "";
|
$webuidir = "";
|
||||||
|
|
||||||
if(isset($_SERVER['argv'][1])) { $webuidir = $_SERVER['argv'][1]; }
|
if(isset($_SERVER['argv'][1])) { $webuidir = $_SERVER['argv'][1]; }
|
||||||
|
|
||||||
require_once($webuidir . "/config.php");
|
require_once($webuidir . "/config.php");
|
||||||
|
|
||||||
ini_set("session.save_path", DIR_TMP);
|
|
||||||
|
|
||||||
require(DIR_SYSTEM . "/startup.php");
|
require(DIR_SYSTEM . "/startup.php");
|
||||||
|
|
||||||
require_once 'Zend/Mail/Protocol/Imap.php';
|
require_once 'Zend/Mail/Protocol/Imap.php';
|
||||||
|
@ -12,14 +12,6 @@ class ModelUserGoogle extends Model {
|
|||||||
$user = $query->row;
|
$user = $query->row;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
|
||||||
[id] => 11731982531819289345
|
|
||||||
[email] => bela@bacsi.hu
|
|
||||||
[verified_email] => 1
|
|
||||||
[name] => Bela Bacsi
|
|
||||||
[given_name] => Bela
|
|
||||||
[family_name] => Bacsi
|
|
||||||
*/
|
|
||||||
|
|
||||||
$d = explode('@', $google_account['email']);
|
$d = explode('@', $google_account['email']);
|
||||||
|
|
||||||
@ -57,8 +49,8 @@ class ModelUserGoogle extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function update_tokens($email = '', $id = 0, $token = array()) {
|
public function update_tokens($email = '', $id = '', $token = array()) {
|
||||||
if($email == '') { return 0; }
|
if($email == '' || $id == '') { return 0; }
|
||||||
|
|
||||||
$query = $this->db->query("SELECT email FROM " . TABLE_GOOGLE . " WHERE email=?", array($email));
|
$query = $this->db->query("SELECT email FROM " . TABLE_GOOGLE . " WHERE email=?", array($email));
|
||||||
|
|
||||||
@ -70,16 +62,6 @@ class ModelUserGoogle extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->db->countAffected();
|
return $this->db->countAffected();
|
||||||
|
|
||||||
/*
|
|
||||||
[access_token] => ya29.AHES6ZSavh4CnWXyfAYRNwqqZ3FmZ-bHPZkWIEPlutG6K_E
|
|
||||||
[token_type] => Bearer
|
|
||||||
[expires_in] => 3600
|
|
||||||
[refresh_token] => 1/J7bwdfCfQkjCu3Q51ypdJeGOzOtw6F1uyg1vaAwOZ2Q
|
|
||||||
[created] => 1348415267
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
function is_mobile_device() {
|
function is_mobile_device() {
|
||||||
|
|
||||||
if(!isset($_SERVER['HTTP_USER_AGENT'])) { return 0; }
|
if(!isset($_SERVER['HTTP_USER_AGENT'])) { define('OUTLOOK', 0); return 0; }
|
||||||
|
|
||||||
if(strstr($_SERVER['HTTP_USER_AGENT'], "Microsoft Outlook")) { define('OUTLOOK', 1); } else { define('OUTLOOK', 0); }
|
if(strstr($_SERVER['HTTP_USER_AGENT'], "Microsoft Outlook")) { define('OUTLOOK', 1); } else { define('OUTLOOK', 0); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user