コード例 #1
0
ファイル: opCalendarOAuth.php プロジェクト: te-koyama/openpne
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
 public function validateId($validator, $values, $arguments = array())
 {
     if (opCalendarOAuth::getInstance()->isAlreadyUsedCalendarId($this->member)) {
         throw new sfValidatorError($validator, 'This calendar is used other SNS Member.');
     }
     return $values;
 }
コード例 #3
0
 protected function execute($arguments = array(), $options = array())
 {
     new sfDatabaseManager($this->configuration);
     if (!opConfig::get('op_calendar_google_data_api_auto_update', false)) {
         throw new sfException('This task is not allowed. Please allow from "pc_backend.php/opCalendarPlugin" setting.');
     }
     $crons = opCalendarPluginToolkit::getAllGoogleCalendarCronConfig();
     if (!count($crons)) {
         $this->logSection('end', 'No cron data');
         return true;
     }
     $this->opCalendarOAuth = opCalendarOAuth::getInstance();
     $this->logSection('prepared', 'start update');
     foreach ($crons as $cron) {
         $this->updateMemberSchedule($cron, (int) $options['interval']);
     }
 }
コード例 #4
0
ファイル: indexSuccess.php プロジェクト: te-koyama/openpne
use_helper('opCalendar');
?>
<div class="dparts monthlyCalendarTable"><div class="parts">
<div class="partsHeading"><h3><?php 
$is_community ? printf('[%s] ', $community->name) : '';
echo format_number_choice('[0]%ym%|[1]%ym% of %f%', array('%ym%' => op_format_date(mktime(0, 0, 0, $ym['month_disp'], 1, $ym['year_disp']), 'XCalendarMonth'), '%f%' => $member->name), $is_community ? 1 : $isSelf ? 0 : 1);
?>
</h3></div>

<?php 
if (!$is_community && $isSelf && opConfig::get('op_calendar_google_data_api_is_active', false)) {
    ?>
<div class="block topBox">
<p class="note_schedule">
<?php 
    if (opCalendarOAuth::getInstance()->authenticate()) {
        ?>
&nbsp;<?php 
        echo link_to(__('Add schedule to Google Calendar'), '@calendar_api_import');
        ?>
&nbsp;(<?php 
        echo link_to(__('Revoke Google calendar OAuth key'), '@member_config?category=schedule');
        ?>
)
<?php 
    } else {
        ?>
&nbsp;<?php 
        echo link_to(__('Enable to Google Calendar\'s permission settings'), '@calendar_api');
    }
    ?>
コード例 #5
0
 private function isOAuthAuthenticate()
 {
     $this->opCalendarOAuth = opCalendarOAuth::getInstance();
     return $this->opCalendarOAuth->authenticate($this->member);
 }
コード例 #6
0
ファイル: actions.class.php プロジェクト: te-koyama/openpne
 public function preExecute()
 {
     $this->forward404Unless(opConfig::get('op_calendar_google_data_api_is_active', false));
     $this->opCalendarOAuth = opCalendarOAuth::getInstance();
 }