Example #1
0
<?php

$um =& CUserManage::getInstance();
$_p = $_POST;
if (!preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{2,4}/', $_p['p_dateBirth'])) {
    $_p['p_dateBirth'] = 0;
} else {
    $dparts = explode('/', $_p['p_dateBirth']);
    $_p['p_dateBirth'] = mktime(0, 0, 0, $dparts[0], $dparts[1], substr('19' . $dparts[2], -4, 4));
}
$_p = htmlSafeArray($_p);
$um->updateProfile($_p);
$url = '/?action=mypage.profile&message=updated';
Example #2
0
<?php

$usm =& CUserManage::getInstance();
$sm =& CSubscriptionManage::getInstance();
$data = array('p_u_id' => $_USER_ID, 'p_password' => $_POST['p_password'], 'p_description' => $_POST['p_description']);
$_p = htmlSafeArray($data);
// delete all subscriptions then add 'em
$subscriptions = (array) explode("\n", $_POST['addSubscription']);
$sm->deleteSubscriptions(array('s_u_id' => $_USER_ID));
foreach ($subscriptions as $v) {
    if (strstr($v, '@')) {
        $sm->addSubscription(array('s_u_id' => $_USER_ID, 's_email' => $v, 's_method' => 'push'));
    }
}
$usm->updatePage($_p);
$url = $_POST['redirect'];