public function processform() { $ulogin = ulogin::i(); $ulogin->panel = trim($_POST['panel']); $ulogin->button = trim($_POST['button']); $ulogin->save(); $alogin = tadminlogin::i(); $alogin->widget = $ulogin->addpanel($alogin->widget, $ulogin->panel); $alogin->save(); $areg = tadminreguser::i(); $areg->widget = $ulogin->addpanel($areg->widget, $ulogin->panel); $areg->save(); $tc = ttemplatecomments::i(); $tc->regaccount = $ulogin->addpanel($tc->regaccount, $ulogin->button); $tc->save(); }
function update597() { litepublisher::$site->jquery_version = '1.11.2'; litepublisher::$site->jqueryui_version = '1.11.4'; litepublisher::$site->save(); $js = tjsmerger::i(); $js->lock(); $js->after('default', '/js/plugins/jquery.cookie.min.js', '/js/plugins/tojson.min.js'); $js->after('default', '/js/litepublisher/litepublisher.utils.min.js', '/js/litepublisher/ready2.min.js'); $js->after('default', '/js/litepublisher/ready2.min.js', '/js/litepublisher/css-loader.min.js'); $js->after('default', '/js/litepublisher/css-loader.min.js', '/js/litepublisher/json-rpc.min.js'); $js->unlock(); $css = tcssmerger::i(); //$css->add('default', '/js/litepublisher/css/hover.css'); if (litepublisher::$classes->exists('ulogin')) { $ulogin = ulogin::i(); $ulogin->panel = str_replace(' ready2', ' $.ready2', $ulogin->panel); $ulogin->save(); $alogin = tadminlogin::i(); $alogin->widget = $ulogin->addpanel($alogin->widget, $ulogin->panel); $alogin->save(); $areg = tadminreguser::i(); $areg->widget = $ulogin->addpanel($areg->widget, $ulogin->panel); $areg->save(); $tc = ttemplatecomments::i(); $tc->regaccount = $ulogin->addpanel($tc->regaccount, $ulogin->button); $tc->save(); } $t = ttemplate::i(); $t->footer = str_replace('2014', '2015', $t->footer); $template = ttemplate::i(); $t->data[$js->basename] = $js->revision; $t->data[$css->basename] = $css->revision; $t->save(); //$a = tprefetchtxt::i()->items; $data = new tdata(); $data->basename = 'prefetch.txt'; $data->load(); $a = $data->data['items']; litepublisher::$classes->delete('tprefetchtxt'); litepublisher::$classes->add('appcache_manifest', 'appcache.manifest.class.php'); $c = appcache_manifest::i(); $c->items = $a; $c->save(); tredirector::i()->add('/prefetch.txt', $c->url); }
/** * Гнерация логина пользователя * в случае успешного выполнения возвращает уникальный логин пользователя * * @param $first_name * @param string $last_name * @param string $nickname * @param string $bdate * @param array $delimiters * * @return string */ function ulogin_generateNickname($first_name, $last_name = "", $delimiters = array('.', '_')) { $delim = array_shift($delimiters); $first_name = ulogin::uLoginTranslitIt($first_name); $first_name_s = substr($first_name, 0, 1); $variants = array(); if (!empty($nickname)) { $variants[] = $nickname; } $variants[] = $first_name; if (!empty($last_name)) { $last_name = ulogin::uLoginTranslitIt($last_name); $variants[] = $first_name . $delim . $last_name; $variants[] = $last_name . $delim . $first_name; $variants[] = $first_name_s . $delim . $last_name; $variants[] = $first_name_s . $last_name; $variants[] = $last_name . $delim . $first_name_s; $variants[] = $last_name . $first_name_s; } $i = 0; $exist = true; while (true) { if ($exist = ulogin::ulogin_userExist($variants[$i])) { foreach ($delimiters as $del) { $replaced = str_replace($delim, $del, $variants[$i]); if ($replaced !== $variants[$i]) { $variants[$i] = $replaced; if (!($exist = ulogin::ulogin_userExist($variants[$i]))) { break; } } } } if ($i >= count($variants) - 1 || !$exist) { break; } $i++; } return $variants[$i]; }