function OnInit($param) { parent::onInit($param); include "config.php"; $repositoryid = $_GET['RepositoryID']; $results = $this->Module->Database->Execute("SELECT * FROM repositories WHERE id=" . makeSqlString($repositoryid)); $fields = $results->fields; $ownerid = $fields['ownerid']; $name = $fields['name']; if (!$this->User->isAdmin() && $this->User->getId() != $ownerid) { echo "Not enough rights to change this repository!"; exit(-1); } $servername = $_SERVER['SERVER_NAME']; $page = $_SERVER['PHP_SELF']; $port = $_SERVER['SERVER_PORT']; if ($port == '443') { $prot = "https"; } else { $prot = "http"; if ($port != '80') { $servername .= ":{$port}"; } } $url = $prot . "://{$servername}{$page}?page=Repository:DumpOutputPage&RepositoryID={$repositoryid}"; $this->StartLink->setNavigateUrl("{$url}"); header("Refresh: 3; URL={$url}"); }
public function onInit($param) { parent::onInit($param); if ($this->Module->getUserParameter('AllowNewAccount') === 'false') { $this->Application->transfer(); } }
public function onInit($param) { parent::onInit($param); $repositoryid = $_GET['RepositoryID']; $results = $this->Module->Database->Execute("SELECT * FROM repositories WHERE id=" . makeSqlString($repositoryid)); $fields = $results->fields; $ownerid = $fields['ownerid']; if (!$this->User->isAdmin() && $this->User->getId() != $ownerid) { echo "Not enough rights to change this repository!"; exit(-1); } $this->setSelectedRepository($repositoryid); $ownername = $this->Module->getUserName($ownerid); $repositoryname = $this->Module->getRepositoryname($repositoryid); $this->RepositoryName->setText($repositoryname); $this->RepositoryOwner->setText($ownername); //Reproduce dynamic buttons for proper event handling (something is not completely right, Prado!) $sess = $this->Application->getSession(); if ($sess->has("linkbuttons")) { $linkbuttons = $sess->get("linkbuttons"); foreach ($linkbuttons as $lb) { $this->PathHolder->addChild($lb); $this->PathHolder->addBody($lb); } $sess->clear("linkbuttons"); } if ($sess->has("listbox")) { $listbox = $sess->get("listbox"); $this->PathHolder->addChild($listbox); $this->PathHolder->addBody($listbox); $sess->clear("listbox"); } }
public function onInit($param) { parent::onInit($param); if (!$this->isPostBack) { switch ($this->Request['modus']) { case 0: $sql = "SELECT idtm_waren_kategorie, waren_kategorie_name FROM tm_waren_kategorie"; $data = PFH::convertdbObjectArray(WarenKategorieRecord::finder()->findAllBySql($sql), array("idtm_waren_kategorie", "waren_kategorie_name")); $this->idtm_waren_kategorie->DataSource = $data; $this->idtm_waren_kategorie->dataBind(); $sql = "SELECT idtm_preis_kategorie, preis_kategorie_name FROM tm_preis_kategorie"; $data = PFH::convertdbObjectArray(PreisKategorieRecord::finder()->findAllBySql($sql), array("idtm_preis_kategorie", "preis_kategorie_name")); $this->idtm_preis_kategorie->DataSource = $data; $this->idtm_preis_kategorie->dataBind(); $this->bindList(); break; case 1: $sql = "SELECT idtm_waren_kategorie, waren_kategorie_name FROM tm_waren_kategorie"; $data = PFH::convertdbObjectArray(WarenKategorieRecord::finder()->findAllBySql($sql), array("idtm_waren_kategorie", "waren_kategorie_name")); $this->edidtm_waren_kategorie->DataSource = $data; $this->edidtm_waren_kategorie->dataBind(); $sql = "SELECT idtm_preis_kategorie, preis_kategorie_name FROM tm_preis_kategorie"; $data = PFH::convertdbObjectArray(PreisKategorieRecord::finder()->findAllBySql($sql), array("idtm_preis_kategorie", "preis_kategorie_name")); $this->edidtm_preis_kategorie->DataSource = $data; $this->edidtm_preis_kategorie->dataBind(); $this->fillValues($this->getSelected($this->Request['idta_waren'])); $this->bindListed(); break; default: break; } $this->viewPanel->ActiveViewIndex = $this->Request['modus']; } }
public function onInit($param) { parent::onInit($param); $userid = $_GET['UserID']; if (!$this->User->isAdmin() && $userid != $this->User->getId()) { echo "Not enough rights to change this user!"; exit(-1); } $results = $this->Module->Database->Execute("SELECT * FROM users WHERE id=" . makeSqlString($userid)); $fields = $results->fields; $user = array('id' => $fields['id'], 'name' => $fields['name'], 'email' => $fields['email'], 'admin' => $fields['admin'], 'grants' => $fields['repositorygrants']); $this->setSelectedUser($user); $this->UserID->setText($fields['id']); $this->UserName->setText($fields['name']); $this->Email->setText($fields['email']); if ($fields['admin'] == 255) { $this->Admin->setChecked(true); } else { $this->Admin->setChecked(false); } $this->Grants->setText($fields['repositorygrants']); if (!$this->User->isAdmin()) { $this->Grants->setEnabled(false); $this->Admin->setEnabled(false); } else { $this->Grants->setEnabled(true); $this->Admin->setEnabled(true); } }
/** * (non-PHPdoc) * @see TControl::onInit() */ public function onInit($param) { parent::onInit($param); if (get_class($this) !== 'LoginController') { $this->getForm()->setAttribute('onSubmit', 'return false;'); } }
function OnInit($param) { parent::onInit($param); include "config.php"; $repositoryid = $_GET['RepositoryID']; $results = $this->Module->Database->Execute("SELECT * FROM repositories WHERE id=" . makeSqlString($repositoryid)); $fields = $results->fields; $ownerid = $fields['ownerid']; $name = $fields['name']; if (!$this->User->isAdmin() && $this->User->getId() != $ownerid) { echo "Not enough rights to change this repository!"; exit(-1); } $filename = $name . ".dump"; if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT'])) { // IE Bug in download name workaround error_log("ini_set"); ini_set('zlib.output_compression', 'Off'); } header('Cache-Control:'); header('Pragma:'); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"{$filename}\""); header("Content-Transfer-Encoding: binary"); passthru($svnadmin_cmd . " dump " . $svn_repos_loc . DIRECTORY_SEPARATOR . $name); exit(0); //$this->Application->transfer('Repository:AdminPage'); }
public function onInit($param) { parent::onInit($param); if (!$this->isPostBack) { switch ($this->Request['modus']) { case 0: $sql = "SELECT idtm_country, country_ful FROM tm_country"; $data = PFH::convertdbObjectArray(CountryRecord::finder()->findAllBySql($sql), array("idtm_country", "country_ful")); $this->Country->DataSource = $data; $this->Country->dataBind(); $this->idta_partei->Data = $this->Request['idta_partei']; break; case 1: $sql = "SELECT idtm_country, country_ful FROM tm_country"; $data = PFH::convertdbObjectArray(CountryRecord::finder()->findAllBySql($sql), array("idtm_country", "country_ful")); $this->edCountry->DataSource = $data; $this->edCountry->dataBind(); $this->fillValues($this->getSelected($this->Request['idta_adresse'])); break; default: break; } $this->viewPanel->ActiveViewIndex = $this->Request['modus']; } }
public function onInit($param) { parent::onInit($param); //Globale definition f�r dieses Dokument $this->finder = StrukturRecord::finder(); $this->MASTERRECORD = new StrukturRecord(); if (!$this->isPostBack && !$this->isCallback) { switch ($this->Request['modus']) { case 0: $sql = "SELECT idta_struktur_type, struktur_type_name FROM ta_struktur_type"; $data = PFH::convertdbObjectArray(StrukturTypeRecord::finder()->findAllBySql($sql), array("idta_struktur_type", "struktur_type_name")); $this->idta_struktur_type->DataSource = $data; $this->idta_struktur_type->dataBind(); $HRKEYTest = new PFHierarchyPullDown(); $HRKEYTest->setStructureTable("tm_struktur"); $HRKEYTest->setRecordClass(StrukturRecord::finder()); $HRKEYTest->setPKField("idtm_struktur"); $HRKEYTest->setField("struktur_name"); $HRKEYTest->letsrun(); $this->parent_idtm_struktur->DataSource = $HRKEYTest->myTree; $this->parent_idtm_struktur->dataBind(); $this->idtm_stammdaten->DataSource = PFH::build_SQLPullDown(StammdatenRecord::finder(), "tm_stammdaten", array("idtm_stammdaten", "stammdaten_name")); $this->idtm_stammdaten->dataBind(); break; case 1: $sql = "SELECT idta_struktur_type, struktur_type_name FROM ta_struktur_type"; $data = PFH::convertdbObjectArray(StrukturTypeRecord::finder()->findAllBySql($sql), array("idta_struktur_type", "struktur_type_name")); $this->edidta_struktur_type->DataSource = $data; $this->edidta_struktur_type->dataBind(); if ($this->Request[$this->primarykey] != 1) { $HRKEYTest = new PFHierarchyPullDown(); $HRKEYTest->setStructureTable("tm_struktur"); $HRKEYTest->setRecordClass(StrukturRecord::finder()); $HRKEYTest->setPKField("idtm_struktur"); $HRKEYTest->setField("struktur_name"); $HRKEYTest->letsrun(); $data = $HRKEYTest->myTree; } else { $data = array(); $data[0] = "START"; } $this->edparent_idtm_struktur->DataSource = $data; $this->edparent_idtm_struktur->dataBind(); $this->fillValues($this->getSelected($this->Request[$this->primarykey])); $this->edidtm_stammdaten->DataSource = PFH::build_SQLPullDown(StammdatenRecord::finder(), "tm_stammdaten", array("idtm_stammdaten", "stammdaten_name")); $this->edidtm_stammdaten->dataBind(); $Usersql = "SELECT idtm_user, user_name FROM tm_user"; $Userdata = PFH::convertdbObjectArray(UserRecord::finder()->findAllBySql($Usersql), array("idtm_user", "user_name")); $this->idtm_user->DataSource = $Userdata; $this->idtm_user->dataBind(); $this->loadBerechtigung(); break; default: break; } $this->viewPanel->ActiveViewIndex = $this->Request['modus']; $this->StrukturStammdatenGroupContainer->RCedidtm_struktur->Text = $this->Request[$this->primarykey]; } }
public function onInit($param) { parent::onInit($param); if (!$this->getIsPostBack() && !$this->getIsCallBack()) { $this->populateProductList(); $this->populateShoppingList(); } }
public function onInit($param) { parent::onInit($param); if (isset($_GET['ticket'])) { $this->setTicket($_GET['ticket']); } $this->dataBind(); }
/** * Populates the datagrid with user lists. * This method is invoked by the framework when initializing the page * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); // fetches all data account information $this->UserGrid->DataSource = UserRecord::finder()->findAll(); // binds the data to interface components $this->UserGrid->dataBind(); }
public function onInit($param) { $this->session = $this->Application->getSession(); if ($this->page->isCallback && $this->page->isPostBack) { $this->reRenderTable(); } parent::onInit($param); }
public function onInit($param) { parent::onInit($param); $session = $this->getSession(); if (!$session->getIsStarted()) { $session->open(); } }
public function onInit($param) { parent::onInit($param); if (!$this->isPostBack() && !$this->Module->hasGrants()) { echo "Not enough rights or grants to create Repository"; exit(-1); } }
public function onInit($param) { parent::onInit($param); $label = new TLabel(); $label->Text = 'dynamic'; $label->BackColor = 'silver'; $this->PlaceHolder1->Controls[] = $label; $this->PlaceHolder1->Controls[] = ' content'; }
/** * Initializes the repeater. * This method is invoked by the framework when initializing the page * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); if (!$this->IsPostBack) { // get the total number of posts available $this->Repeater->VirtualItemCount = PostRecord::finder()->count(); // populates post data into the repeater $this->populateData(); } }
public function onInit($param) { parent::onInit($param); // Display an error message to the user if they are not // an administrator. if (!$this->User->isAdmin()) { echo "Access Denied"; exit(-1); } }
public function onInit($param) { parent::onInit($param); // For non-admin users, make sure they are allowed to create // additional repositories. if (!$this->Module->hasGrants()) { echo "You cannot create any additional repositories."; exit(-1); } }
public function onInit($param) { parent::onInit($param); // redirects the browser to some other page $url = $this->Service->constructUrl('problems.ListProblems', array('chapter' => 2)); $this->Response->redirect($url); //$e = new Expression('sin(x)+1/y'); //$t = '$'.$e->latex().'$'; //$this->test=$t; }
public function onInit($param) { $this->session = $this->Application->getSession(); if (!$this->isPostBack && !$this->isCallback) { $this->createTable(); $this->session['dynamicControlList'] = $this->dynamicControlList; } else { $this->reRenderTable(); } parent::onInit($param); }
public function onInit($param) { parent::onInit($param); if (!$this->IsPostBack) { $properties = $this->ClassDefinition->Properties; $properties[] = new PropertyDefinition(); $properties[] = new PropertyDefinition(); $properties[] = new PropertyDefinition(); $this->PropertyList->DataSource = $properties; $this->dataBind(); } }
function onInit($param) { parent::onInit($param); $this->Database->setDataSourceName($this->Application->getUserParameter('DSN')); if (!$this->isPostBack()) { $result = $this->Database->Execute("SELECT username FROM tblUser"); $this->userDisplay->setDataTextField("username"); $this->userDisplay->setDataValueField("username"); $this->userDisplay->setDataSource($result); $this->userDisplay->dataBind(); } }
public function onInit($param) { $this->session = $this->Application->getSession(); if (!$this->page->isCallback || !$this->page->isPostBack) { $finder = UserFelderRecord::finder(); $finder->deleteAll('user_id = ?', $this->User->getUserId()); $this->initTable(); $this->session['dynamicControlList'] = $this->dynamicControlList; } else { $this->reRenderTable(); } parent::onInit($param); }
/** * Fetches the post data. * This method is invoked by the framework when initializing the page * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); // post id is passed via the 'id' GET parameter $postID = (int) $this->Request['id']; // retrieves PostRecord with author information filled in $this->_post = PostRecord::finder()->withAuthor()->findByPk($postID); if ($this->_post === null) { // if post id is invalid throw new BlogException(500, 'Unable to find the specified post.'); } // set the page title as the post title $this->Title = $this->_post->title; }
public function onInit($param) { parent::onInit($param); //Globale definition f�r dieses Dokument $this->finder = RisikoRecord::finder(); $this->MASTERRECORD = new RisikoRecord(); if (!$this->isPostBack) { switch ($this->Request['modus']) { case 0: $sql = "SELECT idta_risiko_type, ris_type_name FROM ta_risiko_type"; $data = PFH::convertdbObjectArray(RisikoTypeRecord::finder()->findAllBySql($sql), array("idta_risiko_type", "ris_type_name")); $this->idta_risiko_type->DataSource = $data; $this->idta_risiko_type->dataBind(); if ($this->Request[$this->primarykey] != 1) { $sql = "SELECT idtm_risiko, ris_name FROM tm_risiko ORDER BY idta_risiko_type"; $data = PFH::convertdbObjectArray(RisikoRecord::finder()->findAllBySql($sql), array("idtm_risiko", "ris_name")); } else { $data = array(); $data[0] = "START"; } $this->parent_idtm_risiko->DataSource = $data; $this->parent_idtm_risiko->dataBind(); break; case 1: $sql = "SELECT idta_risiko_type, ris_type_name FROM ta_risiko_type"; $data = PFH::convertdbObjectArray(RisikoTypeRecord::finder()->findAllBySql($sql), array("idta_risiko_type", "ris_type_name")); $this->edidta_risiko_type->DataSource = $data; $this->edidta_risiko_type->dataBind(); if ($this->Request[$this->primarykey] != 1) { $sql = "SELECT idtm_risiko, ris_name FROM tm_risiko ORDER BY idta_risiko_type"; $data = PFH::convertdbObjectArray(RisikoRecord::finder()->findAllBySql($sql), array("idtm_risiko", "ris_name")); } else { $data = array(); $data[0] = "START"; } $this->edparent_idtm_risiko->DataSource = $data; $this->edparent_idtm_risiko->dataBind(); $this->fillValues($this->getSelected($this->Request[$this->primarykey])); //$this->bindListed(); break; default: break; } $this->viewPanel->ActiveViewIndex = $this->Request['modus']; //the parameters for the RiskValueContainer $this->RCedrcv_tabelle->Text = "tm_risiko"; $this->RCedrcv_id->Text = $this->Request[$this->primarykey]; } }
/** * Initializes the inputs with existing user data. * This method is invoked by the framework when the page is being initialized. * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); if (!$this->IsPostBack) { // Retrieves the existing user data. This is equivalent to: // $userRecord=$this->getUserRecord(); $userRecord = $this->UserRecord; // Populates the input controls with the existing user data $this->Username->Text = $userRecord->username; $this->Email->Text = $userRecord->email; $this->Role->SelectedValue = $userRecord->role; $this->FirstName->Text = $userRecord->first_name; $this->LastName->Text = $userRecord->last_name; } }
/** * Initialize the page. * Init the service manager, add callback service. * Create the javascript href (URL) required for callback. * @param TEventParameter init parameters */ function onInit($param) { $module = $this->Module; if (is_null($module)) { $url = 'page=' . get_class($this) . '&'; } else { $url = 'page=' . $module->getID() . ':' . get_class($this) . '&'; } $this->service = new TService_Callback($url); if ($this->isServiceRequest()) { $serviceManager = $this->Application->getServiceManager(); $serviceManager->addService(TService_Callback::service, $this->service); } parent::onInit($param); }
/** * Populates the datagrid with user lists. * This method is invoked by the framework when initializing the page * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); if (!$this->IsPostBack) { // get the total number of posts available $criteria = new TActiveRecordCriteria(); $criteria->Condition = 'idtm_user = :idtm_user'; $criteria->Parameters[':idtm_user'] = $this->User->getUserId($this->User->Name); if (is_Object(ParteiRecord::finder()->find($criteria))) { $this->Repeater->VirtualItemCount = ParteiRecord::finder()->find($criteria)->count(); } // populates post data into the repeater $this->populateData(); } }
public function onInit($param) { parent::onInit($param); //Globale definition fuer dieses Dokument $this->finder = ZieleRecord::finder(); $this->MASTERRECORD = new ZieleRecord(); if (!$this->isPostBack) { switch ($this->Request['modus']) { case 0: $sql = "SELECT idta_ziele_type, zie_type_name FROM ta_ziele_type"; $data = PFH::convertdbObjectArray(ZieleTypeRecord::finder()->findAllBySql($sql), array("idta_ziele_type", "zie_type_name")); $this->idta_ziele_type->DataSource = $data; $this->idta_ziele_type->dataBind(); $HRKEYTest = new PFHierarchyPullDown(); $HRKEYTest->setStructureTable("tm_ziele"); $HRKEYTest->setRecordClass(ZieleRecord::finder()); $HRKEYTest->setPKField("idtm_ziele"); $HRKEYTest->setField("zie_name"); $HRKEYTest->letsrun(); $this->parent_idtm_ziele->DataSource = $HRKEYTest->myTree; $this->parent_idtm_ziele->dataBind(); $this->idtm_activity->DataSource = PFH::build_SQLPullDownAdvanced(ActivityRecord::finder(), "tm_activity", array("idtm_activity", "act_pspcode", "act_name"), "idta_activity_type = 2"); $this->idtm_activity->dataBind(); break; case 1: $sql = "SELECT idta_ziele_type, zie_type_name FROM ta_ziele_type"; $data = PFH::convertdbObjectArray(ZieleTypeRecord::finder()->findAllBySql($sql), array("idta_ziele_type", "zie_type_name")); $this->edidta_ziele_type->DataSource = $data; $this->edidta_ziele_type->dataBind(); $HRKEYTest = new PFHierarchyPullDown(); $HRKEYTest->setStructureTable("tm_ziele"); $HRKEYTest->setRecordClass(ZieleRecord::finder()); $HRKEYTest->setPKField("idtm_ziele"); $HRKEYTest->setField("zie_name"); $HRKEYTest->letsrun(); $this->edparent_idtm_ziele->DataSource = $HRKEYTest->myTree; $this->edparent_idtm_ziele->dataBind(); $this->fillValues($this->getSelected($this->Request[$this->primarykey])); $this->edidtm_activity->DataSource = PFH::build_SQLPullDownAdvanced(ActivityRecord::finder(), "tm_activity", array("idtm_activity", "act_pspcode", "act_name"), "idta_activity_type = 2"); $this->edidtm_activity->dataBind(); //$this->bindListed(); break; default: break; } $this->viewPanel->ActiveViewIndex = $this->Request['modus']; } }