Add Empoyee

Manage Employee

=> TYPE_UINT )); if (!$vbulletin->GPC['userid']) { $vbulletin->GPC['userid'] = $vbulletin->GPC['u']; } if (!$vbulletin->GPC['activationid']) { $vbulletin->GPC['activationid'] = $vbulletin->GPC['i']; } $userinfo = verify_id('user', $vbulletin->GPC['userid'], 1, 1); $user = $db->query_first(" SELECT activationid, dateline FROM " . TABLE_PREFIX . "useractivation WHERE type = 1 AND userid = $userinfo[userid] "); if ($user['dateline'] < (TIMENOW - 24 * 60 * 60)) { // is it older than 24 hours? eval(standard_error(fetch_error('resetexpired', $vbulletin->session->vars['sessionurl']))); } if ($user['activationid'] != $vbulletin->GPC['activationid']) { //wrong act id eval(standard_error(fetch_error('resetbadid', $vbulletin->session->vars['sessionurl']))); } // delete old activation id $db->query_write("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = $userinfo[userid] AND type = 1"); // make random number $newpassword = vbrand(0, 100000000); // init user data manager $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD); $userdata->set_existing($userinfo); $userdata->set('password', $newpassword); $userdata->save(); ($hook = vBulletinHook::fetch_hook('reset_password')) ? eval($hook) : false; eval(fetch_email_phrases('resetpw', $userinfo['languageid'])); vbmail($userinfo['email'], $subject, $message, true); eval(standard_error(fetch_error('resetpw', $vbulletin->session->vars['sessionurl']))); } /*======================================================================*\ || #################################################################### || # CVS: $RCSfile$ - $Revision: 15601 $ || #################################################################### \*======================================================================*/ ?>ge = gbSwapGlobalGBTags( $succesfulPage ); die( $succesfulPage ); } } # Generate confirmation code image else if ( $action == 'genimg' ) { // Code based on Edward Eliot's article at: // http://www.sitepoint.com/article/toughen-forms-security-image // A 'captcha' class of his creation may be used in a future version. //session_start(); $width = 100; $height = 20; $lines = 30; // Number of lines to draw as "noise" $chars = 4; // Number of chars in confirmation code $spacing = $width / $chars; // Create image $image = imagecreate( $width, $height ); $white = imagecolorallocate( $image, 255, 255, 255 ); $black = imagecolorallocate( $image, 0, 0, 0 ); // Draw some noise for ( $i = 0; $i < $lines; $i++ ) { $randColor = rand( 190, 250 ); $lineColor = imagecolorallocate( $image, $randColor, $randColor, $randColor ); imageline( $image, rand( 0, $width ), rand( 0, $height ), rand( 0, $width ), rand( 0, $height ), $lineColor ); } // Draw a black rectangle around image imagerectangle( $image, 0, 0, $width - 1, $height - 1, $black ); // Draw the code $code = $_SESSION[ 'CONFIRM_CODE' ]; for( $i = 0; $i < strlen( $code ); $i++ ) { // Random font (3, 4 or 5. Internal GD fonts) $font = rand( 3, 5 ); $randColor = rand( 0, 128 ); $textColor = imagecolorallocate( $image, $randColor, $randColor, $randColor ); $x = $spacing / 3 + $i * $spacing; $y = ( $height - imagefontheight( $font ) ) / 2; imagestring( $image, $font, $x, $y, $code[ $i ], $textColor ); } // Output correct headers header( 'Content-type: image/png' ); // These headers avoid saving the image to cache header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" ); header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); header( "Cache-Control: no-cache, must-revalidate" ); header( "Pragma: no-cache" ); // Finally, output the result imagepng( $image ); // and free our resources imagedestroy( $image ); } # View entries else { # Read entries file into an array. $text = file( $cfgEntriesFile ); # How many entries we have. $lines = count( $text ); $entryTemplate = gbLoadTemplate( "temp_message.html" ); # Most recent post first. if ( $cfgNewestPostFirst ) { $limitValue = $lines - $page * $cfgEntriesPerPage; for ( $i = $limitValue + $cfgEntriesPerPage - 1; ( $i >= $limitValue ) && ( $i >= 0 ); $i-- ) { list( $name, $date, $email, $url, $message ) = explode( "|", $text[ $i ] ); # Censoring functions. $name = gbSwapBadWords( $name ); $name = gbCutLongWords( $name );