Giter Club home page Giter Club logo

delicountr's Introduction

:D

delicountr's People

Watchers

 avatar  avatar

delicountr's Issues

Random Sharing Link

I have seen in one of your TODO Lists, you have this random sharing link todo. Well im going to give you an appoarach which is using this function.

/*
 {NOTE} : Randomness Level To High Causes
          Less Randomness.
*/
function generateUUID(randomnessLevel) {
            var d = new Date().getTime();
            var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
                var r = (d + Math.random() * randomnessLevel) % 16 | 0;
                d = Math.floor(d / 16);
                return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
            });
            return uuid;
 };

You can see in the function it generates a random UID. Well, once it does that you upload the UID To the database with the queue. and then, im sure in PHP There is a handler for variable parameters in the url. For example in AngularJS Its $stateParams. And there you go, the jobs done.

Teachers Page

Well , for the teachers page protection, its very simple. All you have to do is, when the user first registers again you give him a random UID By using function above to ensure randomness. After you do that this hapenes. After that you must put an addintonal parameter in the URL for teacher page, like /teacher/{UID GENERATED}. Now, Lets say a student tries to acess Teachers page. What first will happen, is that you have to get the current active users UID. After you do that you check the Students UID with the URL Parameter UID, and if they match. Sucess thats actually the teacher in this case he is not, so he will be directed and warned that he will be banned if he attempts another practice like this. I hope this helped.

Demo

Demo Of UID Registration: https://repl.it/C3Fe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.