$user_username->user_id = $user->id;
$user_username->provider_name = $provider_name;
$user_username->username = $username;
- $user_username->created = DB_DataObject_Cast::dateTime();
+ $user_username->created = common_sql_now();
if($user_username->insert()){
return $user_username;
$con = new Consumer();
$con->consumer_key = $consumer_key;
$con->seed = common_good_rand(16);
- $con->created = DB_DataObject_Cast::dateTime();
+ $con->created = common_sql_now();
if (!$con->insert()) {
return null;
}
if ($n->find(true)) {
return true;
} else {
- $n->created = DB_DataObject_Cast::dateTime();
+ $n->created = common_sql_now();
$n->insert();
return false;
}
$t->secret = common_good_rand(16);
$t->type = 0; // request
$t->state = 0; // unauthorized
- $t->created = DB_DataObject_Cast::dateTime();
+ $t->created = common_sql_now();
if (!$t->insert()) {
return null;
} else {
$at->tok = common_good_rand(16);
$at->secret = common_good_rand(16);
$at->type = 1; // access
- $at->created = DB_DataObject_Cast::dateTime();
+ $at->created = common_sql_now();
if (!$at->insert()) {
$e = $at->_lastError;
common_debug('access token "'.$at->tok.'" not inserted: "'.$e->message.'"', __FILE__);
if ($exists) {
$profile->update($orig_profile);
} else {
- $profile->created = DB_DataObject_Cast::dateTime(); # current time
+ $profile->created = common_sql_now(); # current time
$id = $profile->insert();
if (!$id) {
// TRANS: Exception thrown when creating a new profile fails in OAuth store.
throw new Exception(_('Error updating remote profile.'));
}
} else {
- $remote->created = DB_DataObject_Cast::dateTime(); # current time
+ $remote->created = common_sql_now(); # current time
if (!$remote->insert()) {
// TRANS: Exception thrown when creating a remote profile fails in OAuth store.
throw new Exception(_('Error inserting remote profile.'));
if ($sub_exists) {
$orig_sub = clone($sub);
} else {
- $sub->created = DB_DataObject_Cast::dateTime();
+ $sub->created = common_sql_now();
}
$sub->token = $token->key;
$user_openid_trustroot = new User_openid_trustroot();
$user_openid_trustroot->user_id = $this->user->id;
$user_openid_trustroot->trustroot = $this->trust_root;
- $user_openid_trustroot->created = DB_DataObject_Cast::dateTime();
+ $user_openid_trustroot->created = common_sql_now();
if (!$user_openid_trustroot->insert()) {
$err = PEAR::getStaticProperty('DB_DataObject','lastError');
}
$oid->user_id = $id;
$oid->canonical = $canonical;
$oid->display = $display;
- $oid->created = DB_DataObject_Cast::dateTime();
+ $oid->created = common_sql_now();
if (!$oid->insert()) {
$err = PEAR::getStaticProperty('DB_DataObject','lastError');