示例#1
0
文件: user.php 项目: pshreez/PHP
 function delete()
 {
     $id = F3::get('PARAMS["id"]');
     $user = new Axon('tbl_user');
     $user->load(array("id=:id", array(":id" => $id)));
     $user->erase();
     F3::reroute('/admin');
 }
示例#2
0
    }
    try {
        $rsp = $facebook->api($user->fl_id . '/members/' . $id, 'DELETE');
    } catch (FacebookApiException $e) {
        // For some reason, this is the error Facebook throws if a
        // Friendlist does not exist. Idiots...
        if ($e != 'OAuthException: (#297) Requires extended permission: manage_friendlists') {
            F3::error('500');
        } else {
            $user->fl_id = '';
            $user->save();
        }
    }
    $followed = new Axon('followed');
    $followed->load(array('fb_id=:fb_id AND user_id=:user_id', array(':fb_id' => $id, ':user_id' => $user->id)));
    $followed->erase();
    die(json_encode(array('success' => true)));
});
/****************************************************************************/
/* Ajax Feeds ***************************************************************/
/****************************************************************************/
/* Settings *****************************************************************/
F3::route('GET /settings', function () {
    $facebook = F3::get('Facebook');
    $uid = $facebook->getUser();
    if (!$uid) {
        _force_logout();
    }
    $user = new Axon('user');
    $user->load(array('fb_id=:fb_id', array(':fb_id' => $uid)));
    if ($user->dry()) {
示例#3
0
<?php

if (F3::get('SESSION.user')) {
    $kul = new Axon('kul');
    // Delete record from database
    $kul->load('tc="{@PARAMS.tc}"');
    $kul->erase();
    // Return to home page
    F3::reroute('/');
} else {
    // Render blog.htm template
    F3::set('pagetitle', 'Kullanıcıyı sil');
    F3::set('template', 'kul');
    F3::call('render');
}
示例#4
0
文件: db.php 项目: simonfork/phpmark
 /**
 		Custom session handler
 			@param $table string
 			@public
 	**/
 function session($table = 'sessions')
 {
     $self = $this;
     session_set_save_handler(function ($path, $name) use($self, $table) {
         // Support these engines
         $cmd = array('sqlite2?' => 'SELECT name FROM sqlite_master ' . 'WHERE type=\'table\' AND name=\'' . $table . '\';', 'mysql|mssql|sybase|dblib|pgsql' => 'SELECT table_name FROM information_schema.tables ' . 'WHERE ' . (preg_match('/pgsql/', $self->backend) ? 'table_catalog' : 'table_schema') . '=\'' . $self->dbname . '\' AND ' . 'table_name=\'' . $table . '\'');
         foreach ($cmd as $backend => $val) {
             if (preg_match('/' . $backend . '/', $self->backend)) {
                 break;
             }
         }
         $result = $self->exec($val, NULL);
         if (!$result) {
             // Create SQL table
             $self->exec('CREATE TABLE ' . (preg_match('/sqlite2?/', $self->backend) ? '' : $self->dbname . '.') . $table . ' (' . 'id VARCHAR(40),' . 'data LONGTEXT,' . 'stamp INTEGER' . ');');
         }
         register_shutdown_function('session_commit');
         return TRUE;
     }, function () {
         return TRUE;
     }, function ($id) use($table) {
         $axon = new Axon($table);
         $axon->load(array('id=:id', array(':id' => $id)));
         return $axon->dry() ? FALSE : $axon->data;
     }, function ($id, $data) use($table) {
         $axon = new Axon($table);
         $axon->load(array('id=:id', array(':id' => $id)));
         $axon->id = $id;
         $axon->data = $data;
         $axon->stamp = time();
         $axon->save();
         return TRUE;
     }, function ($id) use($table) {
         $axon = new Axon($table);
         $axon->erase(array('id=:id', array(':id' => $id)));
         return TRUE;
     }, function ($max) use($table) {
         $axon = new Axon($table);
         $axon->erase('stamp+' . $max . '<' . time());
         return TRUE;
     });
 }
示例#5
0
文件: SavedForm.php 项目: pshreez/PHP
 function deleteForm()
 {
     if (!F3::get('SESSION.onlineUser')) {
         F3::reroute("/");
     }
     $id = F3::get("PARAMS.id");
     $vehicle = new Axon('vehicle');
     if ($vehicle->found(array('id =:id', array(':id' => $id)))) {
         $vehicle->load(array('id =:id', array(':id' => $id)));
         $vehicle->erase();
         F3::reroute('/');
     } else {
         F3::reroute('/');
     }
 }
示例#6
0
文件: operator.php 项目: pshreez/PHP
 function dismissNamsari()
 {
     if (!F3::get('SESSION.asid')) {
         F3::reroute("/admin");
     }
     $id = F3::get("PARAMS.id");
     $vrs = new Axon("vehicle");
     $vrs->load(array("id=:id", array(":id" => $id)));
     $zone = Admin::getZone($vrs->zone_id);
     $symbol = Admin::getSymbolType($vrs->vehicle_symbol_type);
     $vehicleNo = $zone . $vrs->lot_number . $symbol . $vrs->number;
     AdminLog::add($vehicleNo, $vrs->form_type, "dismissed");
     $vrs->erase();
     F3::reroute("/admin/ownershipTransfer/s");
 }