Typecho Sina Login Plugin Sinauth

Source: Internet
Author: User
It took a little time to get a plugin.

Code Address: Https://github.com/web3d/plugins/tree/master/Sinauth

Typecho extension mechanism is still relatively complete, you can increase the action, Route, extension of existing widget functions, background plug-in configuration interface and so on.

Lazy, using the SDK packaged in the SAE to access Sina open platform data.

The plugin is placed in the/root_path/usr/plugins/sinauth directory:

Plugin.phpAuthorizeAction.php

Plugin.php is used for plug-in initialization and authorizeaction.php for extended functionality.


  ___sinauthauthorizeicon = Array (' Sinauth_plugin ', ' Authorizeicon ');        Helper::addaction (' sinauthauthorize ', ' sinauth_authorizeaction ');        Helper::addroute (' sinauthauthorize ', '/sinauthauthorize/', ' sinauth_authorizeaction ', ' action ');                Helper::addroute (' Sinauthcallback ', '/sinauthcallback/', ' sinauth_authorizeaction ', ' callback '); Return _t ($meg.    Please proceed '); public static function install () {//db Create}/** * Get plugin configuration Panel * * @access public * @ param typecho_widget_helper_form $form configuration panel * @return void */public static function config (typecho_widget_help Er_form $form) {$client _id = new Typecho_widget_helper_form_element_text (' client_id ', NULL, ' ', _t (' App Key '), ' please        View Http://open.weibo.com ' on Weibo open platform);                $form->addinput ($client _id); $client _secret = new Typecho_widget_helper_form_element_text (' Client_secret ', NULL, ' ', _t (' App secret '), '        Please view http://open.weibo.com ' on Weibo open platform.$form->addinput ($client _secret); $callback _url = new Typecho_widget_helper_form_element_text (' Callback_url ', NULL, ' http//', _t (' Callback address '), '        Please set the same in the Weibo open platform);            $form->addinput ($callback _url); }}
class Sinauth_AuthorizeAction extends Typecho_Widget implements Widget_Interface_Do{    public function action(){            }    public function callback(){            }}

Where you need to put your mouth, add


  
   user->sinauthAuthorizeIcon(); ?>

The above describes the Typecho Sina Landing plugin Sinauth, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.