diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-21 15:20:10 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-21 15:20:10 +0100 |
commit | 2b4532c6b91dc38c5af8d703826a1fbf11134a6a (patch) | |
tree | 9cd72e17ae1f7e9d3d9542e1d4163d265c06ea83 | |
parent | 5a4edeea7093aa80bfb71ae9a3063f6b7a0cf067 (diff) | |
parent | d6a63016ae0e14efeefd763a1042c515b60b3f7d (diff) | |
download | nextcloud-server-2b4532c6b91dc38c5af8d703826a1fbf11134a6a.tar.gz nextcloud-server-2b4532c6b91dc38c5af8d703826a1fbf11134a6a.zip |
Merge pull request #21797 from owncloud/proper-controller-in-core
Move controller in core/ to a common subfolder
-rw-r--r-- | core/application.php | 6 | ||||
-rw-r--r-- | core/controller/avatarcontroller.php (renamed from core/avatar/avatarcontroller.php) | 4 | ||||
-rw-r--r-- | core/controller/lostcontroller.php (renamed from core/lostpassword/controller/lostcontroller.php) | 10 | ||||
-rw-r--r-- | core/controller/setupcontroller.php (renamed from core/setup/controller.php) | 4 | ||||
-rw-r--r-- | core/controller/usercontroller.php (renamed from core/user/usercontroller.php) | 2 | ||||
-rw-r--r-- | core/css/lostpassword/resetpassword.css (renamed from core/lostpassword/css/resetpassword.css) | 0 | ||||
-rw-r--r-- | core/lostpassword/css/lostpassword.css | 31 | ||||
-rw-r--r-- | core/templates/lostpassword/email.php (renamed from core/lostpassword/templates/email.php) | 0 | ||||
-rw-r--r-- | core/templates/lostpassword/resetpassword.php (renamed from core/lostpassword/templates/resetpassword.php) | 2 | ||||
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | tests/core/controller/avatarcontrollertest.php (renamed from tests/core/avatar/avatarcontrollertest.php) | 4 | ||||
-rw-r--r-- | tests/core/controller/lostcontrollertest.php (renamed from tests/core/lostpassword/controller/lostcontrollertest.php) | 8 |
12 files changed, 21 insertions, 52 deletions
diff --git a/core/application.php b/core/application.php index bfe79f89938..30376ee4f2e 100644 --- a/core/application.php +++ b/core/application.php @@ -29,9 +29,9 @@ namespace OC\Core; use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\TimeFactory; use \OCP\AppFramework\App; -use OC\Core\LostPassword\Controller\LostController; -use OC\Core\User\UserController; -use OC\Core\Avatar\AvatarController; +use OC\Core\Controller\LostController; +use OC\Core\Controller\UserController; +use OC\Core\Controller\AvatarController; use \OCP\Util; /** diff --git a/core/avatar/avatarcontroller.php b/core/controller/avatarcontroller.php index 8a9219964a5..adfe38ab2db 100644 --- a/core/avatar/avatarcontroller.php +++ b/core/controller/avatarcontroller.php @@ -24,7 +24,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Core\Avatar; +namespace OC\Core\Controller; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; @@ -42,7 +42,7 @@ use OCP\Files\Folder; /** * Class AvatarController * - * @package OC\Core\Avatar + * @package OC\Core\Controller */ class AvatarController extends Controller { diff --git a/core/lostpassword/controller/lostcontroller.php b/core/controller/lostcontroller.php index c9ee8ed2ff5..0e0932b288b 100644 --- a/core/lostpassword/controller/lostcontroller.php +++ b/core/controller/lostcontroller.php @@ -25,7 +25,7 @@ * */ -namespace OC\Core\LostPassword\Controller; +namespace OC\Core\Controller; use \OCP\AppFramework\Controller; use \OCP\AppFramework\Http\TemplateResponse; @@ -45,7 +45,7 @@ use OCP\Security\StringUtils; * * Successfully changing a password will emit the post_passwordReset hook. * - * @package OC\Core\LostPassword\Controller + * @package OC\Core\Controller */ class LostController extends Controller { @@ -122,8 +122,8 @@ class LostController extends Controller { */ public function resetform($token, $userId) { return new TemplateResponse( - 'core/lostpassword', - 'resetpassword', + 'core', + 'lostpassword/resetpassword', array( 'link' => $this->urlGenerator->linkToRouteAbsolute('core.lost.setPassword', array('userId' => $userId, 'token' => $token)), ), @@ -236,7 +236,7 @@ class LostController extends Controller { $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', array('userId' => $user, 'token' => $token)); - $tmpl = new \OC_Template('core/lostpassword', 'email'); + $tmpl = new \OC_Template('core', 'lostpassword/email'); $tmpl->assign('link', $link); $msg = $tmpl->fetchPage(); diff --git a/core/setup/controller.php b/core/controller/setupcontroller.php index a64e6f08a36..16646b97ae6 100644 --- a/core/setup/controller.php +++ b/core/controller/setupcontroller.php @@ -25,11 +25,11 @@ * */ -namespace OC\Core\Setup; +namespace OC\Core\Controller; use OC\Setup; -class Controller { +class SetupController { /** @var Setup */ protected $setupHelper; /** @var string */ diff --git a/core/user/usercontroller.php b/core/controller/usercontroller.php index 38ecd86b459..72193761022 100644 --- a/core/user/usercontroller.php +++ b/core/controller/usercontroller.php @@ -20,7 +20,7 @@ * */ -namespace OC\Core\User; +namespace OC\Core\Controller; use \OCP\AppFramework\Controller; use \OCP\AppFramework\Http\JSONResponse; diff --git a/core/lostpassword/css/resetpassword.css b/core/css/lostpassword/resetpassword.css index 0b3c251e8d7..0b3c251e8d7 100644 --- a/core/lostpassword/css/resetpassword.css +++ b/core/css/lostpassword/resetpassword.css diff --git a/core/lostpassword/css/lostpassword.css b/core/lostpassword/css/lostpassword.css deleted file mode 100644 index b7f7023648d..00000000000 --- a/core/lostpassword/css/lostpassword.css +++ /dev/null @@ -1,31 +0,0 @@ -#body-login -input[type="text"]#user{ - padding-right: 20px; - padding-left: 41px; -} - -#body-login -input[type="submit"] { - text-align: center; - width: 170px; - height: 45px; - padding-top: 7px; - padding-bottom: 7px; -} - -#body-login input[type="submit"]#submit { - width: 280px; -} - -#body-login .update { - text-align: left; -} - -#body-login .update, -#body-login .error { - margin: 10px 0 5px 0; -} - -#user { - width: 226px !important; -} diff --git a/core/lostpassword/templates/email.php b/core/templates/lostpassword/email.php index 3ca424d5294..3ca424d5294 100644 --- a/core/lostpassword/templates/email.php +++ b/core/templates/lostpassword/email.php diff --git a/core/lostpassword/templates/resetpassword.php b/core/templates/lostpassword/resetpassword.php index 22dd2fc13b7..49ced424648 100644 --- a/core/lostpassword/templates/resetpassword.php +++ b/core/templates/lostpassword/resetpassword.php @@ -22,7 +22,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -style('lostpassword', 'resetpassword'); +style('core', 'lostpassword/resetpassword'); script('core', 'lostpassword'); ?> diff --git a/lib/base.php b/lib/base.php index b7118e02458..970eabce6af 100644 --- a/lib/base.php +++ b/lib/base.php @@ -826,7 +826,7 @@ class OC { $setupHelper = new OC\Setup(\OC::$server->getConfig(), \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'), new \OC_Defaults(), \OC::$server->getLogger(), \OC::$server->getSecureRandom()); - $controller = new OC\Core\Setup\Controller($setupHelper); + $controller = new OC\Core\Controller\SetupController($setupHelper); $controller->run($_POST); exit(); } diff --git a/tests/core/avatar/avatarcontrollertest.php b/tests/core/controller/avatarcontrollertest.php index 9e46e1782af..8e5e58904a7 100644 --- a/tests/core/avatar/avatarcontrollertest.php +++ b/tests/core/controller/avatarcontrollertest.php @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OC\Core\Avatar; +namespace OC\Core\Controller; use OC; use OC\Core\Application; @@ -45,7 +45,7 @@ function is_uploaded_file($filename) { * * @group DB * - * @package OC\Core\Avatar + * @package OC\Core\Controller */ class AvatarControllerTest extends \Test\TestCase { use UserTrait; diff --git a/tests/core/lostpassword/controller/lostcontrollertest.php b/tests/core/controller/lostcontrollertest.php index 0843d82da3f..44bc539247f 100644 --- a/tests/core/lostpassword/controller/lostcontrollertest.php +++ b/tests/core/controller/lostcontrollertest.php @@ -19,7 +19,7 @@ * */ -namespace OC\Core\LostPassword\Controller; +namespace OC\Core\Controller; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Utility\ITimeFactory; @@ -36,7 +36,7 @@ use PHPUnit_Framework_MockObject_MockObject; /** * Class LostControllerTest * - * @package OC\Core\LostPassword\Controller + * @package OC\Core\Controller */ class LostControllerTest extends \PHPUnit_Framework_TestCase { @@ -124,8 +124,8 @@ class LostControllerTest extends \PHPUnit_Framework_TestCase { ->will($this->returnValue('https://ownCloud.com/index.php/lostpassword/')); $response = $this->lostController->resetform($token, $userId); - $expectedResponse = new TemplateResponse('core/lostpassword', - 'resetpassword', + $expectedResponse = new TemplateResponse('core', + 'lostpassword/resetpassword', array( 'link' => 'https://ownCloud.com/index.php/lostpassword/', ), |