mirror of
https://github.com/elyby/accounts.git
synced 2024-11-09 06:02:39 +05:30
В oauth приложения добавлено Ely.by
This commit is contained in:
parent
c37d4135fd
commit
3e4573027c
32
console/migrations/m160808_191142_ely_by_app.php
Normal file
32
console/migrations/m160808_191142_ely_by_app.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use console\db\Migration;
|
||||||
|
|
||||||
|
class m160808_191142_ely_by_app extends Migration {
|
||||||
|
|
||||||
|
public function safeUp() {
|
||||||
|
$exists = $this->db->createCommand('
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM {{%oauth_clients}}
|
||||||
|
WHERE id = "ely"
|
||||||
|
LIMIT 1
|
||||||
|
')->queryScalar();
|
||||||
|
|
||||||
|
if (!$exists) {
|
||||||
|
$this->insert('{{%oauth_clients}}', [
|
||||||
|
'id' => 'ely',
|
||||||
|
'secret' => 'change_this_on_production',
|
||||||
|
'name' => 'Ely.by',
|
||||||
|
'description' => '',
|
||||||
|
'redirect_uri' => 'http://ely.by/authorization/oauth',
|
||||||
|
'is_trusted' => 1,
|
||||||
|
'created_at' => time(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function safeDown() {
|
||||||
|
$this->delete('{{%oauth_clients}}', ['id' => 'ely']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user