<commit_before><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of mopauth
 *
 * @author deepwinter
 */
class Initializer_Mopauth {
   
   public function initialize() {

      ORM::Factory('user')->where('username', '=', 'admin')->find()->delete();
      if (!ORM::Factory('user')->where('username', '=', 'admin')->find()->loaded()) {
         $user = ORM::factory('user');
         $user->status = 'ACTIVE';
         $user->username = 'admin';
         $password = Utility_Auth::randomPassword(); <commit_msg>Mopauth initializer assumed existence of admin record, removed that assumption to fixed "Model not Loaded" exception<commit_after><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of mopauth
 *
 * @author deepwinter
 */
class Initializer_Mopauth {
   
   public function initialize() {
		 $admin = ORM::Factory('user')->where('username', '=', 'admin')->find();
		 if$admin->loaded()){
			 $admin->delete();
		 }
      if (!ORM::Factory('user')->where('username', '=', 'admin')->find()->loaded()) {
         $user = ORM::factory('user');
         $user->status = 'ACTIVE';
         $user->username = 'admin';
         $password = Utility_Auth::randomPassword(); 
{'fraction_non_alphanumeric': 0.18613413715146948, 'fraction_numerical': 0.0, 'mean_word_length': 3.4563758389261743, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3002475', 'n_tokens_mistral': 386, 'n_tokens_neox': 376, 'n_words': 94}