Changeset 60

Show
Ignore:
Timestamp:
06/04/07 15:24:07 (2 years ago)
Author:
pdingle
Message:

moved createNewAccount to pw_utils, got rid of data.pw.php, and fixed problem with user messages

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-infocard/pw-config.php

    r59 r60  
    88define ('PW_PLUGINPATH', '/wp-content/plugins/wp-infocard'); 
    99define ('PW_SELECTORTRIGGER', 'html' ); 
    10 define ('PW_MANAGEDONLY', true ); 
     10define ('PW_MANAGEDONLY', false ); 
    1111define ('PW_VERSION', 'b2'); 
    1212define ('PW_VERSION_DATE', '17May07'); 
     
    2424define ('PW_SITEMESGURL', PW_PLUGINURL . '/site-messages/infocard-usermessage.php'); 
    2525define ('PW_SECURESITEURL', get_settings('securesiteurl') ); 
    26 define ('PW_FP_ICON', 'ic-logo-blue-icon.png' ); // icon must be in /pwlib/images/ic-logo 
     26define ('PW_FP_ICON', 'ic-logo-wb-icon.png' ); // icon must be in /pwlib/images/ic-logo 
    2727?> 
  • trunk/wp-infocard/site-messages/infocard-usermessage.php

    r33 r60  
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    12<?php 
    2 $messageType = $_SERVER['QUERY_STRING']; 
     3$messageType = $_REQUEST['mesg']; 
    34 
    45include_once( dirname(__FILE__) . '/../' . '/pw-config.php'); 
     
    67//nocache_headers(); 
    78?> 
    8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    99<html xmlns="http://www.w3.org/1999/xhtml"> 
    1010<head> 
     
    1717<div id="login"> 
    1818 
    19  
    2019        <?php pw_utils::printUserMessageText( $messageType ); ?> 
    2120        <p class="submit"> 
  • trunk/wp-infocard/wp/userdata.pw.php

    r48 r60  
    162162        } // end function mapTokenData 
    163163 
     164        // Function: createNewAccount 
     165        // Description: creates a new db record 
     166        // Input: account details 
     167        // Output: returns the user Id on success, FALSE on failure 
     168        // Side effect: none 
     169        function createNewAccount( $datamap ) 
     170        { 
     171                include_once( ABSPATH . WPINC . '/registration-functions.php'); 
     172                $user_login = $datamap['user_login']->new_value; 
     173                if (!$datamap['display_name']->compare()) 
     174                { 
     175                        $display_name = $datamap['display_name']->new_value; 
     176                        $user_nicename = $display_name; 
     177                } 
     178                if (!$datamap['user_email']->compare()) 
     179                        $user_email = $datamap['user_email']->new_value; 
     180                if (($datamap['user_url']) && (!$datamap['user_url']->compare())) 
     181                        $user_url = $datamap['user_url']->new_value; 
     182                if (!$datamap['first_name']->compare()) 
     183                        $first_name = $datamap['first_name']->new_value; 
     184                if (!$datamap['last_name']->compare()) 
     185                        $last_name = $datamap['last_name']->new_value; 
     186                $userdata = compact('user_login', 'user_email', 'user_nicename', 'user_url', 'display_name', 'first_name', 'last_name'); 
     187 
     188                pw_utils::printDebug("<br/>Action: createNewAccount<br>"); 
     189                $user_ID = wp_insert_user($userdata); 
     190 
     191                if ($user_ID) 
     192                { 
     193                        pw_utils::printDebug("&nbsp;Inserted record # $user_ID<br>"); 
     194                        return $user_ID; 
     195                }  
     196                else  
     197                { 
     198                        pw_utils::printDebug("&nbsp;Error - new user not created<br/>"); 
     199                        return FALSE; 
     200                } 
     201        } // end function createNewAccount 
     202 
    164203        // Function: getLoginID 
    165204        // Description:  always returns existing value if it exists