$creds = array();
         $creds['user_login'] = $current_user->user_login;
         $creds['user_password'] = $_POST["pass1"];
         $creds['remember'] = true;
         wp_set_password($_POST["pass1"], $wp_id);
         $user = wp_signon($creds, false);
         if (is_wp_error($user)) {
             $message = $user->get_error_message();
         }
     }
     switch ($_POST['sfAction']) {
         case "update":
             $message = eSNAPUpdate($sf_profile);
             break;
         case "Cancel":
             $message = eSNAPUpdate($sf_profile);
             $message += eSNSRCancel($sf_profile, $_POST['srId']);
             break;
     }
     $status = "confirm";
 } else {
     $message = '<p class="error">';
     if ($sf_password_change == 2) {
         $message = $message . '<strong>ERROR</strong>: Passwords enterred do not match<br />';
     }
     //password not match
     if ($sf_password_change == 3 or $sf_password_length == 3) {
         $message = $message . '<strong>ERROR</strong>: Passwords enterred must be at least five characters long.<br />';
     }
     // password to short
     if ($sf_password_change == 1) {
Beispiel #2
0
                $profile->eCN_This_Week__c = $_POST['ecn_this_week__c'];
                $profile->eCN_Today__c = $_POST['ecn_today__c'];
                $profile->eCN_Offers__c = $_POST['ecn_offers__c'];
                $profile->eCN_Partners__c = $_POST['ecn_partners__c'];
                $profile->Email_as_ExternalID__c = $profile->PersonEmail;
                if (count($fieldsToNull) > 0) {
                    $profile->fieldsToNull = $fieldsToNull;
                }
                if (!in_array('PersonEmail', $fieldsToNull) && !in_array('FirstName', $fieldsToNull) && !in_array('LastName', $fieldsToNull) && !in_array('Organization__c', $fieldsToNull) && !in_array('Company_Type__c', $fieldsToNull) && !in_array('PersonTitle', $fieldsToNull) && !in_array('PersonMailingStreet', $fieldsToNull) && !in_array('PersonMailingCity', $fieldsToNull) && !in_array('PersonMailingState', $fieldsToNull) && !in_array('PersonMailingPostalCode', $fieldsToNull) && !in_array('PersonMailingCountry', $fieldsToNull) && !in_array('phone', $fieldsToNull) && !in_array('Grade_Level__c', $fieldsToNull) && !in_array('Subject_Taught__c', $fieldsToNull)) {
                    switch ($_POST['sfAction']) {
                        case "update":
                            //print_r($profile);
                            $message = eSNAPUpdate($profile);
                            break;
                        case "Cancel":
                            $message = eSNAPUpdate($profile);
                            $message += eSNSRCancel($profile, $_POST['srId']);
                            break;
                    }
                } else {
                    $message = "<br/><h5><font color='red'>Please fill out all required fields</font></h5>";
                    $status = 'Search';
                }
            }
            break;
    }
} else {
    die('No Access');
}
?>