Skip to content

Commit

Permalink
account admin prefix #972
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Aug 31, 2016
1 parent 77418ad commit 280e87f
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 47 deletions.
3 changes: 1 addition & 2 deletions envs/dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
"luya\\" : "../../core/",
"luya\\admin\\" : "../../modules/admin/src",
"luya\\cms\\" : "../../modules/cms/",
"luya\\account\\" : "../../modules/account",

"newsadmin\\" : "../../modules/newsadmin",
"news\\" : "../../modules/news/src",
"account\\" : "../../modules/account",
"accountadmin\\" : "../../modules/accountadmin",
"errorapi\\" : "../../modules/errorapi/src",
"gallery\\" : "../../modules/gallery",
"galleryadmin\\" : "../../modules/galleryadmin",
Expand Down
3 changes: 1 addition & 2 deletions envs/kickstarter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"require": {
"luyadev/luya-core" : "^1.0@dev",
"luyadev/luya-module-admin" : "^1.0@dev",
"luyadev/luya-module-cms" : "^1.0@dev",
"luyadev/luya-module-cmsadmin" : "^1.0@dev"
"luyadev/luya-module-cms" : "^1.0@dev"
},
"require-dev": {
"yiisoft/yii2-gii" : "^2.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/account/RegisterInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace account;
namespace luya\account;

interface RegisterInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace accountadmin;
namespace luya\account\admin;

class Module extends \luya\admin\base\Module
{
public $apis = [
'api-account-user' => 'accountadmin\apis\UserController',
'api-account-user' => 'luya\account\admin\apis\UserController',
];

public function getMenu()
Expand Down
8 changes: 8 additions & 0 deletions modules/account/admin/apis/UserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace luya\account\admin\apis;

class UserController extends \luya\admin\ngrest\base\Api
{
public $modelClass = 'luya\account\models\User';
}
8 changes: 8 additions & 0 deletions modules/account/admin/controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace luya\account\admin\controllers;

class UserController extends \luya\admin\ngrest\base\Controller
{
public $modelClass = '\luya\account\models\User';
}
2 changes: 1 addition & 1 deletion modules/account/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"autoload" : {
"psr-4" : {
"account\\" : ""
"luya\\account\\" : ""
}
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace account;
namespace luya\account\frontend;

use Yii;

Expand All @@ -16,12 +16,12 @@ class Module extends \luya\base\Module
]],
];

public $userIdentity = '\account\components\User';
public $userIdentity = '\luya\account\frontend\components\User';

/**
* @var string defined your custom RegisterForm validation model must impelement `account\RegisterInterface`.
*/
public $registerFormClass = 'account\models\RegisterForm';
public $registerFormClass = 'luya\account\models\RegisterForm';

/**
* @var boolean Whether the email must be confirmet on registration with an activation link (double opt-in) or not.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace account\base;
namespace luya\account\frontend\base;

use Yii;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

namespace account\base;
namespace luya\account\frontend\base;

use Yii;
use luya\account\RegisterInterface;

abstract class RegisterForm extends \yii\base\Model implements \account\RegisterInterface
abstract class RegisterForm extends \yii\base\Model implements RegisterInterface
{
private $_model = null;

protected $modelClass = 'accountadmin\models\User';
protected $modelClass = 'luya\account\models\User';

protected $modelScenario = 'register';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace account\components;
namespace luya\account\frontend\components;

class User extends \yii\web\User
{
public $identityClass = '\accountadmin\models\User';
public $identityClass = '\luya\account\models\User';

public $loginUrl = ['/account/login/default'];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

namespace account\controllers;
namespace luya\account\frontend\controllers;

use Yii;
use account\models\LoginForm;
use luya\account\models\LoginForm;
use luya\helpers\Url;
use luya\account\frontend\base\Controller;

class DefaultController extends \account\base\Controller
class DefaultController extends Controller
{
public function getRules()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

namespace account\controllers;
namespace luya\account\frontend\controllers;

use Yii;
use Exception;
use luya\helpers\Url;
use luya\account\frontend\base\Controller;

class RegisterController extends \account\base\Controller
class RegisterController extends Controller
{
public function getRules()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

namespace account\controllers;
namespace luya\account\frontend\controllers;

class SettingsController extends \account\base\Controller
use luya\account\frontend\base\Controller;

class SettingsController extends Controller
{
public function actionIndex()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace account\properties;
namespace luya\account\frontend\properties;

use Yii;
use luya\cms\helpers\Url;
use luya\admin\base\Property;

class IsProtectedAreaProperty extends \admin\base\Property
class IsProtectedAreaProperty extends Property
{
public function init()
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions modules/account/models/LoginForm.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace account\models;
namespace luya\account\models;

class LoginForm extends \yii\base\Model
{
Expand Down Expand Up @@ -42,7 +42,7 @@ public function login()
public function getUser()
{
if ($this->_user === false) {
$this->_user = \accountadmin\models\User::findByEmail($this->email);
$this->_user = User::findByEmail($this->email);
}

return $this->_user;
Expand Down
2 changes: 1 addition & 1 deletion modules/account/models/RegisterForm.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace account\models;
namespace luya\account\models;

class RegisterForm extends \account\base\RegisterForm
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace accountadmin\models;
namespace luya\account\models;

use Yii;
use luya\admin\ngrest\base\NgRestModel;

class User extends \luya\admin\ngrest\base\NgRestModel implements \yii\web\IdentityInterface
class User extends NgRestModel implements \yii\web\IdentityInterface
{
public $password_confirm = null;

Expand Down
8 changes: 0 additions & 8 deletions modules/accountadmin/apis/UserController.php

This file was deleted.

8 changes: 0 additions & 8 deletions modules/accountadmin/controllers/UserController.php

This file was deleted.

0 comments on commit 280e87f

Please sign in to comment.