Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891933
AlmanacInterfaceAddressTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
AlmanacInterfaceAddressTransaction.php
View Options
<?php
final
class
AlmanacInterfaceAddressTransaction
extends
AlmanacInterfaceTransactionType
{
const
TRANSACTIONTYPE
=
'almanac:interface:address'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getAddress
(
)
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setAddress
(
$value
)
;
}
public
function
getTitle
(
)
{
return
pht
(
'%s changed the address for this interface from %s to %s.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderOldValue
(
)
,
$this
->
renderNewValue
(
)
)
;
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
(
)
;
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getAddress
(
)
,
$xactions
)
)
{
$errors
[
]
=
$this
->
newRequiredError
(
pht
(
'Interfaces must have an address.'
)
)
;
}
foreach
(
$xactions
as
$xaction
)
{
// NOTE: For now, we don't validate addresses. We generally expect users
// to provide IPv4 addresses, but it's reasonable for them to provide
// IPv6 addresses, and some installs currently use DNS names. This is
// off-label but works today.
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 15:58 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126247
Default Alt Text
AlmanacInterfaceAddressTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment