Skip to content

Commit

Permalink
[stable10] Backport of Make email field as default to create user
Browse files Browse the repository at this point in the history
Make email field as default to create user.
Previously we had username, password. With
this change it becomes username, email. This
would help admins to create users with email
address.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
  • Loading branch information
sharidas committed Aug 28, 2018
1 parent 4e9d627 commit c19daee
Show file tree
Hide file tree
Showing 19 changed files with 1,206 additions and 62 deletions.
41 changes: 41 additions & 0 deletions lib/public/InvalidUserTokenException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* @author Sujith Haridasan <sharidasan@owncloud.com>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace OCP;

/**
* Class InvalidUserTokenException
*
* @package OCP
* @since 10.0.10
*/
class InvalidUserTokenException extends UserTokenException {
/**
* InvalidUserTokenException constructor.
*
* @param string $message
* @param int $code
* @since 10.0.10
*/
public function __construct($message = "", $code = 0) {
parent::__construct($message, $code, $this);
}
}
42 changes: 42 additions & 0 deletions lib/public/UserTokenException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* @author Sujith Haridasan <sharidasan@owncloud.com>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace OCP;

/**
* Class UserTokenException
*
* @package OCP
* @since 10.0.10
*/
class UserTokenException extends \Exception {
/**
* UserTokenException constructor.
*
* @param string $message
* @param $code
* @param \Exception|null $previous
* @since 10.0.10
*/
public function __construct($message = "", $code, \Exception $previous = null) {
parent::__construct($message, $code, $previous);
}
}
41 changes: 41 additions & 0 deletions lib/public/UserTokenExpiredException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* @author Sujith Haridasan <sharidasan@owncloud.com>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace OCP;

/**
* Class UserTokenExpiredException
*
* @package OCP
* @since 10.0.10
*/
class UserTokenExpiredException extends UserTokenException {
/**
* UserTokenExpiredException constructor.
*
* @param string $message
* @param int $code
* @since 10.0.10
*/
public function __construct($message = "", $code = 0) {
parent::__construct($message, $code, $this);
}
}
41 changes: 41 additions & 0 deletions lib/public/UserTokenMismatchException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* @author Sujith Haridasan <sharidasan@owncloud.com>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

namespace OCP;

/**
* Class UserTokenMismatchException
*
* @package OCP
* @since 10.0.10
*/
class UserTokenMismatchException extends UserTokenException {
/**
* UserTokenMismatchException constructor.
*
* @param string $message
* @param int $code
* @since 10.0.10
*/
public function __construct($message = "", $code = 0) {
parent::__construct($message, $code, $this);
}
}
3 changes: 2 additions & 1 deletion settings/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public function __construct(array $urlParams=[]) {
$c->query('DefaultMailAddress'),
$c->query('URLGenerator'),
$c->query('OCP\\App\\IAppManager'),
$c->query('OCP\\IAvatarManager')
$c->query('OCP\\IAvatarManager'),
$c->query('ServerContainer')->getEventDispatcher()
);
});
$container->registerService('LogSettingsController', function (IContainer $c) {
Expand Down
Loading

0 comments on commit c19daee

Please sign in to comment.