Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96944678
PhabricatorAuthProviderConfigTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jan 1, 00:37
Size
4 KB
Mime Type
text/x-php
Expires
Fri, Jan 3, 00:37 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23296516
Attached To
rPH Phabricator
PhabricatorAuthProviderConfigTransaction.php
View Options
<?php
final
class
PhabricatorAuthProviderConfigTransaction
extends
PhabricatorApplicationTransaction
{
const
TYPE_ENABLE
=
'config:enable'
;
const
TYPE_REGISTRATION
=
'config:registration'
;
const
TYPE_LINK
=
'config:link'
;
const
TYPE_UNLINK
=
'config:unlink'
;
const
TYPE_TRUST_EMAILS
=
'config:trustEmails'
;
const
TYPE_AUTO_LOGIN
=
'config:autoLogin'
;
const
TYPE_PROPERTY
=
'config:property'
;
const
PROPERTY_KEY
=
'auth:property'
;
private
$provider
;
public
function
setProvider
(
PhabricatorAuthProvider
$provider
)
{
$this
->
provider
=
$provider
;
return
$this
;
}
public
function
getProvider
()
{
return
$this
->
provider
;
}
public
function
getApplicationName
()
{
return
'auth'
;
}
public
function
getApplicationTransactionType
()
{
return
PhabricatorAuthAuthProviderPHIDType
::
TYPECONST
;
}
public
function
getApplicationTransactionCommentObject
()
{
return
null
;
}
public
function
getIcon
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ENABLE
:
if
(
$new
)
{
return
'fa-play'
;
}
else
{
return
'fa-pause'
;
}
}
return
parent
::
getIcon
();
}
public
function
getColor
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ENABLE
:
if
(
$new
)
{
return
'green'
;
}
else
{
return
'red'
;
}
}
return
parent
::
getColor
();
}
public
function
getTitle
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ENABLE
:
if
(
$old
===
null
)
{
return
pht
(
'%s created this provider.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
if
(
$new
)
{
return
pht
(
'%s enabled this provider.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s disabled this provider.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
case
self
::
TYPE_REGISTRATION
:
if
(
$new
)
{
return
pht
(
'%s enabled registration.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s disabled registration.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
case
self
::
TYPE_LINK
:
if
(
$new
)
{
return
pht
(
'%s enabled accont linking.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s disabled account linking.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
case
self
::
TYPE_UNLINK
:
if
(
$new
)
{
return
pht
(
'%s enabled account unlinking.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s disabled account unlinking.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
case
self
::
TYPE_TRUST_EMAILS
:
if
(
$new
)
{
return
pht
(
'%s enabled email trust.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s disabled email trust.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
case
self
::
TYPE_AUTO_LOGIN
:
if
(
$new
)
{
return
pht
(
'%s enabled auto login.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s disabled auto login.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
case
self
::
TYPE_PROPERTY
:
$provider
=
$this
->
getProvider
();
if
(
$provider
)
{
$title
=
$provider
->
renderConfigPropertyTransactionTitle
(
$this
);
if
(
strlen
(
$title
))
{
return
$title
;
}
}
return
pht
(
'%s edited a property of this provider.'
,
$this
->
renderHandleLink
(
$author_phid
));
break
;
}
return
parent
::
getTitle
();
}
}
Event Timeline
Log In to Comment