Show global key and secret, if defined, in Twitter bridge admin panel
This commit is contained in:
parent
9342e6f818
commit
ecccb344e0
@ -88,15 +88,15 @@ class TwitterBridgePlugin extends Plugin
|
|||||||
|
|
||||||
static function hasKeys()
|
static function hasKeys()
|
||||||
{
|
{
|
||||||
$key = common_config('twitter', 'consumer_key');
|
$ckey = common_config('twitter', 'consumer_key');
|
||||||
$secret = common_config('twitter', 'consumer_secret');
|
$csecret = common_config('twitter', 'consumer_secret');
|
||||||
|
|
||||||
if (empty($key) && empty($secret)) {
|
if (empty($ckey) && empty($csecret)) {
|
||||||
$key = common_config('twitter', 'global_consumer_key');
|
$ckey = common_config('twitter', 'global_consumer_key');
|
||||||
$secret = common_config('twitter', 'global_consumer_secret');
|
$csecret = common_config('twitter', 'global_consumer_secret');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($key) && !empty($secret)) {
|
if (!empty($ckey) && !empty($csecret)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,6 +115,8 @@ class TwitterBridgePlugin extends Plugin
|
|||||||
|
|
||||||
function onRouterInitialized($m)
|
function onRouterInitialized($m)
|
||||||
{
|
{
|
||||||
|
$m->connect('admin/twitter', array('action' => 'twitteradminpanel'));
|
||||||
|
|
||||||
if (self::hasKeys()) {
|
if (self::hasKeys()) {
|
||||||
$m->connect(
|
$m->connect(
|
||||||
'twitter/authorization',
|
'twitter/authorization',
|
||||||
@ -133,8 +135,6 @@ class TwitterBridgePlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$m->connect('admin/twitter', array('action' => 'twitteradminpanel'));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +225,49 @@ class TwitterAdminPanelForm extends AdminForm
|
|||||||
);
|
);
|
||||||
$this->unli();
|
$this->unli();
|
||||||
|
|
||||||
|
$globalConsumerKey = common_config('twitter', 'global_consumer_key');
|
||||||
|
$globalConsumerSec = common_config('twitter', 'global_consumer_secret');
|
||||||
|
|
||||||
|
if (!empty($globalConsumerKey)) {
|
||||||
|
$this->li();
|
||||||
|
$this->out->element(
|
||||||
|
'label',
|
||||||
|
array('for' => 'global_consumer_key'),
|
||||||
|
''
|
||||||
|
);
|
||||||
|
$this->out->element(
|
||||||
|
'input',
|
||||||
|
array(
|
||||||
|
'name' => 'global_consumer_key',
|
||||||
|
'type' => 'text',
|
||||||
|
'id' => 'global_consumer_key',
|
||||||
|
'value' => $globalConsumerKey,
|
||||||
|
'disabled' => 'true'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->out->element('p', 'form_guide', _('Global consumer key'));
|
||||||
|
$this->unli();
|
||||||
|
|
||||||
|
$this->li();
|
||||||
|
$this->out->element(
|
||||||
|
'label',
|
||||||
|
array('for' => 'global_consumer_secret'),
|
||||||
|
''
|
||||||
|
);
|
||||||
|
$this->out->element(
|
||||||
|
'input',
|
||||||
|
array(
|
||||||
|
'name' => 'global_consumer_secret',
|
||||||
|
'type' => 'text',
|
||||||
|
'id' => 'global_consumer_secret',
|
||||||
|
'value' => $globalConsumerSec,
|
||||||
|
'disabled' => 'true'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->out->element('p', 'form_guide', _('Global consumer secret'));
|
||||||
|
$this->unli();
|
||||||
|
}
|
||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->input(
|
$this->input(
|
||||||
'source',
|
'source',
|
||||||
|
Loading…
Reference in New Issue
Block a user