cleanup and debug of atoken feature

This commit is contained in:
redmatrix 2016-07-15 01:33:28 -07:00
parent f666d8a083
commit 5e475acb85
3 changed files with 12 additions and 4 deletions

View File

@ -138,7 +138,7 @@ class Settings extends \Zotlabs\Web\Controller {
return; return;
} }
if($atoken_id) { if($atoken_id) {
$r = q("update atoken set atoken_name = '%s', atoken_token = '%s' atoken_expire = '%s' $r = q("update atoken set atoken_name = '%s', atoken_token = '%s' atoken_expires = '%s'
where atoken_id = %d and atoken_uid = %d", where atoken_id = %d and atoken_uid = %d",
dbesc($name), dbesc($name),
dbesc($token), dbesc($token),
@ -148,7 +148,7 @@ class Settings extends \Zotlabs\Web\Controller {
); );
} }
else { else {
$r = q("insert into atoken ( atoken_aid, atoken_uid, atoken_name, atoken_token, atoken_expire ) $r = q("insert into atoken ( atoken_aid, atoken_uid, atoken_name, atoken_token, atoken_expires )
values ( %d, %d, '%s', '%s', '%s' ) ", values ( %d, %d, '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']), intval($channel['channel_account_id']),
intval($channel['channel_id']), intval($channel['channel_id']),

View File

@ -2039,3 +2039,11 @@ dl.bb-dl > dd > li {
border-style: solid; border-style: solid;
border-width: 5px; border-width: 5px;
} }
.atoken-list {
margin-right: 5px;
list-style-type: none;
}
.atoken-list li {
margin-bottom: 8px;
}

View File

@ -17,9 +17,9 @@
</form> </form>
{{if $tokens}} {{if $tokens}}
<div> <div>
<ul> <ul class="atoken-list">
{{foreach $tokens as $t}} {{foreach $tokens as $t}}
<li><a href="settings/tokens/{{$t.atoken_id}}">{{$t.atoken_name}}</a> <a href="settings/tokens/{{$t.atoken_id}}/drop"><i class="fa fa-remove btn btn-xs btn-default pull-right"></i></a></li> <li><span class="pull-right atoken-drop"><a href="settings/tokens/{{$t.atoken_id}}/drop"><i class="fa fa-trash btn btn-xs btn-default"></i></a></span><a href="settings/tokens/{{$t.atoken_id}}">{{$t.atoken_name}}</a></li>
{{/foreach}} {{/foreach}}
</ul> </ul>
</div> </div>