Hello, i have a apache2 webserver on raspberry pi running, nextcloud installed and configured to use mysql. Now I have a webserver which has a login with mysql etc., but the issue is that if i want to access my files i have to login twice and if i want to create a user, i have to create it twice. Is there a way to merge both logins?
I still want to keep the old website which (for now, but i really want to merge those 2 websites too) if you press a button it redirects you to the nextcloud login. So, which file should i change if i would like to delete some functions like settings, etc. and add my own html code? My login on the external website: `
<?php
if($_SERVER[“REQUEST_METHOD”] == “POST”)
{
$myusername1=mysqli_real_escape_string($con,$_POST[‘username’]);
$mypassword1=mysqli_real_escape_string($con,$_POST[‘password’]);
$mypassword = hash('sha256', $mypassword1);
$mypassword=MD5($mypassword);
$sql="SELECT * FROM login WHERE username='$myusername1' and password='$mypassword'";
$result=mysqli_query($con,$sql);
$row=mysqli_fetch_array($result);
$_SESSION['id']=$row['id'];
$_SESSION['username']=$row['username'];
$count=mysqli_num_rows($result);
if($count==1)
{
header ("location: ./pages/home.php");
}
else
{
$error="Your Login Name or Password is invalid";
}
}
?>
<div class="login">
<strong> Login </strong>
</div>
<div class="container">
<br><br><div class="input-field col s6">
<label>Username</label><input type = "text" name = "username"/>
</div>
<div class="input-field col s6">
<label>Password</label><input type = "password" name = "password"/>
</div>
<button class="btn waves-effect waves-light" type="submit" name="action">Prisijungti
<i class="material-icons right">send</i>
</button>
</div></div>
</form>`
@aknobbe I might not doing it right, but it doesn’t work, I didn’t find a tutorial where should i put the files, so i’ve just put it in the apps folder… I understand how it works, but where should i add the new files and yea, that is mostly what I am looking for.
Gebruikt je nog Dropbox, Google Drive en WeTransfer?
Stap eenvoudig over op Boxu een maak gebruik van 1 oplossing.
DISCLAIMER:
Dit e-mailbericht is uitsluitend bestemd voor de geadresseerde en kan vertrouwelijke informatie bevatten. Verspreiding van dit e-mailbericht of van de informatie die dit e-mailbericht bevat door een ander dan de geadresseerde is verboden. Indien u dit e-mailbericht per abuis heeft ontvangen verzoeken wij u de afzender hiervan op de hoogte te brengen en het originele bericht te vernietigen. Boxu is niet verantwoordelijk en/of aansprakelijk voor eventuele gevolgen en/of schade die verzending en ontvangst alsmede de inhoud van dit e-mailbericht betreffen.
@aknobbe Thank You!! It works, but i still got some questions… How do i add a user to both servers at once (to my external login and nextcloud)? Which database it uses for adding users and what password encryption does it use? Where are it’s HTML, CSS files which are responsible for the design, because i want to put all it’s settings in a diffrent website?
You need to download the whole folder @ https://github.com/nextcloud/loginviapost
There you can clone the files to zip and extract the zip to your nextcloud app folder.
Do you have sample code which runs an external login and also the nextcloud in one shot please? this would be great as it’s the last missing piece of my solution puzzle!
Hi, I’m trying to use it in NC21 but it doesn’t work, in method “POST- index.php/apps/loginviapost/login” the url doesn’t respond, is it that I need to do some configuration?