예제 #1
0
 /**
  * Our special implementation of the PHP SDK allows us
  * to control when/if the $_SESSION is used to store
  * session data. When $use_session is false, FB session
  * data is instead stored in WP options, allowing the
  * keys to be shared between users, and more relevantly,
  * by scheduled events.
  */
 public function __construct($config, $use_session = true)
 {
     $this->use_session = $use_session;
     parent::__construct($config);
     /*
     if (!$this->use_session && ($access_token = $this->getUserAccessToken(true))) {
       if (!$this->getPersistentData('token_extended')) {
         $access_token = self::api('/oauth/access_token', 'POST', array(
           'client_id' => $this->getAppId(),
           'client_secret' => $this->getAppSecret(),
           'grant_type' => 'fb_exchange_token',
           'fb_exchange_token' => $access_token
         ));
         SharePress::log($access_token, 'WARN');
       }
     }
     */
 }
예제 #2
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!defined('ABSPATH')) {
    exit;
}
// we depend on this...
require 'lib/facebook.php';
// we don't care about certificate verification
SpBaseFacebook::$CURL_OPTS = SpBaseFacebook::$CURL_OPTS + array(CURLOPT_SSL_VERIFYPEER => false);
// override this in functions.php
@define('SHAREPRESS_DEBUG', false);
class Sharepress
{
    const VERSION = '2.2.31';
    const MISSED_SCHEDULE_DELAY = 5;
    const MISSED_SCHEDULE_OPTION = 'sharepress_missed_schedule';
    const MAX_RETRIES = 3;
    const OPTION_API_KEY = 'sharepress_api_key';
    const OPTION_APP_SECRET = 'sharepress_app_secret';
    const OPTION_PUBLISHING_TARGETS = 'sharepress_publishing_targets';
    const OPTION_NOTIFICATIONS = 'sharepress_notifications';
    const OPTION_DEFAULT_PICTURE = 'sharepress_default_picture';
    const OPTION_SETTINGS = 'sharepress_settings';
    const OPTION_SESSION_ARG = 'sharepress_%s';