$meta_info key "vendor_license" to install regardless of whether a valid license was entered (ie, your addon script will just detect an invalid license and handle as you wish).
$meta_info key "vendor_license" to install only if the license entered was valid.
[% vendor_license %]:
'vendor_license' => {},
To allow them to enter a license key of any format you wish and put it in [% vendor_license %]:
'vendor_license' => {
'string_is_ok' => sub {
my($lisc_string) = @_; # 32 digits
return 1 if length $lisc_string == 32 && $lisc_string =~ m/^\d+$/; # ^\d{32}$
return 0;
},
},
The following will allow the customer to enter anything into the field and have a script verify the license key is valid or else not install/upgrade it:
'vendor_license' => {
'verify_url' => 'http://foo.bar.baz/lisc.pl',
#?lisc=license_string_from_input_here
'url_says_its_ok' => sub {
my ($url_result) = @_; # it is empty if url failed
return 1 if $url_result =~ m/Vendor says Valid/;
return 0;
},
},
Copyright © cPanel 2000-2009.