• Ok, here is the situation I have.
    I am trying to add a field into the slm_activate function in order to be able to relate the product_id to the txn_id (which I read somewhere). The current beginning of code of the function is the following

    function activation_api_listener() {
            if (isset($_REQUEST['slm_action']) && trim($_REQUEST['slm_action']) == 'slm_activate') {
                //Handle the license activation API query
                global $slm_debug_logger;
    
                SLM_API_Utility::verify_secret_key(); //Verify the secret key first.
    
                $slm_debug_logger->log_debug("API - license activation request received.");
    
                $fields = array();
                $fields['lic_key'] = trim(strip_tags($_REQUEST['license_key']));
                $fields['registered_domain'] = trim(strip_tags($_REQUEST['registered_domain'])); //gethostbyaddr($_SERVER['REMOTE_ADDR']);
                $fields['item_reference'] = trim(strip_tags($_REQUEST['item_reference']));
                //$fields['product_id'] = trim(strip_tags($_REQUEST['product_id']));
    
                $slm_debug_logger->log_debug("License key: " . $fields['lic_key'] . " Domain: " . $fields['registered_domain']);
    
                global $wpdb;
                $tbl_name = SLM_TBL_LICENSE_KEYS;
                $reg_table = SLM_TBL_LIC_DOMAIN;
                $key = $fields['lic_key'];

    With the code as is, everything is ok, AND I get the registered domains when post is made to activate a key.

    BUT, When I uncomment the product_id field line, I lose the registered_domain information in the licence manager.
    Nothing is done yet with the product_id field, but is causes a different behaviour.

    Since I am quite new to php, I can’t see where and why this is causing this kind of behaviour.

    Anyone could help me on this please ?

    https://ww.wp.xz.cn/plugins/software-license-manager/

Viewing 1 replies (of 1 total)
  • Thread Starter patpou77

    (@patpou77)

    I found it…
    the $fields variable was used to push data into the table further in the code, but the table itself didn’t include this field name.

Viewing 1 replies (of 1 total)

The topic ‘adding field in slm_activate does not work’ is closed to new replies.