{"code": " public function actionGetItems(){\n $sql = 'SELECT id, name as value FROM x2_opportunities WHERE name LIKE :qterm ORDER BY name ASC';\n $command = Yii::app()->db->createCommand($sql);\n $qterm = $_GET['term'].'%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result);\n Yii::app()->end();\n }", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $action = $this->actionModel->getById($this->request->getIntegerParam('action_id'));\n\n if (! empty($action) && $this->actionModel->remove($action['id'])) {\n $this->flash->success(t('Action removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this action.'));\n }\n\n $this->response->redirect($this->helper->url->to('ActionController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public function testDoesNotTouchClosureListeners()\n {\n $this->getServer()->flush();\n $this->getServer()->enqueue(array(\n \"HTTP/1.1 200 OK\\r\\n\" .\n \"Date: Mon, 12 Nov 2012 03:06:37 GMT\\r\\n\" .\n \"Cache-Control: private, s-maxage=0, max-age=0, must-revalidate\\r\\n\" .\n \"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\\r\\n\" .\n \"Content-Length: 2\\r\\n\\r\\nhi\",\n \"HTTP/1.0 304 Not Modified\\r\\n\" .\n \"Date: Mon, 12 Nov 2012 03:06:38 GMT\\r\\n\" .\n \"Content-Type: text/html; charset=UTF-8\\r\\n\" .\n \"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\\r\\n\" .\n \"Age: 6302\\r\\n\\r\\n\",\n \"HTTP/1.0 304 Not Modified\\r\\n\" .\n \"Date: Mon, 12 Nov 2012 03:06:38 GMT\\r\\n\" .\n \"Content-Type: text/html; charset=UTF-8\\r\\n\" .\n \"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\\r\\n\" .\n \"Age: 6302\\r\\n\\r\\n\",\n ));\n $client = new Client($this->getServer()->getUrl());\n $client->addSubscriber(new CachePlugin());\n $client->getEventDispatcher()->addListener('command.after_send', function(){});\n $this->assertEquals(200, $client->get()->send()->getStatusCode());\n $this->assertEquals(200, $client->get()->send()->getStatusCode());\n $this->assertEquals(200, $client->get()->send()->getStatusCode());\n }", "label_name": "Base", "label": 1} {"code": " function selectObjectBySql($sql) {\n //$logFile = \"C:\\\\xampp\\\\htdocs\\\\supserg\\\\tmp\\\\queryLog.txt\";\n //$lfh = fopen($logFile, 'a');\n //fwrite($lfh, $sql . \"\\n\"); \n //fclose($lfh); \n $res = @mysqli_query($this->connection, $this->injectProof($sql));\n if ($res == null)\n return null;\n return mysqli_fetch_object($res);\n }", "label_name": "Class", "label": 2} {"code": "\tpublic function register()\n\t{\n\t\tJSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t// Get the application\n\t\t$app = JFactory::getApplication();\n\n\t\t// Get the form data.\n\t\t$data = $this->input->post->get('user', array(), 'array');\n\n\t\t// Get the model and validate the data.\n\t\t$model = $this->getModel('Registration', 'UsersModel');\n\n\t\t$form = $model->getForm();\n\n\t\tif (!$form)\n\t\t{\n\t\t\tJError::raiseError(500, $model->getError());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$return = $model->validate($form, $data);\n\n\t\t// Check for errors.\n\t\tif ($return === false)\n\t\t{\n\t\t\t// Get the validation messages.\n\t\t\t$errors = $model->getErrors();\n\n\t\t\t// Push up to three validation messages out to the user.\n\t\t\tfor ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)\n\t\t\t{\n\t\t\t\tif ($errors[$i] instanceof Exception)\n\t\t\t\t{\n\t\t\t\t\t$app->enqueueMessage($errors[$i]->getMessage(), 'notice');\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$app->enqueueMessage($errors[$i], 'notice');\n\t\t\t}\n\n\t\t\t// Save the data in the session.\n\t\t\t$app->setUserState('users.registration.form.data', $data);\n\n\t\t\t// Redirect back to the registration form.\n\t\t\t$this->setRedirect('index.php?option=com_users&view=registration');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Finish the registration.\n\t\t$return = $model->register($data);\n\n\t\t// Check for errors.\n\t\tif ($return === false)\n\t\t{\n\t\t\t// Save the data in the session.\n\t\t\t$app->setUserState('users.registration.form.data', $data);\n\n\t\t\t// Redirect back to the registration form.\n\t\t\t$message = JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError());\n\t\t\t$this->setRedirect('index.php?option=com_users&view=registration', $message, 'error');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flush the data from the session.\n\t\t$app->setUserState('users.registration.form.data', null);\n\n\t\treturn true;\n\t}", "label_name": "Class", "label": 2} {"code": " foreach($course_RET as $period_date)\n {\n // $period_days_append_sql .=\"(sp.start_time<='$period_date[END_TIME]' AND '$period_date[START_TIME]'<=sp.end_time AND IF(course_period_date IS NULL, course_period_date='$period_date[COURSE_PERIOD_DATE]',DAYS LIKE '%$period_date[DAYS]%')) OR \";\n $period_days_append_sql .=\"(sp.start_time<='$period_date[END_TIME]' AND '$period_date[START_TIME]'<=sp.end_time AND (cpv.course_period_date IS NULL OR cpv.course_period_date='$period_date[COURSE_PERIOD_DATE]') AND cpv.DAYS LIKE '%$period_date[DAYS]%') OR \";\n\n }", "label_name": "Base", "label": 1} {"code": " public function toolbar() {\n// global $user;\n\n $menu = array();\n\t\t$dirs = array(\n\t\t\tBASE.'framework/modules/administration/menus',\n\t\t\tBASE.'themes/'.DISPLAY_THEME.'/modules/administration/menus'\n\t\t);\n\n\t\tforeach ($dirs as $dir) {\n\t\t if (is_readable($dir)) {\n\t\t\t $dh = opendir($dir);\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t\t if (substr($file,-4,4) == '.php' && is_readable($dir.'/'.$file) && is_file($dir.'/'.$file)) {\n\t\t\t\t\t $menu[substr($file,0,-4)] = include($dir.'/'.$file);\n if (empty($menu[substr($file,0,-4)])) unset($menu[substr($file,0,-4)]);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t}\n\n // sort the top level menus alphabetically by filename\n\t\tksort($menu);\t\t\n\t\t$sorted = array();\n\t\tforeach($menu as $m) $sorted[] = $m;\n \n // slingbar position\n if (isset($_COOKIE['slingbar-top'])){\n $top = $_COOKIE['slingbar-top'];\n } else {\n $top = SLINGBAR_TOP;\n }\n \n\t\tassign_to_template(array(\n 'menu'=>(bs3()) ? $sorted : json_encode($sorted),\n \"top\"=>$top\n ));\n }", "label_name": "Class", "label": 2} {"code": "\tfunction manage() {\n\t global $db;\n\t \n\t expHistory::set('manageable', $this->params);\n//\t $classes = array();\n $dir = BASE.\"framework/modules/ecommerce/billingcalculators\";\n if (is_readable($dir)) {\n $dh = opendir($dir);\n while (($file = readdir($dh)) !== false) {\n if (is_file(\"$dir/$file\") && substr(\"$dir/$file\", -4) == \".php\") {\n include_once(\"$dir/$file\");\n $classname = substr($file, 0, -4);\n $id = $db->selectValue('billingcalculator', 'id', 'calculator_name=\"'.$classname.'\"');\n if (empty($id)) {\n// $calobj = null;\n $calcobj = new $classname();\n if ($calcobj->isSelectable() == true) {\n $obj = new billingcalculator(array(\n 'title'=>$calcobj->name(),\n// 'user_title'=>$calcobj->title,\n 'body'=>$calcobj->description(), \n 'calculator_name'=>$classname,\n 'enabled'=>false));\n $obj->save();\n }\n }\n }\n }\n }\n \n $bcalc = new billingcalculator();\n $calculators = $bcalc->find('all');\n assign_to_template(array(\n 'calculators'=>$calculators\n ));\n\t}", "label_name": "Base", "label": 1} {"code": "\t\tform_end_row();\n\t\t$i++;\n\t}\n\n\n\thtml_end_box(false);\n\n/*\n\tprint \"
\";\n\tif (isset($check) && is_array($check)) {\n\t\tprint_r($check);\n\t}\n\tprint \"\";\n*/\n\n}", "label_name": "Base", "label": 1} {"code": " }elseif($k == \"error\"){\r\n\r\n self::error($v);\r\n\r\n }elseif(!in_array($k, $arr) && $k != 'paging'){\r", "label_name": "Base", "label": 1} {"code": " public function save()\n {\n $user = $this->getUser();\n $values = $this->request->getValues();\n\n if (! $this->userSession->isAdmin()) {\n if (isset($values['role'])) {\n unset($values['role']);\n }\n }\n\n list($valid, $errors) = $this->userValidator->validateModification($values);\n\n if ($valid) {\n if ($this->userModel->update($values)) {\n $this->flash->success(t('User updated successfully.'));\n $this->response->redirect($this->helper->url->to('UserViewController', 'show', array('user_id' => $user['id'])), true);\n return;\n } else {\n $this->flash->failure(t('Unable to update this user.'));\n }\n }\n\n $this->show($values, $errors);\n }", "label_name": "Base", "label": 1} {"code": " public static function handler($vars) {\r\n self::$vars();\r\n }\r", "label_name": "Base", "label": 1} {"code": " return new Response($emailLog->getHtmlLog());\n } elseif ($request->get('type') == 'params') {", "label_name": "Base", "label": 1} {"code": " foreach ($week as $dayNum => $day) {\r\n if ($dayNum == $now['mday']) {\r\n $currentweek = $weekNum;\r\n }\r\n if ($dayNum <= $endofmonth) {\r\n// $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $db->countObjects(\"eventdate\", $locsql . \" AND date >= \" . expDateTime::startOfDayTimestamp($day['ts']) . \" AND date <= \" . expDateTime::endOfDayTimestamp($day['ts'])) : -1;\r\n $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $ed->find(\"count\", $locsql . \" AND date >= \" . expDateTime::startOfDayTimestamp($day['ts']) . \" AND date <= \" . expDateTime::endOfDayTimestamp($day['ts'])) : -1;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic function fixsessions() {\n\t global $db;\n\n//\t\t$test = $db->sql('CHECK TABLE '.$db->prefix.'sessionticket');\n\t\t$fix = $db->sql('REPAIR TABLE '.$db->prefix.'sessionticket');\n\t\tflash('message', gt('Sessions Table was Repaired'));\n\t\texpHistory::back();\n\t}", "label_name": "Class", "label": 2} {"code": " public function save(){\n $cat_name = I(\"cat_name\");\n $s_number = I(\"s_number/d\") ? I(\"s_number/d\") : 99 ;\n $cat_id = I(\"cat_id/d\")? I(\"cat_id/d\") : 0;\n $parent_cat_id = I(\"parent_cat_id/d\")? I(\"parent_cat_id/d\") : 0;\n $item_id = I(\"item_id/d\");\n\n $login_user = $this->checkLogin();\n if (!$this->checkItemPermn($login_user['uid'] , $item_id)) {\n $this->sendError(10103);\n return;\n }\n //\u7981\u6b62\u7a7a\u76ee\u5f55\u7684\u751f\u6210\n if (!$cat_name) {\n return;\n }\n \n if ($parent_cat_id && $parent_cat_id == $cat_id) {\n $this->sendError(10101,\"\u4e0a\u7ea7\u76ee\u5f55\u4e0d\u80fd\u9009\u62e9\u81ea\u8eab\");\n return;\n }\n \n $data['cat_name'] = $cat_name ;\n $data['s_number'] = $s_number ;\n $data['item_id'] = $item_id ;\n $data['parent_cat_id'] = $parent_cat_id ;\n if ($parent_cat_id > 0 ) {\n $row = D(\"Catalog\")->where(\" cat_id = '$parent_cat_id' \")->find() ;\n $data['level'] = $row['level'] +1 ;\n }else{\n $data['level'] = 2;\n }\n\n if ($cat_id > 0 ) {\n \n //\u5982\u679c\u4e00\u4e2a\u76ee\u5f55\u5df2\u7ecf\u662f\u522b\u7684\u76ee\u5f55\u7684\u7236\u76ee\u5f55\uff0c\u90a3\u4e48\u5b83\u5c06\u65e0\u6cd5\u518d\u8f6c\u4e3alevel4\u76ee\u5f55\n if (D(\"Catalog\")->where(\" parent_cat_id = '$cat_id' \")->find() && $data['level'] == 4 ) {\n $this->sendError(10101,\"\u8be5\u76ee\u5f55\u542b\u6709\u5b50\u76ee\u5f55\uff0c\u4e0d\u5141\u8bb8\u8f6c\u4e3a\u5e95\u5c42\u76ee\u5f55\u3002\");\n return;\n }\n \n $ret = D(\"Catalog\")->where(\" cat_id = '$cat_id' \")->save($data);\n $return = D(\"Catalog\")->where(\" cat_id = '$cat_id' \")->find();\n\n }else{\n $data['addtime'] = time();\n $cat_id = D(\"Catalog\")->add($data);\n $return = D(\"Catalog\")->where(\" cat_id = '$cat_id' \")->find();\n \n }\n if (!$return) {\n $return['error_code'] = 10103 ;\n $return['error_message'] = 'request fail' ;\n }\n $this->sendResult($return);\n \n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));\n\n $this->response->html($this->helper->layout->project('custom_filter/remove', array(\n 'project' => $project,\n 'filter' => $filter,\n 'title' => t('Remove a custom filter')\n )));\n }", "label_name": "Class", "label": 2} {"code": " public function testRemoveAuthorizationHeaderOnRedirect()\n {\n $mock = new MockHandler([\n new Response(302, ['Location' => 'http://test.com']),\n static function (RequestInterface $request) {\n self::assertFalse($request->hasHeader('Authorization'));\n return new Response(200);\n }\n ]);\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n $client->get('http://example.com?a=b', ['auth' => ['testuser', 'testpass']]);\n }", "label_name": "Class", "label": 2} {"code": " public function backup($type='json')\r\n {\r\n global $DB;\r\n global $website;\r\n\r\n $out = array();\r\n\r\n $DB->query('SELECT * FROM nv_structure WHERE website = '.protect($website->id), 'object');\r\n\r\n if($type='json')\r\n $out = json_encode($DB->result());\r\n\r\n return $out;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function take($value)\n {\n return $this->limit($value);\n }", "label_name": "Base", "label": 1} {"code": " public function validate() {\n global $db;\n // check for an sef url field. If it exists make sure it's valid and not a duplicate\n //this needs to check for SEF URLS being turned on also: TODO\n\n if (property_exists($this, 'sef_url') && !(in_array('sef_url', $this->do_not_validate))) {\n if (empty($this->sef_url)) $this->makeSefUrl();\n if (!isset($this->validates['is_valid_sef_name']['sef_url'])) $this->validates['is_valid_sef_name']['sef_url'] = array();\n if (!isset($this->validates['uniqueness_of']['sef_url'])) $this->validates['uniqueness_of']['sef_url'] = array();\n }\n\n // safeguard again loc data not being pass via forms...sometimes this happens when you're in a router\n // mapped view and src hasn't been passed in via link to the form \n if (isset($this->id) && empty($this->location_data)) {\n $loc = $db->selectValue($this->tablename, 'location_data', 'id=' . $this->id);\n if (!empty($loc)) $this->location_data = $loc;\n }\n\n // run the validation as defined in the models\n if (!isset($this->validates)) return true;\n $messages = array();\n $post = empty($_POST) ? array() : expString::sanitize($_POST);\n foreach ($this->validates as $validation=> $field) {\n foreach ($field as $key=> $value) {\n $fieldname = is_numeric($key) ? $value : $key;\n $opts = is_numeric($key) ? array() : $value;\n $ret = expValidator::$validation($fieldname, $this, $opts);\n if (!is_bool($ret)) {\n $messages[] = $ret;\n expValidator::setErrorField($fieldname);\n unset($post[$fieldname]);\n }\n }\n }\n\n if (count($messages) >= 1) expValidator::failAndReturnToForm($messages, $post);\n }", "label_name": "Base", "label": 1} {"code": " public function getDisplayName ($plural=true) {\n return Yii::t('users', '{user}', array(\n '{user}' => Modules::displayName($plural, 'Users'),\n ));\n }", "label_name": "Base", "label": 1} {"code": " public static function decode($jwt, $key = null, $verify = true)\n {\n $tks = explode('.', $jwt);\n\n if (count($tks) != 3) {\n throw new Exception('Wrong number of segments');\n }\n\n list($headb64, $payloadb64, $cryptob64) = $tks;\n\n if (null === ($header = json_decode(JWT::urlsafeB64Decode($headb64)))) {\n throw new Exception('Invalid segment encoding');\n }\n\n if (null === $payload = json_decode(JWT::urlsafeB64Decode($payloadb64))) {\n throw new Exception('Invalid segment encoding');\n }\n\n $sig = JWT::urlsafeB64Decode($cryptob64);\n\n if ($verify) {\n if (empty($header->alg)) {\n throw new DomainException('Empty algorithm');\n }\n\n if (!JWT::verifySignature($sig, \"$headb64.$payloadb64\", $key, $header->alg)) {\n throw new UnexpectedValueException('Signature verification failed');\n }\n }\n\n return $payload;\n }", "label_name": "Class", "label": 2} {"code": " function getFontSize()\n {\n $fs = $GLOBALS['PMA_Config']->get('fontsize');\n if (!is_null($fs)) {\n return $fs;\n }\n if (isset($_COOKIE['pma_fontsize'])) {\n return $_COOKIE['pma_fontsize'];\n }\n return '82%';\n }", "label_name": "Base", "label": 1} {"code": " public function testInvalidRequests($requestRange)\n {\n $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag();\n\n // prepare a request for a range of the testing file\n $request = Request::create('/');\n $request->headers->set('Range', $requestRange);\n\n $response = clone $response;\n $response->prepare($request);\n $response->sendContent();\n\n $this->assertEquals(416, $response->getStatusCode());\n #$this->assertEquals('', $response->headers->get('Content-Range'));\n }", "label_name": "Base", "label": 1} {"code": " public function __construct(AuthManager $auth, Repository $config)\n {\n $this->lockoutTime = $config->get('auth.lockout.time');\n $this->maxLoginAttempts = $config->get('auth.lockout.attempts');\n\n $this->auth = $auth;\n $this->config = $config;\n }", "label_name": "Class", "label": 2} {"code": " function reset_stats() {\n// global $db;\n\n // reset the counters\n// $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1');\n banner::resetImpressions();\n// $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1');\n banner::resetClicks();\n \n // let the user know we did stuff. \n flash('message', gt(\"Banner statistics reset.\"));\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " public static function meta($cont_title='', $cont_desc='', $pre =''){\n global $data;\n //print_r($data);\n //if(empty($data['posts'][0]->title)){ \n\n if(is_array($data) && isset($data['posts'][0]->title)){\n \n $sitenamelength = strlen(Options::get('sitename'));\n $limit = 70-$sitenamelength-6;\n $cont_title = substr(Typo::Xclean(Typo::strip($data['posts'][0]->title)),0,$limit);\n $titlelength = strlen($data['posts'][0]->title);\n if($titlelength > $limit+3) { $dotted = \"...\";} else {$dotted = \"\";}\n $cont_title = \"{$pre} {$cont_title}{$dotted} - \";\n }else{\n $cont_title = \"\";\n }\n if(is_array($data) && isset($data['posts'][0]->content)){\n $desc = Typo::strip($data['posts'][0]->content);\n }else{\n $desc = \"\";\n }\n\n $meta = \"\n \n \n
\n\t\t\t \n\t\t\tID );\n\t\t\techo wp_basename( $file );\n\t\t\t?>\n\t\t
\n\t\tsubtaskModel->getById($this->request->getIntegerParam('subtask_id'));\n\n if (empty($subtask)) {\n throw new PageNotFoundException();\n }\n\n return $subtask;\n }", "label_name": "Class", "label": 2} {"code": " public function showUnpublished() {\n expHistory::set('viewable', $this->params);\n \n // setup the where clause for looking up records.\n $where = parent::aggregateWhereClause();\n $where = \"((unpublish != 0 AND unpublish < \".time().\") OR (publish > \".time().\")) AND \".$where;\n if (isset($this->config['only_featured'])) $where .= ' AND is_featured=1';\n\n $page = new expPaginator(array(\n 'model'=>'news',\n 'where'=>$where,\n 'limit'=>25,\n 'order'=>'unpublish',\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->baseclassname,\n 'action'=>$this->params['action'],\n 'src'=>$this->loc->src,\n 'columns'=>array(\n gt('Title')=>'title',\n gt('Published On')=>'publish',\n gt('Status')=>'unpublish'\n ),\n ));\n \n assign_to_template(array(\n 'page'=>$page\n ));\n }", "label_name": "Base", "label": 1} {"code": "\tfunction edit() {\n\t if (empty($this->params['content_id'])) {\n\t flash('message',gt('An error occurred: No content id set.'));\n expHistory::back(); \n\t } \n /* The global constants can be overridden by passing appropriate params */\n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n \n\t $id = empty($this->params['id']) ? null : $this->params['id'];\n\t $comment = new expComment($id);\n //FIXME here is where we might sanitize the comment before displaying/editing it\n\t\tassign_to_template(array(\n\t\t 'content_id'=>$this->params['content_id'],\n 'content_type'=>$this->params['content_type'],\n\t\t 'comment'=>$comment\n\t\t));\n\t}\t", "label_name": "Base", "label": 1} {"code": " private function mailPassthru($to, $subject, $body, $header, $params)\n {\n //Check overloading of mail function to avoid double-encoding\n if (ini_get('mbstring.func_overload') & 1) {\n $subject = $this->secureHeader($subject);\n } else {\n $subject = $this->encodeHeader($this->secureHeader($subject));\n }\n if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {\n $result = @mail($to, $subject, $body, $header);\n } else {\n $result = @mail($to, $subject, $body, $header, $params);\n }\n return $result;\n }", "label_name": "Compound", "label": 4} {"code": " function ac_sigleme($str, $name, $id) {\n global $cms_db, $sess;\n\n $sess->gc( true );\n\t if( $id >= 1 && $this->session_enabled ) {\n $this->db->query(sprintf(\"delete from %s where name = '%s' and sid != '%s' and user_id = '%s'\",\n $cms_db[sessions],\n addslashes($name),\n $str,\n $id));\n }\n }", "label_name": "Base", "label": 1} {"code": " public static function url() {\r\n return Site::$url.'/inc/lib/Vendor';\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function validateReference()\n {\n $docElem = $this->sigNode->ownerDocument->documentElement;\n if (! $docElem->isSameNode($this->sigNode)) {\n if ($this->sigNode->parentNode != null) {\n $this->sigNode->parentNode->removeChild($this->sigNode);\n }\n }\n $xpath = $this->getXPathObj();\n $query = \"./secdsig:SignedInfo/secdsig:Reference\";\n $nodeset = $xpath->query($query, $this->sigNode);\n if ($nodeset->length == 0) {\n throw new Exception(\"Reference nodes not found\");\n }\n\n /* Initialize/reset the list of validated nodes. */\n $this->validatedNodes = array();\n\n foreach ($nodeset AS $refNode) {\n if (! $this->processRefNode($refNode)) {\n /* Clear the list of validated nodes. */\n $this->validatedNodes = null;\n throw new Exception(\"Reference validation failed\");\n }\n }\n return true;\n }", "label_name": "Base", "label": 1} {"code": " public function AddAddress($address, $name = '') {\n return $this->AddAnAddress('to', $address, $name);\n }", "label_name": "Class", "label": 2} {"code": " function edit_order_item() {\n $oi = new orderitem($this->params['id'], true, true);\n if (empty($oi->id)) {\n flash('error', gt('Order item doesn\\'t exist.'));\n expHistory::back();\n }\n $oi->user_input_fields = expUnserialize($oi->user_input_fields);\n $params['options'] = $oi->opts;\n $params['user_input_fields'] = $oi->user_input_fields;\n $oi->product = new product($oi->product->id, true, true);\n if ($oi->product->parent_id != 0) {\n $parProd = new product($oi->product->parent_id);\n //$oi->product->optiongroup = $parProd->optiongroup; \n $oi->product = $parProd;\n }\n //FIXME we don't use selectedOpts?\n// $oi->selectedOpts = array();\n// if (!empty($oi->opts)) {\n// foreach ($oi->opts as $opt) {\n// $option = new option($opt[0]);\n// $og = new optiongroup($option->optiongroup_id);\n// if (!isset($oi->selectedOpts[$og->id]) || !is_array($oi->selectedOpts[$og->id]))\n// $oi->selectedOpts[$og->id] = array($option->id);\n// else\n// array_push($oi->selectedOpts[$og->id], $option->id);\n// }\n// }\n //eDebug($oi->selectedOpts);\n\n assign_to_template(array(\n 'oi' => $oi,\n 'params' => $params\n ));\n }", "label_name": "Base", "label": 1} {"code": "function PMA_Process_formset(FormDisplay $form_display)\n{\n if (filter_input(INPUT_GET, 'mode') == 'revert') {\n // revert erroneous fields to their default values\n $form_display->fixErrors();\n PMA_generateHeader303();\n }\n\n if (!$form_display->process(false)) {\n // handle form view and failed POST\n $form_display->display(true, true);\n return;\n }\n\n // check for form errors\n if (!$form_display->hasErrors()) {\n PMA_generateHeader303();\n return;\n }\n\n // form has errors, show warning\n $separator = PMA_URL_getArgSeparator('html');\n $page = filter_input(INPUT_GET, 'page');\n $formset = filter_input(INPUT_GET, 'formset');\n $formset = $formset ? \"{$separator}formset=$formset\" : '';\n $formId = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);\n if ($formId === null && $page == 'servers') {\n // we've just added a new server, get its id\n $formId = $form_display->getConfigFile()->getServerCount();\n }\n $formId = $formId ? \"{$separator}id=$formId\" : '';\n ?>\nNo data
';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ui.editor.isChromelessView())\n\t\t\t{\n\t\t\t\tvar button = document.createElement('button');\n\t\t\t\tbutton.setAttribute('title', 'Click or Shift+Click to write data for all selected cells to the browser console');\n\t\t\t\tbutton.style['float'] = 'none';\n\t\t\t\tmxUtils.write(button, 'Write to Console');\n\n\t\t\t\tmxEvent.addListener(button, 'click', function(evt)\n\t\t\t\t{\n\t\t\t\t\textractData(evt);\n\t\t\t\t});\n\n\t\t\t\tdiv.appendChild(button);\n\t\t\t}\n\t\t}\n\t};", "label_name": "Base", "label": 1} {"code": "\twp.updates.showErrorInCredentialsForm = function( message ) {\n\t\tvar $modal = $( '.notification-dialog' );\n\n\t\t// Remove any existing error.\n\t\t$modal.find( '.error' ).remove();\n\n\t\t$modal.find( 'h3' ).after( '