We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit ceef84b6 authored by Evan Prodromou's avatar Evan Prodromou

utility functions for Confirm_address

parent a9c1029b
......@@ -28,4 +28,36 @@ class Confirm_address extends Memcached_DataObject
function sequenceKey()
{ return array(false, false); }
static function getAddress($address, $addressType)
{
$ca = new Confirm_address();
$ca->address = $address;
$ca->address_type = $addressType;
if ($ca->find(true)) {
return $ca;
}
return null;
}
static function saveNew($user, $address, $addressType, $extra=null)
{
$ca = new Confirm_address();
if (!empty($user)) {
$ca->user_id = $user->id;
}
$ca->address = $address;
$ca->address_type = $addressType;
$ca->address_extra = $extra;
$ca->code = common_confirmation_code(64);
$ca->insert();
return $ca;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment