Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 40 lines (36 sloc) 1.769 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?php
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/
// Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/

    include_once("config.php");
    require_once 'class/GoogleContactImport.class.php';

    $gci_contact = new GoogleContactImport();
    $gci_contact->id_user = $_SESSION['do_User']->iduser;

    if(isset($_SESSION['sessionToken'])){
            //$gci_contact->uEmail = $_POST['email'];
            $gci_contact->processAuth();
            $gci_contact->syncOfuzToGmail();
            if($gci_contact->status_code_desc == ""){
                $status_code_desc = $gci_contact->getStatusDescription(208);
            } else{
                $status_code_desc = $gci_contact->status_code_desc;
            }
            header("Location:sync.php?msg=".$status_code_desc);
    }
    else if($_POST['action']=="export"){
            $gci_contact->uEmail = $_POST['email'];
             $gci_contact->processAuth();
    }
    else if(isset($_GET['token']) && isset($_SESSION["uEmail"]))
    {
            //$gci_contact->uEmail = $_POST['email'];
            $gci_contact->processAuth();
            $gci_contact->syncOfuzToGmail();
            if($gci_contact->status_code_desc == ""){
                $status_code_desc = $gci_contact->getStatusDescription(208);
            } else{
                $status_code_desc = $gci_contact->status_code_desc;
            }
            header("Location:sync.php?msg=".$status_code_desc);
    }

?>
Something went wrong with that request. Please try again.