diff --git a/scripts/lantern.py b/scripts/lantern.py index 0dc93d2..db03c56 100644 --- a/scripts/lantern.py +++ b/scripts/lantern.py @@ -182,7 +182,7 @@ Maintenance: 0) Exit """) - option = input("Select an option? (0-10): ").strip() + option = input("Select an option? (0-11): ").strip() try: option = int(option) except ValueError: @@ -1199,8 +1199,6 @@ Maintenance: break case 11: - category = "EXTERNAL USER" - sensitive = "YES" try: print_colors("1) Move entries to verified 2) Move entries from submission to unverified 3) Delete from submission file 0) exit") option = int(input("Enter an option: ")) @@ -1214,9 +1212,11 @@ Maintenance: print_colors(submission_df) indx = int(input("Which index do you want to add? ")) - link = submission_df.iloc[indx]['link'] - name = submission_df.iloc[indx]['name'] - desc = submission_df.iloc[indx]['desc'] + link = submission_df.iloc[indx]['link'].strip() + name = submission_df.iloc[indx]['name'].strip() + desc = submission_df.iloc[indx]['desc'].strip() + category = submission_df.iloc[indx]['category'].strip() + sensitive = "YES" if submission_df.iloc[indx]['sensitive'].strip() == 'y' else "NO" new_row = pd.DataFrame({'Instance': [instance], 'Category': [category], 'Name':[name],'URL':[link],'Sensitive':[sensitive],'Description':[desc],'Status':['YES'],'Score':['100']}) @@ -1229,9 +1229,11 @@ Maintenance: print_colors(submission_df) indx = int(input("Which index do you want to add? ")) - link = submission_df.iloc[indx]['link'] - name = submission_df.iloc[indx]['name'] - desc = submission_df.iloc[indx]['desc'] + link = submission_df.iloc[indx]['link'].strip() + name = submission_df.iloc[indx]['name'].strip() + desc = submission_df.iloc[indx]['desc'].strip() + category = submission_df.iloc[indx]['category'].strip() + sensitive = "YES" if submission_df.iloc[indx]['sensitive'].strip() == 'y' else "NO" new_row = pd.DataFrame({'Instance': [instance], 'Category': [category], 'Name':[name],'URL':[link],'Sensitive':[sensitive],'Description':[desc],'Status':['YES'],'Score':['100']}) @@ -1250,8 +1252,8 @@ Maintenance: case 0: break - except: - print_colors('Try again',is_error=True) + except Exception as e: + print_colors(f'Try again {e}',is_error=True) break break case 0: diff --git a/submissions/submission.csv b/submissions/submission.csv index eccfb66..95fdc2d 100644 --- a/submissions/submission.csv +++ b/submissions/submission.csv @@ -1,2 +1,3 @@ -,link,name,desc -0,daskd.com,myname,dasjklj +link,name,desc,category,sensitive +,, +http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion,"Nihilist Git repo","GIt repo","Git Repo",n diff --git a/www/index.php b/www/index.php index 7782c8d..5b8ce35 100644 --- a/www/index.php +++ b/www/index.php @@ -1,18 +1,3 @@ - - - - diff --git a/www/submit.php b/www/submit.php index 788018d..eb885ad 100644 --- a/www/submit.php +++ b/www/submit.php @@ -1,4 +1,8 @@ 512 or strlen($name) > 64 or strlen($description) > 256 or strlen($sensitive) > 1 or strlen($category) > 64){ + echo "Don't excede the limit"; + }else{ // Open the file once before the loop $file = fopen("../submissions/submission.csv", "a"); if ($file !== false) { // Create an array with the inputs to write as a single row - $row = [$clear_link, $clear_name,$clear_description]; + $row = [$link, $name,$description,$category,$sensitive]; // Write the row to the CSV file fputcsv($file, $row, ',', '"'); @@ -37,6 +41,7 @@ if (isset($_POST['submit'])){ errorlog("Error opening the file."); } header("Location: index.php"); + } } } } @@ -66,6 +71,14 @@ if (isset($_POST['submit'])){
+
+

Character Limits

+

Link should be 354

+

Name should be 64

+

Description should be 256

+

Category should be 64

+

Sensitive should be 1

+
@@ -73,6 +86,10 @@ if (isset($_POST['submit'])){ + + + +