<?php
namespace entities\evr\security\display\forms;
use entities\html as html;
use entities\evr\security as security;

class Register extends html\Form
{
   public function __construct()
   {
      parent::__construct("register");
   }
   protected function build_content()
   {
      $key = security\Security::get_post_parameter("key");
      $username = security\Security::get_post_parameter("username");
      $email = security\Security::get_post_parameter("email_address");
      $join = security\Security::get_post_parameter("join");
      $markup = new html\Div("heading", null, $GLOBALS["REGISTRATION_HEADING"]);
      $markup .= $this->build_prompt($GLOBALS["NEW_USER_NAME_PROMPT"]);
      $markup .= new html\Input("username", "text", $username);
      $markup .= $this->build_prompt($GLOBALS["NEW_PASSWORD_PROMPT"]);
      $markup .= new html\Input("password[]", "password");
      $markup .= $this->build_prompt($GLOBALS["REENTER_PASSWORD_PROMPT"]);
      $markup .= new html\Input("password[]", "password");
      $markup .= $this->build_prompt($GLOBALS["EMAIL_ADDRESS_PROMPT"]);
      $markup .= new html\Input("email_address", "text", $email);
      $markup .= new html\Checkbox("join", 1, "join", $join);
      $markup .= $this->build_prompt($GLOBALS["MAILING_LIST_PROMPT"], "join");
      $markup .= new html\Input(
         "action", "submit", $GLOBALS["REGISTER_BUTTON_TEXT"]);
      $markup .= new html\Input("key", "hidden", $key);
      return $markup;
   }
   private function build_prompt($content, $id=null)
   {
      return new html\Div($id, "prompt", $content);
   }
}
<?php
namespace entities\evr\security\display\forms;
use entities\html as html;
use entities\evr\security as security;

class Activate extends html\Form
{
   public function __construct()
   {
      parent::__construct("activate");
   }
   protected function build_content()
   {
      $text = $GLOBALS["ACTIVATE_BUTTON_TEXT"];
      $markup = new html\Input("key", "text", "key", "field", true);
      $markup .= new html\Input("action", "submit", $text, "button");
      $markup .= $this->build_hidden_fields();
      return $markup;
   }
   private function build_hidden_fields()
   {
      $username = security\Security::get_post_parameter("username");
      $email = security\Security::get_post_parameter("email_address");
      $join = security\Security::get_post_parameter("join");
      $markup = new html\Input("username", "hidden", $username);
      $markup .= new html\Input("email", "hidden", $email);
      $markup .= new html\Input("join", "hidden", $join);
      return $markup;
   }
}
<?php
namespace entities\evr\security\display\forms;
use entities\html as html;
use entities\evr\security as security;

class Reset extends html\Form
{
   public function __construct()
   {
      parent::__construct("reset");
   }
   protected function build_content()
   {
      $markup = new html\Div("heading", null, $GLOBALS["RESET_HEADING"]);
      $markup .= new html\Div(null, "prompt", $GLOBALS["RESET_PROMPT"]);
      $markup .= new html\Input("username", "text");
      $markup .= new html\Input(
         "action", "submit", $GLOBALS["RESET_BUTTON_TEXT"]);
      return $markup;
   }
}
<?php
namespace entities\evr\security\display\forms;
use entities\html as html;

class Login extends \entities\html\Form
{
   public function __construct()
   {
      parent::__construct("login");
   }
   protected function build_content()
   {
      $button_text = $GLOBALS["LOGIN_BUTTON_TEXT"];
      $remember_text = $GLOBALS["REMEMBER_ME_PROMPT"];
      $markup = new html\Input("username", "text", "username", "field", true);
      $markup .= new html\Input(
         "password", "password", "XZV897aa", "field", true);
      $markup .= new html\Div("remember", null, $remember_text);
      $markup .= new html\Input("remember", "checkbox", null, "remember");
      $markup .= new html\Input("action", "submit", $button_text, "button");
      return $markup;
   }
}
<?php
namespace entities\evr\security\display\forms;
use entities\html as html;
use entities\evr\security as security;

class Change extends html\Form
{
   public function __construct()
   {
      parent::__construct("change");
   }
   protected function build_content()
   {
      $markup = new html\Div("heading", null, $GLOBALS["CHANGE_HEADING"]);
      $markup .= $this->build_prompt($GLOBALS["EXISTING_USER_NAME_PROMPT"]);
      $markup .= new html\Input("username", "text");
      $markup .= $this->build_prompt($GLOBALS["EXISTING_PASSWORD_PROMPT"]);
      $markup .= new html\Input("old_password", "password");
      $markup .= $this->build_prompt($GLOBALS["NEW_PASSWORD_PROMPT"]);
      $markup .= new html\Input("password[]", "password");
      $markup .= $this->build_prompt($GLOBALS["REENTER_PASSWORD_PROMPT"]);
      $markup .= new html\Input("password[]", "password");
      $markup .= new html\Input(
         "action", "submit", $GLOBALS["CHANGE_BUTTON_TEXT"]);
      return $markup;
   }
   private function build_prompt($content, $id=null)
   {
      return new html\Div($id, "prompt", $content);
   }
}
<?php
namespace entities\security\operators;

class Activator
{
   public function __construct($key)
   {
      $this->key = $key;
      $this->hashes = file($GLOBALS["HASHES_PATH"], FILE_IGNORE_NEW_LINES);
      $this->verify_key();
   }
   private function verify_key()
   {
      foreach ($this->hashes as $hash)
      {
         if ($hash == crypt($this->key, $hash))
         {
            echo "FOUND $this->key as $hash";
            return;
         }
      }
      echo "DIDN'T FIND $this->key";
   }
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "pattern.h"
#include "read.h"

char* parse_pattern(FILE* input_file, char* character)
{
   char* raw_pattern = read_next_line(input_file, character);
   sequence* pattern = malloc(sizeof(struct sequence));
   int* ii = malloc(sizeof(int));
   *ii = 0;
   build_sequence(pattern, raw_pattern, ii);
   print_pattern(pattern, 0);
   char* sequence_array = build_array_from_sequence(pattern);
   printf("%s\n\n", sequence_array);
   return sequence_array;
}

void build_sequence(sequence* sequence, char* raw_pattern, int* ii)
{
   int jj = 0;
   char* color_order = malloc(sizeof(char));
   while (raw_pattern[*ii])
   {
      if (isalnum(raw_pattern[*ii]))
      {
         if (raw_pattern[(*ii)-1] == OPEN_BRACKET || *ii == 0)
         {
            char* number_string = extract_word_from_string(raw_pattern, ii);
            sequence->iterations = atoi(number_string);
         }
         else
         {
            color_order = append_character(color_order, raw_pattern[*ii]);
         }
      }
      else if (raw_pattern[*ii] == CLOSE_BRACKET)
      {
         if (strlen(color_order) > 0) sequence->sequence = color_order;
         if (raw_pattern[(*ii)+1] != CLOSE_BRACKET && raw_pattern[(*ii)+1])
         {
            initiate_next_sequence(sequence, raw_pattern, ii);
         }
         return;
      }
      else if (raw_pattern[*ii] == OPEN_BRACKET)
      {
         initiate_next_sequence(sequence, raw_pattern, ii);
      }
      (*ii)++;
   }
   if (strlen(color_order) > 0) sequence->sequence = color_order;
}

void initiate_next_sequence(sequence* sequence, char* raw_pattern, int* ii)
{
   (*ii)++;
   if (raw_pattern[(*ii)-1] == CLOSE_BRACKET)
   {
      (*ii)++;
      sequence->next = malloc(sizeof(struct sequence));
      build_sequence(sequence->next, raw_pattern, ii);
   }
   else
   {
      sequence->child = malloc(sizeof(struct sequence));
      build_sequence(sequence->child, raw_pattern, ii);
   }
}

char* extract_word_from_string(char* string, int* ii)
{
   int jj;
   char* word = malloc(sizeof(char));
   for (jj = 0; isdigit(string[*ii]); jj++)
   {
      word[jj] = string[(*ii)++];
      word = realloc(word, sizeof(char) * (jj+2));
   }
   word[jj] = '\0';
   return word;
}

char* build_array_from_sequence(sequence* sequence)
{
   char* sequence_array = malloc(sizeof(char));
   sequence_array = add_sequence_to_array(sequence_array, sequence);
   return sequence_array;
}

char* add_sequence_to_array(char* array, sequence* sequence)
{
   if (sequence == NULL) return;
   
   int ii;
   for (ii = 0; ii < sequence->iterations; ii++)
   {
      if (sequence->sequence)
      {
         int new_length = strlen(array) + strlen(sequence->sequence);
         array = realloc(array, sizeof(char) * (new_length+1));
         strcat(array, sequence->sequence);
         array[new_length] = '\0';
      }
      else
      {
         array = add_sequence_to_array(array, sequence->child);
      }
   }
   array = add_sequence_to_array(array, sequence->next);
   return array;
}

char* append_character(char* string, char character)
{
   int length = strlen(string);
   string = realloc(string, sizeof(char) * (length+2));
   string[length] = character;
   string[length+1] = '\0';
   return string;
}

void print_pattern(sequence* sequence, int level)
{
   if (sequence == NULL) return;
   printf("%*d: ", level*3, sequence->iterations);
   if (sequence->sequence)
   {
      printf("%s", sequence->sequence);
   }
   printf("\n");
   print_pattern(sequence->child, level+1);
   print_pattern(sequence->next, level);
}
216.73.216.144
216.73.216.144
216.73.216.144
 
July 18, 2022


A new era ‼

Our infrastructure has recently upgraded ‼

Nugget Communications Bureau 👍

You've never emailed like this before ‼

Roundcube

Webmail software for reading and sending email from @nugget.fun and @shampoo.ooo addresses.

Mailman3

Email discussion lists, modernized with likes and emojis. It can be used for announcements and newsletters in addition to discussions. See lists for Picture Processing or Scrapeboard. Nowadays, people use Discord, but you really don't have to!

FreshRSS

With this hidden in plain sight, old technology, even regular people like you and me can start our own newspaper or social media feed.

Nugget Streaming Media 👍

The content you crave ‼

HLS

A live streaming, video format based on M3U playlists that can be played with HTML5.

RTMP

A plugin for Nginx can receive streaming video from ffmpeg or OBS and forward it as an RTMP stream to sites like Youtube and Twitch or directly to VLC.


Professional ‼

Nugget Productivity Suite 👍

Unleash your potential ‼

Kanboard

Virtual index cards you can use to gamify your daily grind.

Gitea

Grab whatever game code you want, share your edits, and report bugs.

Nugget Security 👍

The real Turing test ‼

Fail2ban

Banning is even more fun when it's automated.

Spamassassin

The documentation explains, "an email which mentions rolex watches, Viagra, porn, and debt all in one" will probably be considered spam.

GoAccess

Display HTTP requests in real time, so you can watch bots try to break into WordPress.

Nugget Entertainment Software 👍

The best in gaming entertainment ‼

Emoticon vs. Rainbow

With everything upgraded to the bleeding edge, this HTML4 game is running better than ever.


Zoom ‼

The game engine I've been working on, SPACE BOX, is now able to export to web, so I'm planning on turning nugget.fun into a games portal by releasing my games on it and adding an accounts system. The upgraded server and software will make it easier to create and maintain. I'm also thinking of using advertising and subscriptions to support the portal, so some of these services, like webmail or the RSS reader, may be offered to accounts that upgrade to a paid subscription.