mirror of
https://github.com/friendica/friendica
synced 2025-04-26 08:30:10 +00:00
Merge pull request #9823 from MrPetovan/task/9677-2fa-remember-device
Add "Remember this device" feature to two factor authentication
This commit is contained in:
commit
199f72ee3c
48 changed files with 988 additions and 248 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Friendica\Object\Api\Friendica;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Model\Notification as NotificationModel;
|
||||
|
@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
|
|||
*
|
||||
* @see https://github.com/friendica/friendica/blob/develop/doc/API-Entities.md#notification
|
||||
*/
|
||||
class Notification extends BaseEntity
|
||||
class Notification extends BaseDataTransferObject
|
||||
{
|
||||
/** @var integer */
|
||||
protected $id;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\App\BaseURL;
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Collection\Api\Mastodon\Fields;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Database\DBA;
|
||||
|
@ -34,7 +34,7 @@ use Friendica\Util\DateTimeFormat;
|
|||
*
|
||||
* @see https://docs.joinmastodon.org/entities/account
|
||||
*/
|
||||
class Account extends BaseEntity
|
||||
class Account extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $id;
|
||||
|
@ -138,7 +138,7 @@ class Account extends BaseEntity
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
$account = parent::toArray();
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Activity
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/activity
|
||||
*/
|
||||
class Activity extends BaseEntity
|
||||
class Activity extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string (UNIX Timestamp) */
|
||||
protected $week;
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Application
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/application
|
||||
*/
|
||||
class Application extends BaseEntity
|
||||
class Application extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $name;
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Attachment
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/attachment
|
||||
*/
|
||||
class Attachment extends BaseEntity
|
||||
class Attachment extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $id;
|
||||
|
@ -67,7 +67,7 @@ class Attachment extends BaseEntity
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
$attachment = parent::toArray();
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Card
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/card
|
||||
*/
|
||||
class Card extends BaseEntity
|
||||
class Card extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $url;
|
||||
|
@ -67,10 +67,10 @@ class Card extends BaseEntity
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
if (empty($this->url)) {
|
||||
return null;
|
||||
return [];
|
||||
}
|
||||
|
||||
return parent::toArray();
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Emoji
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/emoji/
|
||||
*/
|
||||
class Emoji extends BaseEntity
|
||||
class Emoji extends BaseDataTransferObject
|
||||
{
|
||||
//Required attributes
|
||||
/** @var string */
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Error
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/error
|
||||
*/
|
||||
class Error extends BaseEntity
|
||||
class Error extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $error;
|
||||
|
@ -53,7 +53,7 @@ class Error extends BaseEntity
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
$error = parent::toArray();
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Field
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/field/
|
||||
*/
|
||||
class Field extends BaseEntity
|
||||
class Field extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $name;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\User;
|
||||
|
@ -32,7 +32,7 @@ use Friendica\Module\Register;
|
|||
*
|
||||
* @see https://docs.joinmastodon.org/api/entities/#instance
|
||||
*/
|
||||
class Instance extends BaseEntity
|
||||
class Instance extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string (URL) */
|
||||
protected $uri;
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\App\BaseURL;
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Mention
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/mention
|
||||
*/
|
||||
class Mention extends BaseEntity
|
||||
class Mention extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $id;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
|
@ -30,7 +30,7 @@ use Friendica\Util\Network;
|
|||
*
|
||||
* @see https://docs.joinmastodon.org/api/entities/#relationship
|
||||
*/
|
||||
class Relationship extends BaseEntity
|
||||
class Relationship extends BaseDataTransferObject
|
||||
{
|
||||
/** @var int */
|
||||
protected $id;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
|
@ -31,7 +31,7 @@ use Friendica\DI;
|
|||
*
|
||||
* @see https://docs.joinmastodon.org/api/entities/#stats
|
||||
*/
|
||||
class Stats extends BaseEntity
|
||||
class Stats extends BaseDataTransferObject
|
||||
{
|
||||
/** @var int */
|
||||
protected $user_count = 0;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Object\Api\Mastodon\Status\Counts;
|
||||
use Friendica\Object\Api\Mastodon\Status\UserAttributes;
|
||||
|
@ -32,7 +32,7 @@ use Friendica\Util\DateTimeFormat;
|
|||
*
|
||||
* @see https://docs.joinmastodon.org/entities/status
|
||||
*/
|
||||
class Status extends BaseEntity
|
||||
class Status extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $id;
|
||||
|
@ -143,7 +143,7 @@ class Status extends BaseEntity
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
$status = parent::toArray();
|
||||
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
namespace Friendica\Object\Api\Mastodon;
|
||||
|
||||
use Friendica\App\BaseURL;
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
|
||||
/**
|
||||
* Class Tag
|
||||
*
|
||||
* @see https://docs.joinmastodon.org/entities/tag
|
||||
*/
|
||||
class Tag extends BaseEntity
|
||||
class Tag extends BaseDataTransferObject
|
||||
{
|
||||
/** @var string */
|
||||
protected $name;
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
namespace Friendica\Object\Api\Twitter;
|
||||
|
||||
use Friendica\BaseEntity;
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
|
||||
/**
|
||||
* @see https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/user-object
|
||||
*/
|
||||
class User extends BaseEntity
|
||||
class User extends BaseDataTransferObject
|
||||
{
|
||||
/** @var int */
|
||||
protected $id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue