Fork me on GitHub

Announcement

The oneye project has been discontinued. You might not expect further fixes and support from us. All community related systems are set to read-only mode. Though feel free to download and use oneye as-is or even fork it over at GitHub.

#1 2013-01-28 11:34:34

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Registration Link

Hello,


Does setting registration off also dney all attempts to register a User or does it simply take the link away from the login?

Sincerly,
Peter

Offline

#2 2013-01-28 12:05:50

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Registration Link

It's actually blocking all attempts to register new users from outside. In case you know a bit PHP and maybe even some parts of the oneye structure, just take a look at https://github.com/oneye/oneye/blob/mas … yecode#L21 . There you can see us checking the constant "ALLOW_USER_REGISTER" directly inside the event handler - so no URL hijacking's possible wink


Best regards,
Lars Knickrehm

The oneye project.

Offline

#3 2013-01-28 12:17:04

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

Well i actually want only the link on the first page to not be shown.

Offline

#4 2013-01-28 12:18:54

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Registration Link

Okay, short answer wink : Disabling registrations prevents everybody except administrative accounts from creating new users.


Best regards,
Lars Knickrehm

The oneye project.

Offline

#5 2013-01-28 12:33:01

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

still does not aid to my issue i need it to be creatable via an external script. so basically i just dont want people to use the integratet on since i want to implement registrations into another Program. (with different resctrictions)

Offline

#6 2013-01-28 13:09:32

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Registration Link

Sorry for missunderstanding.

Registration from external HTML forms is not implemented. Only logging in from external HTML forms is.


Best regards,
Lars Knickrehm

The oneye project.

Offline

#7 2013-01-28 13:33:56

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

Offline

#8 2013-01-28 14:15:46

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Registration Link

Oh, sure - that's even more secure and the reason I didn't included direct handling of external forms.

Do you have some PHP knowledge?


Best regards,
Lars Knickrehm

The oneye project.

Offline

#9 2013-01-28 14:18:10

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

it should be enough to modify and understand the code (i red it often) still i do not find how i can disable the link but still being able via http://forums.oneye-project.org/viewtopic.php?id=297 to create accounts

Offline

#10 2013-01-28 14:21:35

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Registration Link

1) Disable registration.
2) Create a new php file somewhere outside your oneye installation and insert the followgin content: http://pastebin.com/mRKefvwU
3) Correct the path to "eyeOSxxxxxxxxxx".
4) Try http://example.com/example.php?username … sword=test

The script is untested - I wrote it just out of my mind and it is not secured in any wa - just a show case to be tested!


Best regards,
Lars Knickrehm

The oneye project.

Offline

#11 2013-01-28 14:23:23

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

ill try when i get home... so basically it still works that way: http://forums.oneye-project.org/viewtopic.php?id=297 altho the registration has been disabled.

You know what? You are tha bast!

Offline

#12 2013-01-28 14:31:48

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

I tried it it is working

Offline

#13 2013-01-28 15:33:34

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: Registration Link

Peter wrote:

does it give back if the account exists

You can use the oneye function "um('userExists', array($username))" to do so.

A simple example:

if (um('userExists', array($username))) {
	echo 'User aready exists';
} else if (um('createUser', ...)) {
	echo 'User successfully created.';
} else {
	echo 'Failed creating user.';
}

Best regards,
Lars Knickrehm

The oneye project.

Offline

#14 2013-01-28 16:38:33

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

shouldnt it have something to compare with on the second if

Offline

#15 2013-01-28 17:16:19

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

<?php
$password = $_REQUEST['password'];
$username = $_REQUEST['username'];
 
include 'eyeOS/extras/extern.eyecode';
eyeOS_start();
if (um('userExists', array($username))) {
	echo 'User aready exists';
} else if (um('createUser', array(
//      'admin' => false,
//      'disabled' => false,
//      'email' => '',
//      'expirationDate' => '',
//      'fullname' => '',
//      'groups' => array(),
//      'maintain' => array(),
//      'maintainer' => false,
//      'mngUser' => array(),
        'password' => $password,
//      'quota' => 0,
		'resetPassword' => true,
        'username' => $username
));) {
	echo 'User successfully created.';
} else {
	echo 'Failed creating user.';
}eyeOS_stop();
?>

It doe not seem to work when i do not use the ifs it works:

    <?php
    $password = $_REQUEST['password'];
    $username = $_REQUEST['username'];
     
    include 'eyeOS/extras/extern.eyecode';
    eyeOS_start();
    um('createUser', array(
    //      'admin' => false,
    //      'disabled' => false,
    //      'email' => '',
    //      'expirationDate' => '',
    //      'fullname' => '',
    //      'groups' => array(),
    //      'maintain' => array(),
    //      'maintainer' => false,
    //      'mngUser' => array(),
            'password' => $password,
    //      'quota' => 0,
          'resetPassword' => true,
            'username' => $username
    ));
    eyeOS_stop();
    ?>

Offline

#16 2013-01-28 17:22:44

Peter
Member
Registered: 2012-05-04
Posts: 54
Website

Re: Registration Link

nevermind here is the working code (there was a semicolon too much)

<?php
$password = $_REQUEST['password'];
$username = $_REQUEST['username'];
 
include 'eyeOS/extras/extern.eyecode';
eyeOS_start();
if (um('userExists', array($username))) {
	echo 'User aready exists';
} else if (um('createUser', array(
//      'admin' => false,
//      'disabled' => false,
//      'email' => '',
//      'expirationDate' => '',
//      'fullname' => '',
//      'groups' => array(),
//      'maintain' => array(),
//      'maintainer' => false,
//      'mngUser' => array(),
        'password' => $password,
//      'quota' => 0,
		'resetPassword' => true,
        'username' => $username))) {
	echo 'User successfully created.';
} else {
	echo 'Failed creating user.';
}eyeOS_stop();
?>

Offline

Board footer

Powered by FluxBB