PageRenderTime 1948ms queryFilters 3ms Sphinxql 249ms GetByIds 1660ms meta 0ms repositoryFilters 5ms languageFilters 0ms sourceFilters 1ms

36,578 results for 'php mt_rand repo:dlorenso/dazlo' (1948 ms)

Source

Language

Repository

sharethis.php https://bitbucket.org/cblakebarber/circle_bastiat.git | PHP | 650 lines
23 Plugin URI: http://sharethis.com
24 Description: Let your visitors share a post/page with others. Supports e-mail and posting to social bookmarking sites. <a href="options-general.php?page=sharethis.php">Configuration options are here</a>. Questions on configuration, etc.? Make sure to read the README.
25 Version: 5.0.0
152	$updatePage=get_option('siteurl');
153	$updatePage.="/wp-admin/options-general.php?page=sharethis.php";
154
415							
416						header('Location: '.get_bloginfo('wpurl').'/wp-admin/options-general.php?page=sharethis.php&updated=true');
417						die();
628				$tags="<span class='st_sharethis' st_title='".strip_tags(get_the_title())."' st_url='".get_permalink($post->ID)."' displayText='ShareThis'></span>";
629				$tags="<span class='st_facebook_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_twitter_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_email_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_sharethis_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_fblike_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span><span class='st_plusone_buttons' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' displayText='share'></span>";	
630				$tags=preg_replace("/<\?php the_permalink\(\); \?>/",get_permalink($post->ID), $tags);
642function makePkey(){
643	return "wp.".sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),mt_rand( 0, 0x0fff ) | 0x4000,mt_rand( 0, 0x3fff ) | 0x8000,mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
644}
CaptchaExtendedAction.php https://bitbucket.org/trujka/msleague.git | PHP | 549 lines
479		$b = $this->foreColor % 0x100;
480		$foreColor = imagecolorallocate($image, mt_rand($r-50,$r+50), mt_rand($g-50,$g+50),mt_rand($b-50,$b+50));
481		
494			if(mt_rand(0,10)>7){
495				$foreColor = imagecolorallocate($image, mt_rand($r-50,$r+50), mt_rand($g-50,$g+50),mt_rand($b-50,$b+50));
496			}
505			$length = intval($this->width*$this->height/100*$this->density);
506			$c = imagecolorallocate($image, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255)); 
507			for($i=0;$i<$length;++$i){
519				// gray lines only to save human eyes:-)
520				$c = imagecolorallocate($image, mt_rand(200,255), mt_rand(200,255), mt_rand(200,255));
521				$x = mt_rand(0, $this->width);
530			for($i = 0; $i < $this->fillSections; ++$i){
531				$c = imagecolorallocate($image, mt_rand(200,255), mt_rand(200,255), mt_rand(200,255));
532				$x = mt_rand(0, $this->width);
UUID.php https://github.com/wrobel/horde-glue.git | PHP | 96 lines
43 * @copyright  2008-2009 Manuel Pichler. All rights reserved.
44 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
45 * @version    SVN: $Id$
52 * This implementation is based on code from a user comment at php.net.
53 * http://de3.php.net/manual/en/function.uniqid.php#69164
54 *
55 * @category   QualityAssurance
56 * @package    PHP_Depend
57 * @subpackage Util
79            '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
80            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
81            mt_rand(0, 0x0fff) | 0x4000,
82            mt_rand(0, 0x3fff) | 0x8000,
83            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
84        );
LDAPAuthPlugin.inc.php https://github.com/pkp/ocs.git | PHP | 389 lines
3/**
4 * @file LDAPAuthPlugin.inc.php
5 *
257		if (isset($this->settings['sasl'])) {
258			// FIXME ldap_sasl_bind requires PHP5, haven't tested this
259			return @ldap_sasl_bind($this->conn, $binddn, $password, $this->settings['saslmech'], $this->settings['saslrealm'], $this->settings['saslauthzid'], $this->settings['saslprop']);
287	function userFromAttr(&$user, &$uattr) {
288		$attr = array_change_key_case($uattr, CASE_LOWER); // Note:  array_change_key_case requires PHP >= 4.2.0
289		$firstName = @$attr['givenname'][0];
371			case 'smd5':
372				$salt = pack('C*', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand());
373				return '{SMD5}' . base64_encode(pack('H*', md5($password . $salt)) . $salt);
376			case 'ssha':
377				$salt = pack('C*', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand());
378				return '{SSHA}' . base64_encode(pack('H*', sha1($password . $salt)) . $salt);
LDAPAuthPlugin.inc.php https://github.com/mcrider/ocs.git | PHP | 390 lines
3/**
4 * @file LDAPAuthPlugin.inc.php
5 *
258		if (isset($this->settings['sasl'])) {
259			// FIXME ldap_sasl_bind requires PHP5, haven't tested this
260			return @ldap_sasl_bind($this->conn, $binddn, $password, $this->settings['saslmech'], $this->settings['saslrealm'], $this->settings['saslauthzid'], $this->settings['saslprop']);
288	function userFromAttr(&$user, &$uattr) {
289		$attr = array_change_key_case($uattr, CASE_LOWER); // Note:  array_change_key_case requires PHP >= 4.2.0
290		$firstName = @$attr['givenname'][0];
372			case 'smd5':
373				$salt = pack('C*', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand());
374				return '{SMD5}' . base64_encode(pack('H*', md5($password . $salt)) . $salt);
377			case 'ssha':
378				$salt = pack('C*', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand());
379				return '{SSHA}' . base64_encode(pack('H*', sha1($password . $salt)) . $salt);
DataTool.php https://github.com/sugarcrm/Tidbit.git | PHP | 941 lines
1<?php
2
37
38require_once('include/utils/db_utils.php');
39/**
41 * A DataTool object corresponds to a Sugar module.  
42 * install_cli.php creates a DataTool object for each Sugar module and
43 * initializes its fields based on values from that Sugar module.
141     * Generate a unique ID based on the module name, system time, and count (defined
142     * in install_config.php for each module), and save the ID in the installData array.
143     */
161     * Dispatch to the handleType function based on what values are present in the
162     * global $dataTool array.  This array is populated by the .php files in the 
163     * TidBit/Data directory.     
199	 * Returns a randomly generated piece of data for the current module and field.  
200	 * @param $typeData - An array from a .php file in the Tidbit/Data directory
201	 * @param $type - The type of the current field
captcha.php https://github.com/stormeus/Kusaba-Z.git | PHP | 133 lines
44 * Requirements: PHP 4/5 with GD and FreeType libraries
45 * Link: http://www.white-hat-web-design.co.uk/articles/php-captcha.php
46 *
69
70		require_once KU_ROOTDIR . 'inc/classes/randword.class.php';
71		$randword_class = new Rand_Word;
85			for( $i=0; $i<($width*$height)/3; $i++ ) {
86				imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);
87			}
90			for( $i=0; $i<($width*$height)/12; $i++ ) {
91				imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);
92			}
96			for( $i=0; $i<($width*$height)/150; $i++ ) {
97				imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color);
98			}
time.test.php https://bitbucket.org/AzuiSleet/cdr-web/ | PHP | 804 lines
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package       cake
507		$this->assertTrue($result);
508		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
509		$this->assertFalse($result);
509		$this->assertFalse($result);
510		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
511		$this->assertFalse($result);
523		$this->assertTrue($result);
524		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
525		$this->assertTrue($result);
time.test.php http://myopensources.googlecode.com/svn/trunk/ | PHP | 640 lines
9 *
10 * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
11 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
17 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
18 * @link          https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
19 * @package       cake
497		$this->assertTrue($result);
498		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
499		$this->assertFalse($result);
499		$this->assertFalse($result);
500		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
501		$this->assertFalse($result);
512		$this->assertTrue($result);
513		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
514		$this->assertTrue($result);
TimeHelperTest.php git://github.com/cakephp/cakephp.git | PHP | 811 lines
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package       Cake.Test.Case.View.Helper
511		$this->assertTrue($result);
512		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
513		$this->assertFalse($result);
513		$this->assertFalse($result);
514		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
515		$this->assertFalse($result);
526		$this->assertTrue($result);
527		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
528		$this->assertTrue($result);
render.php https://code.google.com/p/enanocms/ | PHP | 1,407 lines
173	/**
174 	* Renders a glob of text. Note that this is PHP-safe, so if returned text (or rather, "?>" . $returned) has PHP it can be eval'ed.
175 	* @param string Text to render
962 	* @param string $text
963 	* @param bool $strip_all_php - if true, strips all PHP regardless of user permissions. Else, strips PHP only if user level < USER_LEVEL_ADMIN. Defaults to true.
964 	* @param bool $sqlescape - if true, sends text through $db->escape(). Otherwise returns unescaped text. Defaults to true.
988		
989		$can_do_php = ( !$strip_all_php && $perms->get_permissions('php_in_pages') );
990		$can_do_html = $session->check_acl_scope('html_in_pages', $namespace) && $perms->get_permissions('html_in_pages');
1004		
1005		$php = preg_match_all('#(<|&lt;)\?php(.*?)\?(>|&gt;)#is', $text, $phpsec);
1006		
1042		{
1043			$phsec = ''.$phpsec[1][$i].'?php'.$phpsec[2][$i].'?'.$phpsec[3][$i].'';
1044			if ( $strip_all_php )
engine_potpourri.php https://code.google.com/p/enanocms/ | PHP | 332 lines
1<?php
2
19 * @copyright 2007-2008 Dan Fuhry
20 * @copyright 2002-2008 phpBB Group
21 */
33		for ( $i = 0; $i < 6; $i++ )
34			$latticecolor .= $hex[mt_rand(0, 15)];
35		
50			'gammacorrect' => '0.8',
51			'foreground_lattice_x' => (string)mt_rand(25, 30),
52			'foreground_lattice_y' => (string)mt_rand(25, 30),
124		}
125		$font = mt_rand(0, (count($fonts)-1));
126		
294	// Function  gdVersion by Hagan Fox
295	// http://de3.php.net/manual/en/function.gd-info.php#52481
296	function gdVersion($user_ver = 0)
time.test.php git://github.com/Datawalke/Coordino.git | PHP | 825 lines
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package       cake
514		$this->assertTrue($result);
515		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
516		$this->assertFalse($result);
516		$this->assertFalse($result);
517		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
518		$this->assertFalse($result);
530		$this->assertTrue($result);
531		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
532		$this->assertTrue($result);
darkness.php https://squirrelmail.svn.sourceforge.net/svnroot/squirrelmail | PHP | 165 lines
1<?php
2
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @version $Id: darkness.php 10633 2006-02-03 22:27:56Z jervfors $
11 * @package squirrelmail
16 * Load up the usual suspects.. */
17require_once(SM_PATH . 'functions/strings.php');
18
44function Darkness_HeaderPlugin() {
45   global $PHP_SELF;
46
46
47   if (substr($PHP_SELF, -18) == '/src/left_main.php') {
48      echo '<meta http-equiv="Page-Enter" content="' .
70</script>
71<?php
72}
darkness.php https://squirrelmail.svn.sourceforge.net/svnroot/squirrelmail | PHP | 143 lines
1<?php
2
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @version $Id: darkness.php 12304 2007-03-04 02:26:48Z jervfors $
11 * @package squirrelmail
16 * Load up the usual suspects.. */
17require_once(SM_PATH . 'functions/strings.php');
18
44function Darkness_HeaderPlugin() {
45   global $PHP_SELF;
46
46
47   if (substr($PHP_SELF, -18) == '/src/left_main.php') {
48      echo '<meta http-equiv="Page-Enter" content="' .
70</script>
71<?php
72}
time.test.php git://github.com/klevo/wildflower.git | PHP | 639 lines
9 *
10 * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
11 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
16 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
17 * @link          https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
18 * @package       cake
496		$this->assertTrue($result);
497		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
498		$this->assertFalse($result);
498		$this->assertFalse($result);
499		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
500		$this->assertFalse($result);
511		$this->assertTrue($result);
512		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
513		$this->assertTrue($result);
CakeTimeTest.php http://sidep.googlecode.com/svn/trunk/ | PHP | 813 lines
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package       Cake.Test.Case.View.Helper
513		$this->assertTrue($result);
514		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
515		$this->assertFalse($result);
515		$this->assertFalse($result);
516		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
517		$this->assertFalse($result);
528		$this->assertTrue($result);
529		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
530		$this->assertTrue($result);
TimeHelperTest.php http://agile-project2.googlecode.com/svn/ | PHP | 781 lines
6 *
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
14 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
15 * @package       Cake.Test.Case.View.Helper
499		$this->assertTrue($result);
500		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') - mt_rand(1, 12)));
501		$this->assertFalse($result);
501		$this->assertFalse($result);
502		$result = $this->Time->isThisMonth(mktime(0, 0, 0, date('m'), mt_rand(1, 28), date('Y') + mt_rand(1, 12)));
503		$this->assertFalse($result);
514		$this->assertTrue($result);
515		$result = $this->Time->isThisYear(mktime(0, 0, 0, mt_rand(1, 12), mt_rand(1, 28), date('Y')));
516		$this->assertTrue($result);
adminapi.php http://openqwaq.googlecode.com/svn/trunk/ | PHP | 1,551 lines
1<?php
2
74  $setupOrgUrl = $urlBase . "/coal/createOrg";
75  // We don't have enough info at the php level to do the actual
76  // org creation to punt and task the SP with it.
106  $setupOrgUrl = $urlBase . "/coal/createUser";
107  // We don't have enough info at the php level to do the actual
108  // creation to punt and task the SP with it.
215  $renameOrgUrl = $urlBase . "/coal/renameOrg";
216  // We don't have enough info at the php level to do the actual
217  // org rename to punt and task the SP with it.
250    return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
251        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
252        mt_rand( 0, 0x0fff ) | 0x4000,
253        mt_rand( 0, 0x3fff ) | 0x8000,
254        mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
255  }
UUID.php git://github.com/sebastianbergmann/php-object-freezer.git | PHP | 77 lines
1<?php
2/**
43
44require_once 'Object/Freezer/IdGenerator.php';
45
60     * This implementation of UUID generation is based on code from a note
61     * made on the PHP documentation.
62     *
63     * @return string
64     * @link   http://de3.php.net/manual/en/function.uniqid.php#69164
65     */
69          '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
70          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
71          mt_rand(0, 0x0fff) | 0x4000,
72          mt_rand(0, 0x3fff) | 0x8000,
73          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
74        );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21