-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtoken.php
More file actions
21 lines (13 loc) · 694 Bytes
/
Copy pathtoken.php
File metadata and controls
21 lines (13 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
require 'library/Sandbox.php';
if( ! AF::registry()->user ) { header( 'Location: ' . WEB_URL . '/' ); die; }
$delete = (isset($_GET['delete'])) ? true : false;
$id = (isset($_GET['id'])) ? (int) $_GET['id'] : NULL;
if( ! $id ) { header( 'Location: ' . WEB_URL . '/' ); die; }
$access_token_table = new ApiAccessToken_Table();
$access_token = $access_token_table->get( $id, AF::DELAY_SAFE );
if( $access_token->userid != AF::registry()->user->id ) { header( 'Location: ' . WEB_URL . '/' ); die; }
if( $delete ) {
$access_token_table->query('DELETE FROM :table WHERE :primary = ?' , $access_token->id, AF::NO_DELAY );
}
header( 'Location: ' . WEB_URL . '/' );