Register for your free account! | Forgot your password?

You last visited: Today at 18:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE] Website based on MVC

Discussion on [RELEASE] Website based on MVC within the Shaiya PServer Guides & Releases forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
[RELEASE] Website based on MVC

Hello everyone, after my last presentation () of how the sites around are obsolete, I want to release a "free" version of my project.

There is not really much, I worked to improve its base, but it is an idea for those who want to try working with this framework.

First of all, we need:
Code:
php >=5.6, 
OpenSSL extension, 
PDO extension, 
Intl extension
once you enable these php extensions, we need to fix our database, with small query.

Code:
ALTER TABLE PS_UserData.dbo.Users_Master
ADD CONSTRAINT PK_UID PRIMARY KEY (UserUID)
Q. why need add this "PRIMARY KEY"
A. Yii2 working with identity, so need that table have a primary key for idenity user.

then :
Code:
ALTER TABLE  PS_UserData.dbo.Users_Master
ALTER COLUMN Enpassword varchar(60)
Q. why use "Enpassword" ?
A. because yii2 uses a level of encryption and decryption, currently the unencrypted password is saved in the database, so the game will work the same.

remember to always change our sqlserver username and password,
Code:
Example folder location:
C:\xampp\htdocs\yii-advanced\common\config\main-local.php

edit:
$db_user    = 'sa';
$db_psw     = 'Shaiya123';
$db_host    = '127.0.0.1';
If everything went well, the site should show itself in front of you

I leave some screens of the pages already created.

Yii2 Website

Please leave a comment with your thoughts, advice, suggestions ...


■ Features
  • register
  • login
  • pvpranking
  • news
  • event
  • patch note
  • server time
  • grb time
  • slider image
  • information page

Code:
ChangeLog:
V1.2:

• News
• Events
• Patch Notes
• Slider image
• Server time
• grb time countdown
• new style pure dark added

V1:

• Login
• Register
• PvP Ranking
• Information page
Download information later
[MXD]Takeshi is offline  
Thanks
6 Users
Old 10/23/2018, 02:13   #2
 
elite*gold: 0
Join Date: Apr 2017
Posts: 39
Received Thanks: 18
Great work, looking forward to the future
Wa7dani is offline  
Old 10/23/2018, 19:31   #3
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
Quote:
Originally Posted by Wa7dani View Post
Great work, looking forward to the future
Thanks, I wanted someone to comment on the work, with a first installation experience
[MXD]Takeshi is offline  
Old 10/24/2018, 21:30   #4
 
MC Flip's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 1,017
Received Thanks: 1,161
If you need feeback, I can help you out.

However, you might want to post intructions on what to do with those files, as it is not you typical pages and folders you slap onto a webserver and it works.

With your release I get some frontend, backend, console, vendor, etc folders. What should I do with those to get a functional site?
MC Flip is offline  
Old 10/24/2018, 23:07   #5
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
XAMPP - WAMPP Configuration

Quote:
Originally Posted by MC Flip View Post
If you need feeback, I can help you out.

However, you might want to post intructions on what to do with those files, as it is not you typical pages and folders you slap onto a webserver and it works.

With your release I get some frontend, backend, console, vendor, etc folders. What should I do with those to get a functional site?
to give an explanation of what the folders are for ....

Code:
Directories
The root directory contains the following subdirectories:

backend - backend web application.
common - files common to all applications.
console - console application.
environments - environment configs.
frontend - frontend web application.

inpratica the work project is divided into 2 web applications, * end, which indicate 2 different sites, frontend -> what users will see, backend -> in practice an admin panel ...

common -> is in common among the working groups, here it is good to save our model (database), because so we have the possibility to recall the function both in backend and frontend

above I wrote the php requirements, they are all extensions that need to be enabled.

Set document roots of your web server:
  • for frontend /path/to/yii-application/frontend/web/ and using the URL
  • for backend /path/to/yii-application/backend/web/ and using the URL

For Apache it could be the following:

Code:
<VirtualHost *:80>
        ServerName frontend.dev
        DocumentRoot "/path/to/yii-application/frontend/web/"
           
        <Directory "/path/to/yii-application/frontend/web/">
            # use mod_rewrite for pretty URL support
            RewriteEngine on
            # If a directory or a file exists, use the request directly
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            # Otherwise forward the request to index.php
            RewriteRule . index.php

            # use index.php as index file
            DirectoryIndex index.php

            # ...other settings...
        </Directory>
    </VirtualHost>
       
    <VirtualHost *:80>
        ServerName backend.dev
        DocumentRoot "/path/to/yii-application/backend/web/"
           
        <Directory "/path/to/yii-application/backend/web/">
            # use mod_rewrite for pretty URL support
            RewriteEngine on
            # If a directory or a file exists, use the request directly
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            # Otherwise forward the request to index.php
            RewriteRule . index.php

            # use index.php as index file
            DirectoryIndex index.php

            # ...other settings...
        </Directory>
    </VirtualHost>
Add the following lines to hosts file:
Code:
127.0.0.1 y2aa-frontend.dev
127.0.0.1 y2aa-backend.dev
if there are doubts, or something is wrong, just ask

I had left a documentation of Yii, so I thought these things were a little clear
[MXD]Takeshi is offline  
Old 10/25/2018, 01:17   #6
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
@ You know that people aren't able to use it, right?
SnickQ is offline  
Old 10/25/2018, 16:09   #7
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
Quote:
Originally Posted by SnickQ View Post
@ You know that people aren't able to use it, right?
well... good know, if i sell full project and install it, noone can shared....

anyway, have you been able to install it?
what have you seen, thought... more...
[MXD]Takeshi is offline  
Old 10/25/2018, 17:00   #8
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
I was try instal it as normal ASP site and and as normal site. When i clic on any php i have "Connot open this site"
But i put it into iis (7.2 php drives) i dont have xamp
SnickQ is offline  
Old 10/25/2018, 17:40   #9
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
Quote:
Originally Posted by SnickQ View Post
I was try instal it as normal ASP site and and as normal site. When i clic on any php i have "Connot open this site"
But i put it into iis (7.2 php drives) i dont have xamp
you do not need XAMPP, I left a configuration for xampp, if you know IIS you can easily confirm it ...

however I would like to see your mistake, and find a solution
[MXD]Takeshi is offline  
Old 10/28/2018, 17:10   #10
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
#Bump new features - style
[MXD]Takeshi is offline  
Thanks
1 User
Old 11/06/2018, 14:16   #11
 
elite*gold: 0
Join Date: Nov 2018
Posts: 2
Received Thanks: 2
I noticed some of the fundamental security flaws that may afflict your PHP application.

To avoid it do the following steps;
  • Turn SSL on at all times
  • Hide all version numbers
  • Always keep your errors in privatelogs and away from the public
  • Disable potentially harmful functions

I’ll cover a few more potentially harmful injection attacks that you are susceptible to;
  • Shell Injection
  • eval() function
  • File Inclusion - include() or require()

Storing secure data such as the following should be given a security audit for both the sake of your visitors and for compliance;
  • E-mail addresses
  • Dates of birth
  • Credit reports & Bank account information (donation stuff)
    ... and more


Besides that, great work with that one! Keep it updated.
[Admin]Divi is offline  
Old 11/06/2018, 14:45   #12
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
Quote:
Originally Posted by [Admin]Divi View Post
I noticed some of the fundamental security flaws that may afflict your PHP application.

To avoid it do the following steps;
  • Turn SSL on at all times
  • Hide all version numbers
  • Always keep your errors in privatelogs and away from the public
  • Disable potentially harmful functions

I’ll cover a few more potentially harmful injection attacks that you are susceptible to;
  • Shell Injection
  • eval() function
  • File Inclusion - include() or require()

Storing secure data such as the following should be given a security audit for both the sake of your visitors and for compliance;
  • E-mail addresses
  • Dates of birth
  • Credit reports & Bank account information (donation stuff)
    ... and more


Besides that, great work with that one! Keep it updated.
Hello and thanks for the reply.

there are different levels of debugging, and we can decide what and when to show it, for example there is a debug bar, which shows the "DEV" requests, used assets, databases in use and much more, I am releasing versions for "DEV" "so I did not remove the debugging levels.

Shell injector is possible in few cases, with the files that have been releasing there is little to inject, to say nothing, shell commands are blocked here.

the "include" or "require" is never used, it is all managed by assets


the data security currently entered is not entered xD data
[MXD]Takeshi is offline  
Old 12/10/2018, 06:44   #13
 
elite*gold: 0
Join Date: Nov 2018
Posts: 23
Received Thanks: 4
having issue with the routing view

Hello i mange to run the application but i always end up having file directory issue every time i go to any pages ill end up 404 ,

site/login

the folder site does not exist in web folder ..
copain is offline  
Old 12/10/2018, 12:44   #14
 
[MXD]Takeshi's Avatar
 
elite*gold: 0
Join Date: Nov 2017
Posts: 137
Received Thanks: 148
iis configuration

Quote:
Originally Posted by copain View Post
Hello i mange to run the application but i always end up having file directory issue every time i go to any pages ill end up 404 ,

site/login

the folder site does not exist in web folder ..
your website does not point to the right directory

for IIS:
FIRST:
Make sure you have installed URL Rewrite on your IIS7

If you have the web.config configuration, and it is still routing to a physical directory and not to the controller/action route, it almost 100% means that your are missing URL Rewrite. Yes this is an addon that is not necessarily installed.

So go ahead, download and install it on your ISS from



SECOND:
This is the web.config that is actually working. Notice that I ended with: match url=".*" and also notice that I added a line to handle images and other static content.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <configSections>
        <sectionGroup name="system.webServer">
            <sectionGroup name="rewrite">
                <section name="rewriteMaps" overrideModeDefault="Allow" />
                <section name="rules" overrideModeDefault="Allow" />
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Yii2 Routing that works" stopProcessing="true">
                    <match url=".*" />
                    <conditions  logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />                            
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
remember to update update code for
Code:
C:\webroot****\www\backend\web\web.config
C:\webroot****\www\frontend\web\web.config
[MXD]Takeshi is offline  
Old 12/10/2018, 17:06   #15
 
elite*gold: 0
Join Date: Nov 2018
Posts: 23
Received Thanks: 4
which files hadles the pages directory?

i am using plesk in windows server 2016 the root dir is htdoc apatche,i have configure the web config to point it on my, db.. which folder or file hadles the page directory?
copain is offline  
Reply

Tags
bootstrap, no sqlinjector, shaiya, website, yii2


Similar Threads Similar Threads
Shaiya mvc framework website
07/01/2016 - Shaiya PServer Development - 0 Replies
Hello I would like to start a new project for shaiya servers. But I would like some input first before I start. The project will be a website built on bootstrap framework. Reason? So your players can access there account via cell/tablet. What I want to ask is what do you think the website should have in it? Should it use a separate login other than game? Should it have an item mall? Etc No bashing or hating I'm just trying to give back to the community.
Verständniss MVC
01/24/2014 - Web Development - 8 Replies
Heyho Com. Habe eig nur ein paar Verständnissfragen zum MVC Modell. MVC steht für Model _ kümmert sich um die besorgung der Daten View _ Erzeugt den HTML Code / Die Ausgabe die an den User gereicht wird Controller _ Verbindet das Model mit den View und teilt die Aufgaben zu. Ordner Struktur
[ASP.Net-Website MVC 4 | C#] Informationen einer MySQL Datenbank in Tabelle ausgeben
07/22/2013 - .NET Languages - 0 Replies
Guten Tag liebe Community, zurück auf der Arbeit nach einem langen entspannten Wochenende in der Shishabar habe ich wieder eine Frage an euch. Das zuletzt gestellte Problem mit den Sessions welche beim Login übergeben werden sollten habe ich dann nach 4 Stunden Arbeit bzw. rumprobieren gelöst: (Dieser Thread: http://www.elitepvpers.com/forum/net-languages/272 9073-asp-net-website-razor-v2-login-berpr-fung-auf -den-anderen-seiten.html )
[S][Java] MVC-Fragen beantworten
07/06/2013 - General Coding - 2 Replies
Hallo, ich bin momentan auf der Suche nach einem Java-Programmierer, der MVC kann. Es geht hierbei um ein Projekt, dass ich nach dem MVC-Pattern umbauen will, dabei komme ich jedoch nicht weiter und benötige demnach Hilfe. Kann mir hierbei jemand über Skype helfen und gewisse Fragen beantworten? Grüße hallo6
DarkNight 1.3.2 [Bukkit][cracked] Jobs, MVC, LWC
08/26/2012 - Minecraft Server Advertising - 0 Replies
Hallo, der Bukkit-Server DarkNight mit 10 Slots braucht noch Spieler. Er ist schon seit 3 1/2 Monaten online und hat schon jede Menge nette Spieler. Es ist gibt Grundstücke und ein/e Freebuilding-Bereich/Welt. Der Server wird noch erweitert. Trailer: Der Trailer IP:



All times are GMT +1. The time now is 18:01.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.