コード例 #1
0
ファイル: cart.php プロジェクト: forthrobot/inuvik
 /**
  * Check if any of the items in the cart are on sale
  *
  * @api `shopp('cart.has-savings')`
  * @since 1.1
  *
  * @param string    $result  The output
  * @param array     $options The options
  * @param ShoppCart $O       The working object
  * @return bool True if an item is on sale, false otherwise
  */
 public static function has_savings($result, $options, $O)
 {
     // loop thru cart looking for $Item->sale == "on" or "1" etc
     foreach ($O as $item) {
         if (str_true($item->sale)) {
             return true;
         }
     }
     return false;
 }
コード例 #2
0
ファイル: Core.php プロジェクト: BlessySoftwares/anvelocom
 /**
  * @deprecated
  **/
 public static function value_is_true($value)
 {
     return str_true($value);
 }
コード例 #3
0
						<br />
						In case your installation uses something other than <b>uid</b>; 
					</td>
				</tr>
				<tr>
					<th scope="row" valign="top">Use TLS</th>
					<td>
						<input type="hidden" name="<?php 
    echo $this->get_field_name('use_tls');
    ?>
" value="false" />
						<label><input type="checkbox" name="<?php 
    echo $this->get_field_name('use_tls');
    ?>
" value="true" <?php 
    if (str_true($this->get_setting('use_tls'))) {
        echo "checked";
    }
    ?>
 /> Transport Layer Security. This feature is beta, very beta.</label><br/>
					</td>
				</tr>
				<tr>
					<th scope="row" valign="top">LDAP Port</th>
					<td>
						<input type="text" name="<?php 
    echo $this->get_field_name('ldap_port');
    ?>
" value="<?php 
    echo $SimpleLDAPLogin->get_setting('ldap_port');
    ?>
コード例 #4
0
 function ldap_auth($username, $password, $directory)
 {
     $result = false;
     if ($directory == "ad") {
         $result = $this->adldap->authenticate($username, $password);
     } elseif ($directory == "ol") {
         $this->ldap = ldap_connect(join(' ', (array) $this->get_setting('domain_controllers')), (int) $this->get_setting('ldap_port'));
         ldap_set_option($this->ldap, LDAP_OPT_PROTOCOL_VERSION, (int) $this->get_setting('ldap_version'));
         if (str_true($this->get_setting('use_tls'))) {
             ldap_start_tls($this->ldap);
         }
         $ldapbind = @ldap_bind($this->ldap, $this->get_setting('ol_login') . '=' . $username . ',' . $this->get_setting('base_dn'), $password);
         $result = $ldapbind;
     }
     return apply_filters($this->prefix . 'ldap_auth', $result);
 }
コード例 #5
0
 function deactivate_key($license = '')
 {
     $license = !empty($license) ? $license : get_option('toolbox_license_key');
     $args = array('action' => 'deactivate-license', 'plugin_name' => $this->basename, 'license_key' => $license);
     $results = $this->send($args);
     if (str_true($results)) {
         $this->remove_license_key($license);
         return true;
     }
     return false;
 }
コード例 #6
0
 function ldap_auth($username, $password, $directory)
 {
     $result = false;
     if ($directory == "ad") {
         $result = $this->adldap->authenticate($username, $password);
     } elseif ($directory == "ol") {
         $this->ldap = ldap_connect(join(' ', (array) $this->get_setting('domain_controllers')), (int) $this->get_setting('ldap_port'));
         ldap_set_option($this->ldap, LDAP_OPT_PROTOCOL_VERSION, (int) $this->get_setting('ldap_version'));
         if (str_true($this->get_setting('use_tls'))) {
             ldap_start_tls($this->ldap);
         }
         $dn = $this->get_setting('ol_login') . '=' . $username . ',' . $this->get_setting('base_dn');
         if (str_true($this->get_setting('search_sub_ous'))) {
             // search for user's DN in the base DN and below
             $filter = $this->get_setting('ol_login') . '=' . $username;
             $sr = @ldap_search($this->ldap, $this->get_setting('base_dn'), $filter, array('cn'));
             if ($sr !== FALSE) {
                 $info = @ldap_get_entries($this->ldap, $sr);
                 if ($info !== FALSE && $info['count'] > 0) {
                     $dn = $info[0]['dn'];
                 }
             }
         }
         $ldapbind = @ldap_bind($this->ldap, $dn, $password);
         $result = $ldapbind;
     }
     return apply_filters($this->prefix . 'ldap_auth', $result);
 }