Initial Landing of update-beta code. Bug 260157. Initial Landing of Developer CP. Bug 254925.

git-svn-id: svn://10.0.0.236/trunk@163307 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
psychoticwolf%carolina.rr.com
2004-10-06 18:35:28 +00:00
parent 45067b333b
commit 4689a8f1aa
53 changed files with 4730 additions and 0 deletions

View File

@@ -0,0 +1,492 @@
/* mozilla.org Base Styles
* maintained by fantasai
* (classes defined in the Markup Guide - http://mozilla.org/contribute/writing/markup )
*/
/* Suggested order:
* display
* list-style
* position
* float
* clear
* width
* height
* margin
* padding
* border
* background
* color
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
*
*/
/* TOC:
Random HTML Styles
Forms
General Structure
Navigation
Quotations
Comments and Other Asides
Emphasis
Computers - General
Code
Examples and Figures
Q and A (FAQ)
Tables
Headers
Meta
Specific to Products Pages
*/
/* Random HTML Styles */
dt {
font-weight: bold;
}
dd {
margin: 0 0 1em 1em;
}
li {
margin-top: 0.2em;
margin-bottom: 0.2em;
}
sup {
font-size: 70%;
}
form {
margin: 0;
display: inline;
}
label {
font-weight: bold;
}
.deepLevel #mainContent :link img,
.deepLevel #mainContent :visited img {
border: medium solid;
}
/* General Structure */
.subtitle {
font-style: italic;
}
div.para {
margin: 1em 0;
}
div.section {
display: block;
padding-left: 3%;
}
div.section > h2,
div.section > h3,
div.section > h4,
div.section > h5,
div.section > h6 {
margin-left: -1.3%;
}
.imgright {
float: right;
margin: 0 0 2em 2em;
}
.first {
margin-top: 0; /* For IE not understanding first:child */
}
/* Navigation */
:link img,
:visited img {
border: 0;
}
.ex-ref {
font-style: italic;
}
dl.toc dt {
margin-top: 1em;
font-size: 110%;
}
dl.toc p {
margin: 0;
text-indent: 1em;
}
dl.toc p:first-child {
text-indent: 0;
}
dl.toc > dd {
margin-left: 1em;
}
ol.toc ol {
list-style-type: circle;
}
ol.toc > li > ol {
font-size: 90%;
}
ul.snav {/* section navigation or short navigation, whichever you prefer */
margin: 0.7em 10%;
padding: .2em;
text-align: center;
}
ul.snav > li {
list-style-type: none;
margin: 0;
padding: 0;
}
ul.snav > li {
display: inline;
}
ul.snav > li:before {
content: " | ";
}
ul.snav > li:first-child:before {
content: "";
}
a.cont {
display: block;
margin-right: 0;
text-align: right;
}
/* Quotations */
blockquote > address {
padding-left: 1em;
text-indent: -1em;
}
blockquote > address:before {
content: "\2015";
}
div.quote,
div.epigraph {
margin: 1em;
}
div.quote q,
div.epigraph q {
display: block;
margin: 0 .5em;
text-indent: -0.5em;
}
div.quote cite,
div.epigraph cite {
display: block;
padding: 0 1em;
text-align: right;
text-indent: -1em;
}
div.quote cite:before,
div.epigraph cite:before {
content: "\2015";
}
blockquote.epigraph,
div.epigraph q {
font-style: italic;
text-align: right;
}
blockquote.epigraph em,
div.epigraph q em {
font-style: normal;
}
blockquote.epigraph address,
div.epigraph cite {
font-style: normal;
}
/* Comments and other Asides */
.note {
font-style: italic;
}
.note:before {
content: "Note: ";
}
.remark {
font-size: smaller;
}
.remark:before {
content: "[";
}
.remark:after {
content: "]";
}
.sidenote {
clear: both;
margin: 0.75em 0.5em;
padding: 0.2em;
border: 1px solid;
/* Block NS4 from floating */ /*/*/
float: right;
width: 30%;
min-width: 15em;
/* */
}
/* Reduce main header sizes */
.sidenote h1 {font-size: 1.40em;}
.sidenote h2 {font-size: 1.25em;}
.sidenote h3 {font-size: 1.10em;}
.key-point > h1:first-child,
.key-point > h2:first-child,
.key-point > h3:first-child,
.key-point > h4:first-child,
.key-point > h5:first-child,
.key-point > h6:first-child {
margin-top: 0;
}
/* Emphasis */
/* em, strong */
strong.stronger {
font-style: italic;
font-weight: bold;
}
strong.very-strong {
font-weight: bold;
text-transform: uppercase;
}
*.important,
div.important,
p.important {
margin: 1em;
padding: 0.1em;
border: solid #F00;
font-size: larger;
}
/* Computers - General */
pre.screen {
overflow: auto;
margin: 1em 0.5em;
padding: 0.2em;
border: solid 1px;
font-family: monospace;
white-space: pre;
}
div.screen {
margin: 1em .5em;
padding: 0.2em;
border: solid 1px;
}
span.application {
font-style: italic;
}
kbd.command,
code.command {
white-space: pre;
}
code.filename {
font-style: italic;
white-space: nowrap;
}
/* Code */
code {
white-space: pre;
}
pre.code {
overflow: auto;
margin: 1em .5em;
padding: .2em;
border: solid 1px;
}
pre.code .remark {
font-size: 1em;
font-style: italic;
}
/* turn off content generation */
pre.code .remark:before,
pre.code .remark:after,
pre.code .note:before {
content: "";
}
/* Examples and Figures */
.example {
margin: 1em 3%;
padding: .25em;
border: solid;
}
.example:before {
display: block;
font-weight: bold;
content: "Example";
}
.example[title]:before {
content: "Example: " attr(title);
}
pre.bad,
div.bad {
border: dashed red 3px;
}
.bad.example:before {
content: "Incorrect Example";
}
.bad.example[title]:before {
content: "Incorrect Example: " attr(title);
}
pre.good,
div.good {
border: double lime 3px;
}
.good.example:before {
content: "Correct Example";
}
.good.example[title]:before {
content: "Correct Example: " attr(title);
}
.figure,
.screenshot {
display: block;
margin: .75em auto;
}
.screenshot[title]:after,
.figure[title]:after {
display: block;
margin: 0 8% .05em;
font-style: italic;
font-size: small;
text-align: right;
content: attr(title);
}
.co,
.callout {
text-decoration: underline;
}
/* Q and A (FAQ) */
.qandaset .question {
font-size: large;
font-weight: bold;
}
.qandaset .answer {
margin-top: 1em;
}
/* Tables */
table.data {
border-collapse: collapse;
margin: 0.5em auto;
border: 1px solid;
}
table.data caption {
margin: 1em auto 0.2em;
font-size: small;
font-style: italic;
text-align: center;
}
table.data th,
table.data td {
padding: 0.2em;
border: 1px solid;
}
/* Meta */
address {
text-align: right;
}
.author {
margin-bottom: 1em;
text-align: left;
}
/* Headers */
#mainContent > h1:first-child,
#mainContent > h2:first-child,
#mainContent > h3:first-child,
#mainContent > h4:first-child,
#mainContent > h5:first-child,
#mainContent > h6:first-child,
#side > h1:first-child,
#side > h2:first-child,
#side > h3:first-child,
#side > h4:first-child,
#side > h5:first-child,
#side > h6:first-child {
margin-top: 0;
}
/* Specific to Products Pages */
.productlist {
margin: 0;
padding: 0 0 0 5px;
}
.productlist li {
clear: left;
list-style: none;
padding: 0 0 1em 0;
margin-left: 0;
}
.productlist h3 {
margin: 0 0 0.2em 0;
}
.productlist img {
float: left;
margin: 0 0.5em 1em 0;
display: auto;
}
/* Random Stuff That Needs To Be Cleaned Up / Deprecated */
.flLeft {
float: left;
margin: 5px 10px 5px 0;
}
.flRight {
float: right;
margin: 5px 0 5px 10px;
}

View File

@@ -0,0 +1,104 @@
/* mozilla.org Base Template Styles
* Initial Design by Dave Shea
* Severely tweaked by David Baron
* Reorganized by fantasai
* Large Changes for new Cavendish default by Daniel Burka and Steven Garrity
*/
/* Basic Structure */
body {
min-width: 610px;
margin: 20px;
}
#container {
max-width: 70em;
margin: 0 auto;
}
#mBody {
clear: both;
padding: 0 0 1em 0;
}
#side {
float: left;
width: 23%;
margin-bottom: 1em;
}
#mainContent {
margin-left: 25%;
}
.nomenu #mainContent {
margin-left: 0;
}
.bodyleft {
margin-left: 25% ! important
}
#mainContent.right {
float: left;
width: 62%;
margin-bottom: 1em;
margin-left: 0;
}
#side.right {
float: none;
width: auto;
margin-left: 65%;
}
/* Header */
#header { margin-bottom: 1em; }
#header ul {
margin: 0 0 1em 0;
padding: 0;
}
#header li {
display: inline;
padding: 0 20px 0 0;
margin: 0;
white-space: nowrap;
}
/* Sidebar */
#getcd {
margin: 1em 0 0 45px;
}
/* Footer */
#footer {
clear: both;
margin-top: 1em;
}
#footer ul {
margin: 0 0 1em 0;
padding: 0;
}
#footer li {
display: inline;
padding: 0 20px 0 0;
margin: 0;
white-space: nowrap;
}
#footer p {
margin: 0.6em 0;
}
/*accessibility tweaks*/
.skipLink {
position: absolute;
left: -999px;
width: 990px;
}
hr.hide {
display: none;
}

View File

@@ -0,0 +1,349 @@
/* mozilla.org MezzoTan Content Styles
* Initial Design by Dave Shea
* Reorganized and Expanded to include Markup Reference classes by fantasai
*/
/* Suggested order:
* display
* list-style
* position
* float
* clear
* width
* height
* margin
* padding
* border
* background
* color
* font
* text-decoration
* text-align
* vertical-align
* white-space
* other text
* content
*
*/
/* TOC:
Body
Random HTML Styles
Forms
General Structure
Navigation
Quotations
Comments and Other Asides
Emphasis
Computers - General
Code
Examples and Figures
Q and A (FAQ)
Tables
Meta
*/
/* Body */
body {
background: #fff;
}
#mainContent, #side {
background: #fff;
line-height: 1.3; /* value other than 'normal' needed for WinIE */
}
.deepLevel #mainContent {
line-height: 1.4;
}
/* Random HTML Styles */
hr {
height: 1px;
background-color: #000;
color: #000;
margin: 2em 0;
}
input[type="submit"] {
font-weight: bold;
}
/* General Structure */
body, td, th, input { /* redundant rules for bad browsers */
font-family: verdana, sans-serif;
font-size: x-small;
voice-family: "\"}\"";
voice-family: inherit;
font-size: small;
}
h1, h2, h3, h4, h5, h6 {
margin: 1em 0 0.2em 0;
border-bottom: 1px solid #ccc;
font-family: arial, verdana, sans-serif;
}
#header h1 { border: 0; }
h1 { font-size: 160%; font-weight: normal; }
h2 { font-size: 150%; font-weight: normal; }
h3 { font-size: 120%; }
h4 { font-size: 100%; }
h5 { font-size: 90%; }
h6 { font-size: 90%; border: 0; }
/* Navigation */
a:link { color: #039; }
a:visited { color: #636; }
a:hover { color: #333; }
a:active { color: #000; }
/* Quotations */
/* Comments and other Asides */
.note {
color: #666;
font-style: normal;
}
.remark {
color: #666;
}
.sidenote {
border: #666;
}
.key-point:before {
line-height: 0.1;
font-size: 1px;
background: transparent url("../../images/key-point_tr.gif") no-repeat top right;
margin: -15px -15px 0 -15px;
height: 15px;
display: block;
border: none;
content: url("../../images/key-point_tl.gif");
}
.key-point {
background: #e4ecec url("../../images/key-point_back.gif") right repeat-y;
padding: 15px;
margin-bottom: 1em;
}
.key-point:after {
display: block;
clear: both;
padding-top: 15px;
line-height: 0.1;
font-size: 1px;
content: url("../../images/key-point_bl.gif");
margin: -15px;
height: 8px;
background: transparent url("../../images/key-point_br.gif") scroll no-repeat bottom right ;
}
.key-point h2, .key-point h3, .key-point h4, .key-point h5 {
border: none;
margin-top: 0;
}
.news dt {
font-weight: normal;
color: #666;
}
.news dt a {
font-weight: bold;
}
ul.compact {
margin-left: 0;
padding-left: 20px;
}
/* Emphasis */
/* Computers - General */
kbd {
margin: 0.1em;
padding: 0.1em;
border: 1px #ccc;
}
kbd.command,
code.command {
color: #6B5839;
}
/* Code */
pre.code {
margin: 0.1em;
padding: 0.1em;
background: #EEECF6;
}
code > em,
code > strong,
pre.code > em,
pre.code > strong {
font-style: normal;
}
/* Examples and Figures */
div.example {
border-color: #554FA0;
}
div.example::before {
color: #666;
}
/* Tables */
table.data {
border-style: none hidden;
}
table.data thead {
background: #EEECF6;
}
table.data th,
table.data td {
border: 1px dotted #D6CCBD;
}
tr.odd {
background: #F5F5F5;
}
/* Meta */
address {
color: #666;
}
/* Product Specific CSS */
.productlist h3 {
border: none;
}
.key-point h3 {
margin: 0;
}
#product-desc h2 {
text-indent: -700em;
height: 25px;
line-height: 2px;
font-size: 2px;
}
#product-desc p {
padding-left: 170px;
}
#product-side {
margin-left: 65%;
}
#product-side ul {
margin-left: 0;
padding-left: 20px;
}
#product-side li {
padding-bottom: 0.2em;
}
#product-desc {
padding: 40px 0 25px 0;
color: #4C5C5C;
width: 60%;
float: left;
line-height: 140%;
}
.product-firefox {
background: url("../../images/product-firefox-screen.png") no-repeat;
}
.product-thunderbird {
background: url("../../images/product-thunderbird-screen.png") no-repeat;
}
.product-camino {
background: url("../../images/product-camino-screen.png") no-repeat;
}
.product-mozilla {
background: url("../../images/product-mozilla-screen.png") no-repeat;
}
.download h3 {
color: #1D9101;
font-weight: bold;
margin: 0;
font-size: 140%;
}
.download h3 a:link,
.download h3 a:visited,
.download h3 a:active {
color: #1D9101;
}
.download h3 a:hover {
color: #156B01;
}
.download:before {
line-height: 0.1;
font-size: 1px;
margin: -15px -15px 0 -15px;
height: 15px;
display: block;
border: none;
content: url("../../images/download_tl.gif");
}
.download {
background: #C4EFA1 url("../../images/download_back.gif") top right no-repeat;
padding: 15px 45px 15px 15px;
margin-bottom: 0.5em;
}
.download:after {
display: block;
padding-top: 15px;
line-height: 0.1;
font-size: 1px;
content: url("../../images/download_bl.gif");
margin: -10px -45px -15px -15px;
height: 8px;
background: transparent url("../../images/download_br.gif") scroll no-repeat bottom right ;
}
.shop:before {
line-height: 0.1;
font-size: 1px;
margin: -15px -15px 0 -15px;
height: 15px;
display: block;
border: none;
content: url("../../images/shop_tl.gif");
}
.shop {
background: #C0DCDC url("../../images/shop_back.gif") top right no-repeat;
padding: 15px 70px 15px 15px;
}
.shop:after {
display: block;
padding-top: 15px;
line-height: 0.1;
font-size: 1px;
content: url("../../images/shop_bl.gif");
margin: -10px -70px -15px -15px;
height: 8px;
background: transparent url("../../images/shop_br.gif") scroll no-repeat bottom right ;
}

View File

@@ -0,0 +1,125 @@
h2 a { text-decoration: none; }
h2 a:link { color: #000; }
h2 a:visited { color: #000; }
h2 a:hover { color: #039; }
#mBody h2 { margin-top: 0; }
#mBody p { margin-top: 0; }
.front-feature-cnet { background: #E4ECEC url(/images/feature-back-cnet.png) bottom right no-repeat; }
.front-feature-wired { background: #E4ECEC url(/images/feature-back-wired.png) bottom right no-repeat; }
.front-feature-nytimes { background: #E4ECEC url(/images/feature-back-nytimes.png) bottom right no-repeat; }
.front-feature-onion { background: #E4ECEC url(/images/feature-back-onion.png) bottom right no-repeat; }
.front-feature-slate { background: #E4ECEC url(/images/feature-back-slate.png) bottom right no-repeat; }
.front-feature-nasa { background: #E4ECEC url(/images/feature-back-nasa.png) bottom right no-repeat; }
#firefox-feature {
position: relative;
}
#firefox-feature ul {
margin: 0.5em 0 0 0;
padding: 0;
}
#firefox-feature li {
list-style: none;
margin-left: 1.5em;
}
#firefox-feature li a {
display: block;
padding: 5px 0 7px 34px;
text-decoration: none;
}
#firefox-feature li a .front-link {
text-decoration: underline;
}
a#shopLink {
display: block;
padding: 2px 4px 10px 32px;
background: url(/images/front-shop.gif) no-repeat;
}
div.extrainfo {
margin-top: 10px;
}
#firefox-feature p {
margin: 0 0 1em 0;
line-height: 140%;
}
#firefox-feature #feature-content {
padding: 6px 330px 10px 10px;
}
#featurelink {
display: block;
width: 350px;
height: 235px;
position: absolute;
bottom: 0;
right: 0;
text-decoration: none;
text-indent: -2500px;
}
ul.news {
margin: 0.5em 0 0 0;
padding: 0;
}
.news li {
margin: 0 0 0.7em 0;
padding: 0;
clear: both;
list-style-type: none;
}
.news li a { font-weight: normal; }
.news .date {
background: #eee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
float: left;
text-align: center;
margin: 0 5px 5px 0;
line-height: 1.1em;
padding: 2px;
font-size: 11px;
width: 4em;
white-space: nowrap;
}
img.rss {
float: right;
margin: 0;
padding: 4px 4px 0 0;
}
img.promo {
margin: 0 0 8px 8px;
float: right;
}
.frontcolumn {
width: 30%;
float: left;
padding-right: 3%;
}
.frontcolumnlast {
width: 33%;
float: left;
}
.homepage .download {
width: 200px;
}
.homepage .shop {
width: 175px;
}

View File

@@ -0,0 +1,265 @@
/* mozilla.org Cavendish Template Styles
* Initial Design by Daniel Burka and Steven Garrity
*/
/* Basic Structure */
body {
background: #fff url("../../images/body_back.gif") repeat-x;
}
/* Header */
#header {
background: #455372 url("../../images/header_bl.png") bottom left repeat-x;
position: relative;
min-height: 39px;
height: 5em;
padding: 0;
voice-family: "\"}\"";
voice-family: inherit;
height: 3em;
padding: 15px 0;
} #ignored {}
#header h1 {
position: absolute;
top: 0;
left: 0;
margin: 0;
font-size: 2px;
background: url("../../images/header_tl.gif") no-repeat;
height: 8px;
z-index: 100; /* above the UL */
}
#header h1 a {
display: block;
width: 204px;
height: 55px;
background: transparent url("../../images/header_logo.gif") no-repeat;
text-indent: -700em;
text-decoration: none;
}
#header ul {
width: auto;
position: absolute;
bottom: 0;
right: 0;
margin: 0;
padding: 0 15px 0 0;
list-style: none;
background: url("../../images/header_br.gif") no-repeat bottom right;
z-index: 90; /* below the H1 */
}
#header li {
float: right;
background: transparent url("../../images/header_tab.gif") 100% -600px no-repeat;
padding: 0 6px 0 0;
margin: 0 1px 0 0;
border-bottom: 1px solid #515358;
}
#header ul a {
float: left;
display: block;
padding: 4px 4px 4px 10px;
background: transparent url("../../images/header_tab.gif") 0% -600px no-repeat;
font-weight: bold;
color: #fff;
text-decoration: none;
}
#header ul li:hover a { background-position: 0% -400px; }
#header ul li:hover { background-position: 100% -400px; }
body.sectionAbout li#menu_aboutus,
body.sectionProducts li#menu_products,
body.sectionSupport li#menu_support,
body.sectionDevelopers li#menu_developers {
background-position: 100% -200px;
}
body.sectionAbout li#menu_aboutus a,
body.sectionProducts li#menu_products a,
body.sectionSupport li#menu_support a,
body.sectionDevelopers li#menu_developers a {
background-position: 0% -200px;
color: #039;
}
body.sectionAbout li#menu_aboutus,
body.sectionProducts li#menu_products,
body.sectionSupport li#menu_support,
body.sectionDevelopers li#menu_developers {
border-bottom: 1px solid #fff;
}
body.sectionAbout li#menu_aboutus:hover,
body.sectionProducts li#menu_products:hover,
body.sectionSupport li#menu_support:hover,
body.sectionDevelopers li#menu_developers:hover {
background-position: 100% 0%;
}
body.sectionAbout li#menu_aboutus:hover a,
body.sectionProducts li#menu_products:hover a,
body.sectionSupport li#menu_support:hover a,
body.sectionDevelopers li#menu_developers:hover a {
background-position: 0% 0%;
color: #333;
}
/* Search Field */
#header form {
position: absolute;
top: 0;
right: 0;
padding: 12px 20px 0 0;
background: url("../../images/header_tr.gif") no-repeat top right;
margin: 0; /* need for IE Mac */
text-align: right; /* need for IE Mac */
white-space: nowrap; /* for Opera */
}
#header form label { color: #fff; font-size: 85%; }
#header form input { font-size: 85%; }
#header form #submit {
font-size: 85%;
background: #6A7389;
color: #fff;
padding: 1px 4px;
border-right: 1px solid #283043;
border-bottom: 1px solid #283043;
border-top: 1px solid #9097A2;
border-left: 1px solid #9097A2;
}
#header form #q {
width: 170px;
font-size: 85%;
border: 1px solid #9097A2;
background: #D9DBE1;
padding: 2px;
}
#header form #q:hover, #header form #q:focus {
background: #fff;
}
/* Sidebar */
#nav:before {
line-height: 0.1;
font-size: 1px;
background: transparent url("../../images/menu_tr.gif") no-repeat top right;
margin: 0;
height: 9px;
display: block;
border-bottom: 1px solid #ddd;
content: url("../../images/key-point_tl.gif");
}
#nav {
background: #E0E9E9 url("../../images/menu_back.gif") right repeat-y;
}
#nav:after {
display: block;
clear: both;
padding-top: 0;
line-height: 0.1;
font-size: 1px;
content: url("../../images/key-point_bl.gif");
margin: 0 0 0 0;
height: 8px;
background: transparent url("../../images/menu_br.gif") scroll no-repeat bottom right ;
border-top: 1px solid #fff;
}
#nav, #nav ul {
margin: 0;
padding: 0;
list-style: none;
}
#nav {
margin-bottom: 1em;
}
#nav li {
fdisplay: inline; /* need for IE spacing issue */
padding: 0;
margin: 0;
}
#nav li span { /* used for un-linked menu items */
display: block;
padding: 6px 10px;
font-weight: bold;
color: #666;
}
#nav li span#configParent, #nav li span #configuration {
display: inline;
font-weight: normal;
padding: 0;
}
#nav li a {
display: block;
padding: 6px 10px;
text-decoration: none;
background: #EDF2F2;
border-bottom: 1px solid #ddd;
border-top: 1px solid #fff;
border-right: 1px solid #ddd;
}
#nav li a:hover {
background: #E0E9E9;
}
#nav li li a {
padding: 4px 8px 4px 20px;
}
#oN {
background-color: #E0E9E9;
}
#oN:hover {
background-color: #C6DCDC;
}
/* Footer */
#footer {
border-top: 1px solid #666;
margin: 2em 0;
padding: 1em 0;
text-align: center;
}
#footer ul {
margin: 0;
padding: 0;
list-style: none;
}
#footer li {
display: inline;
}
#footer span,#footer a {
white-space: nowrap;
padding: 0 1em;
}
#footer p span,#footer p a {
white-space: nowrap;
padding: 0 0.3em;
}
#footer span a {
padding: 0;
}
#footer p,#footer p a {
color: #666;
}
#footer p a:hover {
color: #000;
}

View File

@@ -0,0 +1,84 @@
/* mozilla.com print css
by dave shea, http://www.mezzoblue.com/ */
/*html elements*/
body {
background: #fff;
font: 12pt Verdana,Sans-serif;
}
a img {
border: 0;
}
form {
margin: 0;
display: inline;
}
label, input {
font-weight: bold;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
}
h1 {
font-size: 120%;
color: #955322;
}
h2 {
font-size: 110%;
color: #B26C38;
}
h2 a:visited {
text-decoration: none;
}
h3 {
color: #EC361D;
font-size: 110%;
}
h4 {
font-size: 110%;
color: #666;
}
h5 {
font-size: 100%;
color: #955322;
}
h6 {
color: #EC361D;
font-size: 100%;
}
p, li, dt, dd {
font-size: 92%;
}
p {
line-height: 150%;
}
sup {
font-size: 70%;
}
a:link, a:visited {
color: #554FA0;
font-weight: bold;
text-decoration: none;
}
dt.im {
float: left;
}
#mainContent a:link:after, #mainContent a:visited:after {
content: " (" attr(href) ") ";
font-size: 70%;
color: #000;
}
#mainContent a[href^="/"]:after {
content: " (http://www.mozilla.org" attr(href) ") ";
}
#tools, #search, #ad, #bn, #int, .skipLink, #brd {
display: none;
}
#header + hr {
display: none;
}

View File

@@ -0,0 +1,748 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: Add Item</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<?php
if (!$function or $function=="additem") {
if (!$_GET["type"]) {$_GET["type"] = "E"; }
$typearray = array("E"=>"Extension","T"=>"Theme");
$typename = $typearray[$_GET["type"]];
?>
<h1>Add New <?php echo"$typename"; ?></h1>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: solid 0px #000000; width: 100%">
<FORM NAME="additem" METHOD="POST" ACTION="?function=additem2" enctype="multipart/form-data">
<INPUT NAME="type" TYPE="hidden" VALUE="<?php echo"$_GET[type]"; ?>">
<TR><TD style="padding-left: 20px">
Your <?php echo"$typename"?> File:<BR>
<INPUT NAME="file" SIZE=40 TYPE="FILE"><BR>
<BR>
<INPUT NAME="button" TYPE="BUTTON" VALUE="Cancel" onclick="javascript:history.back()"> <INPUT NAME="submit" TYPE="SUBMIT" VALUE="Next &#187;">
</TD></TR>
</FORM>
</TABLE>
<?php
} else if ($function=="additem2") {
$filename=$_FILES['file']['name'];
$filetype=$_FILES['file']['type'];
$filesize=$_FILES['file']['size'];
$uploadedfile=$_FILES['file']['tmp_name'];
$status=$_FILES['file']['error'];
//Convert File-Size to Kilobytes
$filesize = round($filesize/1024, 1);
//Status
if ($status==0) {$statusresult="Success!";
} else if ($status==1) {$statusresult="Error: File Exceeds upload_max_filesize (PHP)";
} else if ($status==2) {$statusresult="Error: File Exceeds max_file_size (HTML)";
} else if ($status==3) {$statusresult="Error: File Incomplete, Partial File Received";
} else if ($status==4) {$statusresult="Error: No File Was Uploaded";
}
$manifest_exists = "FALSE";
$destination = "$websitepath/files/temp/$filename";
if (move_uploaded_file($uploadedfile, $destination)) {
$uploadedfile = $destination;
$chmod_result = chmod("$uploadedfile", 0644); //Make the file world readable. prevent nasty permissions issues.
}
//If this was legacy mode, we're coming back from step1b so the file wasn't just submitted and we need to just pick it up again.
if ($_POST["legacy"]=="TRUE") {
$filename = $_POST["filename"];
$filesize = $_POST["filesize"];
$uploadedfile="$websitepath/files/temp/$filename";
}
$zip = zip_open("$uploadedfile");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_name($zip_entry)=="install.rdf") {
$manifest_exists = "TRUE";
// echo "Name: " . zip_entry_name($zip_entry) . "\n";
// echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n";
// echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "\n";
// echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "\n";
if (zip_entry_open($zip, $zip_entry, "r")) {
// echo "File Contents:\n";
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
// echo "$buf\n";
zip_entry_close($zip_entry);
}
echo "\n";
}
}
zip_close($zip);
}
if ($manifest_exists=="TRUE" or $_POST["legacy"]=="TRUE") {
//echo"install.rdf is present, use standard mode...<BR>\n";
//------------------
// Construct $manifestdata[] array from install.rdf info.
// Thanks to Chewie[] with the Perl-Compatable RegExps Help. :-)
//-------------------
// em:id
preg_match("/<em:id>(.*?)<\/em:id>/", $buf, $matches);
$manifestdata["id"]=$matches[1];
// em:version
preg_match("/<em:version>(.*?)<\/em:version>/", $buf, $matches);
$manifestdata["version"]=$matches[1];
//em:targetApplication
preg_match_all("/<em:targetApplication>(.*?)<\/em:targetApplication>/s", $buf, $matches);
//echo"<pre>";
//print_r($buf);
//print_r($matches);
//echo"</pre>";
foreach ($matches[0] as $targetapp ) {
//em:targetApplication --> em:id
preg_match("/<em:id>(.*?)<\/em:id>/", $targetapp, $matches);
$i = $matches[1];
$manifestdata["targetapplication"][$i]["id"]=$matches[1];
//em:targetApplication --> em:minVersion
preg_match("/<em:minVersion>(.*?)<\/em:minVersion>/", $targetapp, $matches);
$manifestdata["targetapplication"][$i]["minversion"]=$matches[1];
//em:targetApplication --> em:maxVersion
preg_match("/<em:maxVersion>(.*?)<\/em:maxVersion>/", $targetapp, $matches);
$manifestdata["targetapplication"][$i]["maxversion"]=$matches[1];
}
//em:name
preg_match("/<em:name>(.*?)<\/em:name>/", $buf, $matches);
$manifestdata["name"]=$matches[1];
//em:description
preg_match("/<em:description>(.*?)<\/em:description>/", $buf, $matches);
$manifestdata["description"]=$matches[1];
//em:homepageURL
preg_match("/<em:homepageURL>(.*?)<\/em:homepageURL>/", $buf, $matches);
$manifestdata["homepageurl"]=$matches[1];
//echo"<h1>Adding Extension... Checking file...</h1>\n";
//echo"<pre>"; print_r($manifestdata); echo"</pre>\n";
//Populate Form Variables from manifestdata.
$id = $manifestdata[id];
$name = $manifestdata[name];
$version = $manifestdata[version];
$homepage = $manifestdata[homepageurl];
$description = $manifestdata[description];
//Check GUID for validity/existance, if it exists, check the logged in author for permission
$sql = "SELECT ID, GUID from `t_main` WHERE `GUID` = '$manifestdata[id]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if (mysql_num_rows($sql_result)=="1") {
// echo"This is a updated extension... Checking author data...<br>\n";
$mode = "update";
$row = mysql_fetch_array($sql_result);
$item_id = $row["ID"];
if ($_POST["legacy"]=="TRUE") {$item_id = $_POST["existingitems"]; }
$sql = "SELECT `UserID` from `t_authorxref` WHERE `ID`='$item_id' AND `UserID` = '$_SESSION[uid]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if (mysql_num_rows($sql_result)=="1" or ($_SESSION["level"]="admin" or $_SESSION["level"]="editor")) {
// echo"This extension belongs to the author logged in<br>\n";
} else {
echo"ERROR!! This extension does NOT belong to the author logged in.<br>\n";
die("Terminating...");
}
} else {
$mode = "new";
// echo"This is a new extension...<br>\n";
}
//Verify MinAppVer and MaxAppVer per app for validity, if they're invalid, reject the file.
if ($_POST["legacy"]=="TRUE" AND !$manifestdata[targetapplication]) {$manifestdata[targetapplication]=array(); }
foreach ($manifestdata[targetapplication] as $key=>$val) {
//echo"$key -- $val[minversion] $val[maxversion]<br>\n";
$i=0;
$sql = "SELECT `AppName`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `GUID`='$key' ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$appname = $row["AppName"];
$subver = $row["SubVer"];
$release = "$row[major].$row[minor]";
if ($row["release"]) {$release = "$release.$row[release]";}
if ($subver !=="final") {$release="$release$subver";}
if ($release == $val[minversion]) { $versioncheck[$key][minversion_valid] = "true"; }
if ($release == $val[maxversion]) { $versioncheck[$key][maxversion_valid] = "true"; }
}
if (!$versioncheck[$key][minversion_valid]) {
$versioncheck[$key][minversion_valid]="false";
echo"Error! The MinAppVer for $appname of $val[minversion] in install.rdf is invalid.<br>\n";
$versioncheck[errors]="true";
}
if (!$versioncheck[$key][maxversion_valid]) {
$versioncheck[$key][maxversion_valid]="false";
echo"Error! The MaxAppVer for $appname of $val[maxversion] in install.rdf is invalid.<br>\n";
$versioncheck[errors]="true";
}
}
//echo"<pre>"; print_r($versioncheck); echo"</pre>\n";
if ($versioncheck[errors]=="true") {
echo"Errors were encountered during install.rdf checking...<br>\n";
die("Aborting...");
} else {
// echo"install.rdf minAppVer and maxAppVer valid...<br>\n";
}
} else {
//echo"install.rdf is not present, use legacy mode...<br>\n";
//header("Location: http://$_SERVER[HTTP_HOST]/developers/additem.php?function=step1b&filename=$filename");
echo"<h1>Add Step 1b: Legacy Item Data Entry: ($filename)</h1>\n";
?>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: solid 0px #000000; width: 100%">
<FORM NAME="additem" METHOD="POST" ACTION="?function=additem2" enctype="multipart/form-data">
<INPUT NAME="type" TYPE="hidden" VALUE="<?php echo"$_POST[type]"; ?>">
<TR><TD style="padding-left: 20px">
<INPUT NAME="legacy" TYPE="HIDDEN" VALUE="TRUE">
<INPUT NAME="mode" TYPE="RADIO" VALUE="new"<?php if ($_GET["mode"] != "update") {echo" CHECKED"; }?>> New <?php echo"$typename"; ?><br>
<INPUT NAME="mode" TYPE="RADIO" VALUE="update"<?php if ($_GET["mode"] == "update") {echo" CHECKED"; } ?>> Update to:
<SELECT NAME="existingitems">
<?php
$sql = "SELECT TM.ID, TM.Name FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
WHERE TM.Type = '$_POST[type]'";
if ($_GET["admin"] =="true" AND $_SESSION[level] =="admin") {} else{ $sql .= "AND TU.UserEmail = '$_SESSION[email]'"; }
$sql .="GROUP BY `name` ORDER BY `Name` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["ID"];
$name = $row["Name"];
echo"<OPTION value=\"$id\""; if ($_GET[id]==$id) {echo" SELECTED"; } echo">$name</OPTION>\n";
}
?>
</SELECT><BR>
Your file: <?php echo"$filename"; ?> <INPUT name="filename" TYPE=HIDDEN VALUE="<?php echo"$filename"; ?>"> <INPUT name="filesize" TYPE=HIDDEN VALUE="<?php echo"$filesize"; ?>">
<BR>
<INPUT NAME="button" TYPE="BUTTON" VALUE="&#171;&nbsp;Back" onclick="javascript:history.back()"> <INPUT NAME="submit" TYPE="SUBMIT" VALUE="Next &#187;">
</TD></TR>
</FORM>
</TABLE>
<?php
exit;
}
//exit;
$typearray = array("E"=>"Extension","T"=>"Theme");
$type = $_POST["type"];
$typename = $typearray[$type];
if ($mode=="update") {
$sql = "SELECT `Name`, `Homepage`, `Description` FROM `t_main` WHERE `ID` = '$item_id' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$name = $row["Name"];
$homepage = $row["Homepage"];
$description = $row["Description"];
$authors = ""; $i="";
$sql = "SELECT TU.UserEmail FROM `t_authorxref` TAX INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID WHERE `ID` = '$item_id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$email = $row["UserEmail"];
$authors .= "$email";
if ($i < $numresults) { $authors .=", "; }
}
//Get Currently Set Categories for this Object...
$sql = "SELECT TCX.CategoryID, TC.CatName FROM `t_categoryxref` TCX
INNER JOIN t_categories TC ON TCX.CategoryID = TC.CategoryID
WHERE TCX.ID = '$item_id'
ORDER BY `CatName` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$n++;
$catid = $row["CategoryID"];
$categories[$n] = $catid;
}
unset($n);
}
if (!$categories) {$categories = array(); }
?>
<h1>Add New <?php echo"$typename"; ?> &#187;&#187; Step 2:</h2>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: solid 0px #000000; width: 100%">
<FORM NAME="addstep2" METHOD="POST" ACTION="?function=additem3">
<INPUT NAME="mode" TYPE="HIDDEN" VALUE="<?php echo"$mode"; ?>">
<?php if ($mode=="update") { ?>
<INPUT NAME="item_id" TYPE="HIDDEN" VALUE="<?php echo"$item_id"; ?>">
<?php } ?>
<INPUT NAME="guid" TYPE="HIDDEN" VALUE="<?php echo"$id"; ?>">
<INPUT NAME="type" TYPE="HIDDEN" VALUE="<?php echo"$type"; ?>">
<TR><TD><SPAN class="global">Name*</SPAN></TD> <TD><INPUT NAME="name" TYPE="TEXT" VALUE="<?php echo"$name"; ?>" SIZE=45 MAXLENGTH=100></TD>
<?php
//Get the Category Table Data for the Select Box
$sql = "SELECT `CategoryID`, `CatName` FROM `t_categories` WHERE `CatType` = '$type' ORDER BY `CatName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
// $sqlnum = mysql_num_rows($sql_result);
?>
<TD ROWSPAN=8 VALIGN=TOP><SPAN class="global">Categories:</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;<SELECT NAME="categories[]" MULTIPLE="YES" SIZE="10">
<?php
while ($row = mysql_fetch_array($sql_result)) {
$catid = $row["CategoryID"];
$catname = $row["CatName"];
echo"<OPTION value=\"$catid\"";
foreach ($categories as $validcat) {
if ($validcat==$catid) { echo" SELECTED"; }
}
echo">$catname</OPTION>\n";
}
?>
</SELECT></TD></TR>
<?php
if (!$authors) {$authors="$_SESSION[email]"; }
?>
<TR><TD><SPAN class="global">Author(s):*</SPAN></TD><TD><INPUT NAME="authors" TYPE="TEXT" VALUE="<?php echo"$authors"; ?>" SIZE=45></TD></TR>
<?php
echo"<TR><TD><SPAN class=\"file\">Version:*</SPAN></TD><TD><INPUT NAME=\"version\" TYPE=\"TEXT\" VALUE=\"$version\"></TD></TR>\n";
echo"<TR><TD><SPAN class=\"file\">OS*</SPAN></TD><TD><SELECT NAME=\"osid\">";
$sql = "SELECT * FROM `t_os` ORDER BY `OSName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$osid = $row["OSID"];
$osname = $row["OSName"];
echo"<OPTION value=\"$osid\">$osname</OPTION>\n";
}
echo"</SELECT></TD></TR>\n";
echo"<TR><TD><SPAN class=\"file\">Filename:</SPAN></TD><TD>$filename ($filesize"."kb) <INPUT name=\"filename\" type=\"hidden\" value=\"$filename\"><INPUT name=\"filesize\" type=\"hidden\" value=\"$filesize\"></TD></TR>\n";
echo"<TR><TD COLSPAN=2><SPAN class=\"file\">Target Application(s):</SPAN></TD></TR>\n";
$sql2 = "SELECT `AppName`,`GUID` FROM `t_applications` GROUP BY `AppName` ORDER BY `AppName` ASC";
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row2 = mysql_fetch_array($sql_result2)) {
$appname = $row2["AppName"];
$guid = $row2["GUID"];
if ($appname == "Mozilla") { $mozguid = $guid; }
$minappver = $manifestdata["targetapplication"]["$guid"]['minversion'];
$maxappver = $manifestdata["targetapplication"]["$guid"]['maxversion'];
echo"<TR><TD></TD><TD>$appname ";
if (($mode=="new" or $mode=="update") and (strtolower($appname) !="mozilla" or $manifestdata["targetapplication"]["$mozguid"])) {
//Based on Extension Manifest (New Mode)
if ($minappver and $maxappver) {
echo"$minappver - $maxappver\n";
echo"<INPUT name=\"$appname-minappver\" TYPE=\"HIDDEN\" VALUE=\"$minappver\">\n";
echo"<INPUT name=\"$appname-maxappver\" TYPE=\"HIDDEN\" VALUE=\"$maxappver\">\n";
} else {
echo"N/A";
}
} else {
//Legacy Mode Code...
if ($appname =="Firefox" or $appname == "Thunderbird") {
echo"<br><SPAN style=\"font-size: 8pt; font-weight: bold\">Incompatable with Legacy Extensions (Requires install.rdf)</SPAN>";
} else {
$sql = "SELECT `version`,`major`,`minor`,`release`,`SubVer` FROM `t_applications` WHERE `AppName` = '$appname' ORDER BY `major` ASC, `minor` ASC, `release` ASC, `SubVer` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
echo"<SELECT name=\"$appname-minappver\" TITLE=\"Minimum Version* (Required)\">";
echo"<OPTION value\"\"> - </OPTION>\n";
while ($row = mysql_fetch_array($sql_result)) {
$release = "$row[major].$row[minor]";
if ($row["release"]) {$release = "$release.$row[release]";}
$subver = $row["SubVer"];
if ($subver !=="final") {$release="$release$subver";}
echo"<OPTION value=\"$release\">$release</OPTION>\n";
}
echo"</select>\n";
echo"&nbsp;-&nbsp;";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
echo"<SELECT name=\"$appname-maxappver\" TITLE=\"Maximum Version* (Required)\">";
echo"<OPTION value\"\"> - </OPTION>\n";
while ($row = mysql_fetch_array($sql_result)) {
$release = "$row[major].$row[minor]";
if ($row["release"]) {$release = "$release.$row[release]";}
$subver = $row["SubVer"];
if ($subver !=="final") {$release="$release$subver";}
echo"<OPTION value=\"$release\">$release</OPTION>\n";
}
echo"</select>\n";
echo"</TD></TR>\n";
} }
}
?>
<TR><TD><SPAN class="global">Homepage</SPAN></TD> <TD COLSPAN=2><INPUT NAME="homepage" TYPE="TEXT" VALUE="<?php echo"$homepage"; ?>" SIZE=60 MAXLENGTH=200></TD></TR>
<TR><TD><SPAN class="global">Description*</SPAN></TD> <TD COLSPAN=2><TEXTAREA NAME="description" ROWS=3 COLS=55><?php echo"$description"; ?></TEXTAREA></TD></TR>
<?php
echo"<TR><TD><SPAN class=\"file\">Version Notes:</SPAN></TD><TD COLSPAN=2><TEXTAREA NAME=\"notes\" ROWS=4 COLS=55>$notes</TEXTAREA></TD></TR>\n";
?>
<TR><TD COLSPAN="3" ALIGN="CENTER"><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Next &#187;">&nbsp;&nbsp;<INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form"></TD></TR>
</FORM>
</TABLE>
<?php
} else if ($function=="additem3") {
//print_r($_POST);
//exit;
//Verify that there's at least one min/max app value pair...
$sql = "SELECT `AppName`,`AppID` FROM `t_applications` GROUP BY `AppName` ORDER BY `AppName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$appname = $row["AppName"];
$appid = $row["AppID"];
if (!$minappver AND $_POST["$appname-minappver"]) {$minappver="true";}
if (!$maxappver AND $_POST["$appname-maxappver"]) {$maxappver="true";}
}
//Author List -- Autocomplete and Verify, if no valid authors, kill add.. otherwise, autocomplete/prompt
$authors = $_POST["authors"];
$authors = explode(", ","$authors");
foreach ($authors as $author) {
if (strlen($author)<2) {continue;} //Kills all values that're too short..
$a++;
$sql = "SELECT `UserID`,`UserEmail` FROM `t_userprofiles` WHERE `UserEmail` LIKE '$author%' ORDER BY `UserMode`, `UserName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$userid = $row["UserID"];
$useremail = $row["UserEmail"];
if ($numresults>1) {
//Too many e-mails match, store individual data for error block.
$r++;
$emailerrors[$a]["foundemails"][$r] = $useremail;
}
$authorids[] = $userid;
$authoremails[] = $useremail;
}
if ($numresults !="1") {
//No Valid Entry Found for this E-Mail or too many, kill and store data for error block.
$emailerrors[$a]["author"] = "$author";
$updateauthors = "false"; // Just takes one of these to kill the author update.
}
}
unset($a,$r);
if ($_POST["name"] AND $_POST["type"] AND $_POST["authors"] AND $updateauthors !="false" AND $_POST["version"] AND $_POST["osid"] AND $_POST["filename"] AND $_POST["filesize"] AND $_POST["description"] AND $minappver AND $maxappver) {
//All Needed Info is in the arrays, procceed with inserting...
//Create DIV for Box around the output...
echo"<h1>Adding Item... Please Wait...</h1>\n";
echo"<DIV>\n";
//Phase One, Main Data
$name = $_POST["name"];
$homepage = $_POST["homepage"];
$description = $_POST["description"];
$item_id = $_POST["item_id"];
$guid = $_POST["guid"];
$type = $_POST["type"];
if ($_POST["mode"]=="update") {
$sql = "UPDATE `t_main` SET `Name`='$name', `Homepage`='$homepage', `Description`='$description', `DateUpdated`=NOW(NULL) WHERE `ID`='$item_id' LIMIT 1";
} else {
$sql = "INSERT INTO `t_main` (`GUID`, `Name`, `Type`, `Homepage`,`Description`,`DateAdded`,`DateUpdated`) VALUES ('$guid', '$name', '$type', '$homepage', '$description', NOW(NULL), NOW(NULL));";
}
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($sql_result) {echo"Updating/Adding record for $name...<br>\n";}
//Get ID for inserted row... if we don't know it already
if (!$_POST[item_id] and $_POST["mode"] !=="update") {
$sql = "SELECT `ID` FROM `t_main` WHERE `GUID`='$_POST[guid]' AND `Name`='$_POST[name]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$id = $row["ID"];
} else {
$id = $_POST["item_id"];
}
//Phase 2 -- Commit Updates to AuthorXref tables.. with the ID and UserID.
if ($updateauthors != "false") {
//Remove Current Authors
$sql = "DELETE FROM `t_authorxref` WHERE `ID` = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//Add New Authors based on $authorids
sort($authorids);
foreach ($authorids as $authorid) {
$sql = "INSERT INTO `t_authorxref` (`ID`, `UserID`) VALUES ('$id', '$authorid');";
$result = mysql_query($sql) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
}
if ($result) { echo"Authors added...<br>\n"; }
} else {
echo"ERROR: Could not update Authors list, please fix the errors printed below and try again...<br>\n";
}
unset($authors); //Clear from Post..
// Phase 3, t_categoryxref
if (!$_POST["categories"]) {
//No Categories defined, need to grab one to prevent errors...
$sql = "SELECT `CategoryID` FROM `t_categories` WHERE `CatType`='$type' AND `CatName`='Miscellaneous' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$_POST["categories"] = array("$row[CategoryID]");
}
}
//Delete Current Category Linkages...
$sql = "DELETE FROM `t_categoryxref` WHERE `ID` = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//Add New Categories from $_POST["categories"]
foreach ($_POST["categories"] as $categoryid) {
$sql = "INSERT INTO `t_categoryxref` (`ID`, `CategoryID`) VALUES ('$id', '$categoryid');";
$result = mysql_query($sql) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
}
if ($result) {echo"Categories added...<br>\n"; }
//Phase 4, t_version rows
//Construct Internal App_Version Arrays
$i=0;
$sql = "SELECT `AppName`, `int_version`, `major`, `minor`, `release`, `SubVer`, `shortname` FROM `t_applications` ORDER BY `AppName`, `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$appname = $row["AppName"];
$int_version = $row["int_version"];
$subver = $row["SubVer"];
$release = "$row[major].$row[minor]";
if ($row["release"]) {$release = "$release.$row[release]";}
if ($subver !=="final") {$release="$release$subver";}
$app_internal_array[$release] = $int_version;
$app_shortname[strtolower($appname)] = $row["shortname"];
}
$sql2 = "SELECT `AppName`,`AppID` FROM `t_applications` GROUP BY `AppName` ORDER BY `AppName` ASC";
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row2 = mysql_fetch_array($sql_result2)) {
$appname = $row2["AppName"];
$appid = $row2["AppID"];
$minappver = $_POST["$appname-minappver"];
$maxappver = $_POST["$appname-maxappver"];
if ($minappver and $maxappver) {
if ($app_internal_array["$minappver"]) {$minappver_int = $app_internal_array["$minappver"]; }
if ($app_internal_array["$maxappver"]) {$maxappver_int = $app_internal_array["$maxappver"]; }
if (!$minappver_int) {$minappver_int = $minappver;}
if (!$maxappver_int) {$maxappver_int = $maxappver;}
$version = $_POST["version"];
$osid = $_POST["osid"];
$filesize = $_POST["filesize"];
$uri = ""; //we don't have all the parts to set a uri, leave blank and fix when we do.
$notes = $_POST["notes"];
//If a record for this item's exact version, OS, and app already exists, find it and delete it, before inserting
$sql3 = "SELECT `vID` from `t_version` TV INNER JOIN `t_applications` TA ON TA.AppID=TV.AppID WHERE `OSID`='$osid' AND `AppName` = '$appname' AND TV.Version='$version' ORDER BY `vID` ASC";
$sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result3)) {
$sql = "DELETE FROM `t_version` WHERE `vID`='$row[vID]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($sql_result) { echo"<strong>Warning!</strong> A version Record already exists for this item's Application/OS/Version combination. Deleting.<br>\n"; }
}
$sql = "INSERT INTO `t_version` (`ID`, `Version`, `OSID`, `AppID`, `MinAppVer`, `MinAppVer_int`, `MaxAppVer`, `MaxAppVer_int`, `Size`, `URI`, `Notes`, `DateAdded`, `DateUpdated`) VALUES ('$id', '$version', '$osid', '$appid', '$minappver', '$minappver_int', '$maxappver', '$maxappver_int', '$filesize', '$uri', '$notes', NOW(NULL), NOW(NULL));";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($sql_result) {echo"Added $name version $version for $appname<br>\n"; $apps_array[]=$app_shortname[strtolower($appname)];}
$sql = "SELECT `vID` from `t_version` WHERE `id` = '$id' ORDER BY `vID` DESC LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$vid_array[] = $row["vID"];
}
}
$sql = "SELECT `OSName` FROM `t_os` WHERE `OSID`='$osid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$osname = $row["OSName"];
//Construct the New Filename
$filename_array = explode(".",$_POST[filename]);
$filename_count = count($filename_array)-1;
$fileext = $filename_array[$filename_count];
$itemname = str_replace(" ","_",$name);
$j=0; $app="";
$app_count = count($apps_array);
foreach ($apps_array as $app_val) {
$j++;
$apps .="$app_val";
if ($j<$app_count) {$apps .="+"; }
}
$newfilename = "$itemname-$version-$apps";
if (strtolower($osname) !=="all") {$newfilename .="-".strtolower($osname).""; }
$newfilename .=".$fileext";
//Move temp XPI to home for approval queue items...
$oldpath = "$repositorypath/temp/$_POST[filename]";
$newpath = "$repositorypath/approval/".strtolower($newfilename);
if (file_exists($oldpath)) {
rename("$oldpath","$newpath");
echo"File $newfilename saved to disk...<br>\n";
}
$uri = str_replace("$repositorypath/approval/","http://$sitehostname/developers/approvalfile.php/",$newpath);
//echo"$newfilename ($oldpath) ($newpath) ($uri)<br>\n";
foreach ($vid_array as $vid) {
$sql = "UPDATE `t_version` SET `URI`='$uri' WHERE `vID`='$vid'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
}
//Approval Queue
$_SESSION["trusted"]=="FALSE";
//Trusted User Code Not Yet Implemented, needs a shared function w/ the approval queue
// for file moving, creation. (and sql updating?)
//Check if the item belongs to the user, (special case for where admins are trusted, the trust only applies to their own work.)
$sql = "SELECT `UserID` from `t_authorxref` WHERE `ID`='$id' AND `UserID` = '$_SESSION[uid]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if (mysql_num_rows($sql_result)=="1" AND $_SESSION["trusted"]=="TRUE") {
//User is trusted and the item they're modifying inheirits that trust.
$action = "Approval+";
$comments = "Auto-Approval for Trusted User";
//$typenames = array("E"=>"extensions","T"=>"themes");
//$typename = $typenames[$type];
//$uri = strtolower(str_replace("http://$sitehostname/developers/approvalfile.php/","http://ftp.mozilla.org/pub/mozilla.org/$typename/$itemname/",$newpath));
//foreach ($vid_array as $vid) {
// $sql = "UPDATE `t_version` SET `URI`='$uri' WHERE `vID`='$vid'";
// $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//}
} else {
$action="Approval?";
$comments="";
}
//Firstly, log the comments and action taken..
$userid = $_SESSION["uid"];
if (!$vid_array) { $vid_array = array(); }
foreach ($vid_array as $vid) {
$sql = "INSERT INTO `t_approvallog` (`ID`, `vID`, `UserID`, `action`, `date`, `comments`) VALUES ('$id', '$vid', '$userid', '$action', NOW(NULL), '$comments');";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
}
echo"Process Complete...<br><br>\n";
echo"$name version $version has been added to the Mozilla Update database and is awaiting review by an editor, you will be notified when an editor reviews it.<br>\n";
echo"To review or make changes to your submission, visit the <A HREF=\"itemoverview.php?id=$id\">Item Details page</A>...<br>\n";
echo"<br><br>\n";
echo"<A HREF=\"/developers/\">&#171;&#171; Back to Home</A>";
echo"</div>\n";
}
//Author Error Handling/Display Block for Form Post...
if ($emailerrors) {
echo"
<h1>Adding Item... Error Found while processing authors</h1>\n
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE=\"border: 0px; width: 100%\">
<FORM NAME=\"addstep2b\" METHOD=\"POST\" ACTION=\"?function=additem3\">";
foreach ($_POST as $key => $val) {
if ($key=="authors" or $key=="submit") {continue; }
if ($key=="categories") {
foreach ($_POST["categories"] as $val) {
echo"<INPUT name=\"categories[]\" type=\"hidden\" value=\"$val\">\n";
}
continue;
}
echo"<INPUT name=\"$key\" type=\"hidden\" value=\"$val\">\n";
}
echo"<TR><TD COLSPAN=2 STYLE=\"\">\n";
echo"<DIV style=\"margin-left 2px; border: 1px dotted #CCC;\">";
foreach ($emailerrors as $authorerror) {
$author = $authorerror["author"];
$count = count($authorerror["foundemails"]);
if ($count=="0") {
//Error for No Entry Found
echo"<SPAN STYLE=\"color: #FF0000;\"><strong>Error! Entry '$author': No Matches Found.</strong></SPAN> Please check your entry and try again.<BR>\n";
} else {
//Error for Too Many Entries Found
echo"<SPAN STYLE=\"color: #FF0000;\"><strong>Error! Entry '$author': Too Many Matches.</strong></SPAN> Please make your entry more specific.<BR>\n";
}
if ($count>0 AND $count<6) {
echo"&nbsp;&nbsp;&nbsp;&nbsp;Possible Addresses found: ";
foreach ($authorerror["foundemails"] as $foundemails) {
$a++;
echo"$foundemails";
if ($a != $count) {echo", "; } else {echo"<br>\n";}
}
}
}
echo"</font></DIV></TD></TR>\n";
$authors = $_POST["authors"];
?>
<TR><TD><SPAN class="global">Author(s):*</SPAN></TD><TD><INPUT NAME="authors" TYPE="TEXT" VALUE="<?php echo"$authors"; ?>" SIZE=70><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Next &#187;"></TD></TR>
</FORM></TABLE>
<?php
}
} else {}
?>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,211 @@
<?php
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html lang="EN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Style-Type" content="text/css">
<?php
require"../core/config.php";
//Define Breadcrumbs for Header Navigation
$breadcrumbs[]['name'] = "Manage Application Versions";
$breadcrumbs[]['url'] = "/admin/appmanager.php";
?>
<link rel="stylesheet" type="text/css" href="/admin/core/mozupdates.css">
<title>MozUpdates :: Manage Application Versions</title>
</head>
<body>
<?php
include"$page_header";
?>
<?php
if (!$function) {
//Add Category to MySQL Table
if ($_POST["submit"]=="Add Application") {
if ($_POST[AppName] != "Mozilla" && $_POST[SubVer] == "final") {
$_POST[SubVer] = "";
}
if ($_POST["AppName"]=="Other") {
$_POST["AppName"] = $_POST["othername"];
$_POST["GUID"] = $_POST["otherguid"];
}
$sql = "INSERT INTO `t_applications` (`AppName`,`Release`,`SubVer`,`GUID`) VALUES ('$_POST[AppName]','$_POST[Release]','$_POST[SubVer]','$_POST[GUID]')";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
}
?>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 95%" class="listing">
<TR><TD COLSPAN=6 STYLE="background-color: #FFFFFF; font-size:14pt; font-weight: bold;">Manage Application List:</TD></TR>
<tr>
<td class="hline" colspan="6"></td>
</tr>
<TR>
<tr>
<th></th>
<th>Release</th>
<th>Version</th>
</tr>
<?php
$sql = "SELECT * FROM `t_applications` ORDER BY `AppName` ASC, `Release` ASC, `SubVer` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
$lastname = "";
while ($row = mysql_fetch_array($sql_result)) {
// If it's a new AppName, start a new row
if ($lastname != $row["AppName"]) {
// Close out previous row if necessary
if ($lastname != "") {
echo"</td>";
echo"</tr>\n";
}
$applications[] = $row["AppName"];
echo"<tr>\n";
echo"<td>".++$i."</td>\n";
echo"<td>&nbsp;".$row["AppName"]."&nbsp;&nbsp;</td>";
echo"<td>";
} else {
// Separate with a comma
echo", ";
}
echo"<a href=\"?function=editcategory&appid=".$row["AppID"]."\">";
echo"".$row["Release"]."";
if ($row["SubVer"] != "final") {echo"".$row["SubVer"]."";}
echo"</a>";
$lastname = $row["AppName"];
}
echo"</td>";
echo"</tr>\n";
?>
</table>
<div style="width: 660px; border: 1px dotted #AAA; margin-top: 2px; margin-left: 50px; font-size: 10pt; font-weight: bold">
<?php
//Add Category to MySQL Table
if ($_POST["submit"]=="Add Application") {
echo"<DIV style=\"text-align: center; font-size: 12pt\">The application $_POST[AppName] (Version $_POST[Release]$_POST[SubVer]) has been successfully added.</DIV>";
}
?>
<form name="addapplication" method="post" action="?function=&action=addnewapp">
New Application
Name: <select name="AppName">
<?php
foreach ($applications as $application) {
echo"<OPTION value=\"$application\">$application</OPTION>\n";
}
echo"<OPTION value=\"Other\">Other</OPTION>\n";
?>
</select>
Release: <input name="Release" type="text" size="5" maxlength="5" value=""><select name="SubVer">
<?php
$subvers = array("+"=>"+", "a"=>"alpha","b"=>"beta","final"=>"final");
foreach($subvers as $key => $subver) {
$subver = ucwords($subver);
echo"<option value=\"$key\">$subver</option>\n";
}
?>
</select>
GUID: <input name="otherguid" type="text" size="25" MAXSIZE="50" value="">
<BR>
<SPAN style="margin-left: 20px">If other, Name: <input name="othername" type="text" size="10"></span>
<input name="submit" type="submit" value="Add Application">
</form>
</div>
<?php
} else if ($function=="editcategory") {
$appid = $_GET["appid"];
//Post Functions
if ($_POST["submit"] == "Update") {
if ($_POST[AppName] != "Mozilla" && $_POST[SubVer] == "final") {
$_POST[SubVer] = "";
}
$sql = "UPDATE `t_applications` SET `AppName`='$_POST[AppName]', `Release`='$_POST[Release]', `SubVer`='$_POST[SubVer]',`GUID`='$_POST[GUID]' WHERE `appid`='$_POST[appid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">Your update to $_POST[AppName], has been successful.</div>";
} else if ($_POST["submit"] == "Delete Application") {
$sql = "DELETE FROM `t_applications` WHERE `appid`='$_POST[appid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">You've successfully deleted the application '$_POST[AppName]'.</div>";
}
if (!$appid) { $appid = $_POST["appid"]; }
// Show Edit Form
$sql = "SELECT * FROM `t_applications` WHERE `appid` = '$appid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
?>
<div class="editbox">
<h3>Edit Application:</h3>
<form name="editcategory" method="post" action="?function=editcategory">
<?php
echo"Name: <input name=\"AppName\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"".$row["AppName"]."\" /><br />\n";
echo"Release: <input name=\"Release\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"".$row["Release"]."\" />";
echo" <select name=\"SubVer\"/><br />\n";
$subvers = array("+"=>"+", "a"=>"alpha", "b"=>"beta", "final"=>"final");
foreach($subvers as $key => $subver) {
$subver = ucwords($subver);
echo"<option value=\"$key\"";
if ($key==$row["SubVer"]) { echo" selected=\"selected\""; }
echo">$subver</option>\n";
}
echo"</select><br />\n";
echo"GUID: <input name=\"GUID\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"".$row["GUID"]."\" /><br />\n";
echo"<input name=\"appid\" type=\"hidden\" value=\"".$row["AppID"]."\" />\n";
?>
<input name="submit" type="submit" value="Update" />
<input name="reset" type="reset" value="Reset Form" />
<input name="submit" type="submit" value="Delete Application" onclick="return confirm('Are you sure?');" />
</form>
<A HREF="?function=">&#171;&#171; Return to Application Manager</A>
</div>
<?php
}
?>
<?php
include"$page_footer";
?>
</body>
</html>

View File

@@ -0,0 +1,196 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: Manage Approval Queue</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<?php
if (!$function or $function=="approvalqueue") {
//Overview page for admins/editors to see all the waiting approval queue items...
?>
<h1>Extensions/Themes Awaiting Approval</h1>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: 0px; width: 100%" class="listing">
<TR>
<TD STYLE="background-color: #FFFFFF; width: 20px"></TD>
<TD>Name</TD>
<TD>Requested by?</TD>
<TD>Last Updated</TD>
<TD>Works with</TD>
</TR>
<?php
$sql ="SELECT TM.ID, `vID`, `Name`, TV.Version,`AppName`, `OSName` FROM `t_main` TM
INNER JOIN `t_version` TV ON TM.ID = TV.ID
INNER JOIN `t_applications` TA ON TV.AppID = TA.AppID
INNER JOIN `t_os` TOS ON TV.OSID = TOS.OSID
WHERE `approved` = '?' ORDER BY TV.DateUpdated ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$sql2 = "SELECT `UserName`,`UserEmail`,`date` FROM `t_approvallog` TA INNER JOIN `t_userprofiles` TU ON TA.UserID = TU.UserID WHERE `ID`='$row[ID]' AND `vID`='$row[vID]' ORDER BY `date` DESC LIMIT 1";
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row2 = mysql_fetch_array($sql_result2);
if ($row2[date]) {$date = $row2[date]; } else { $date = $row[DateUpdated]; }
echo"<TR>\n";
echo"<TD>$i</TD>\n";
echo"<TD><a href=\"?function=approval&id=$row[ID]&vid=$row[vID]\">$row[Name] $row[Version]</a></a></TD>\n";
echo"<TD>$row2[UserName] - $row2[UserEmail]</TD>\n";
echo"<TD>$date</TD>\n";
echo"<TD>$row[AppName]"; if($row[OSName] != "ALL") { echo" ($row[OSName])"; } echo"</TD>\n";
echo"</TR>\n";
}
?>
</TABLE>
<?php
} else if ($function=="approval") {
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.GUID, TV.Version, TV.URI, TV.Size, TA.AppName, TV.MinAppVer, TV.MaxAppVer FROM `t_main` TM
INNER JOIN t_version TV ON TM.ID = TV.ID
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
WHERE TM.ID = '$_GET[id]' AND TV.vID = '$_GET[vid]'
ORDER BY `Type` , `Name` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$v++;
$id = $row["ID"];
$guid = $row["GUID"];
$type = $row["Type"];
$name = $row["Name"];
$version = $row["Version"];
$uri = $row["URI"];
$filesize = $row["Size"];
$appname = $row["AppName"];
$minappver = $row["MinAppVer"];
$maxappver = $row["MaxAppVer"];
$authors = "";
$i=0;
$sql = "SELECT TU.UserName, TU.UserEmail FROM `t_authorxref` TAX INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID WHERE TAX.ID = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$num_results = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$authors .= "$row[UserName]";
if ($num_results > $i) {$authors .=", ";}
}
$sql = "SELECT `UserName`, `UserEmail`,`date` FROM `t_approvallog` TA INNER JOIN t_userprofiles TU ON TA.UserID=TU.UserID WHERE `ID`='$id' AND `vID`='$_GET[vid]' AND `action`='Approval?' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$requestedby = $row["UserName"];
$requestedon = $row["date"];
$requestedbyemail = $row["UserEmail"];
?>
<h1>Mozilla Update - Approval Requested: <?php echo"$name $version"; ?></h1>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: 0px; width: 100%">
<TR><TD>
<FORM NAME="processapproval" METHOD="POST" ACTION="?function=processapproval">
<INPUT NAME="id" TYPE="HIDDEN" VALUE="<?php echo"$_GET[id]"; ?>">
<INPUT NAME="vid" TYPE="HIDDEN" VALUE="<?php echo"$_GET[vid]"; ?>">
<INPUT NAME="name" TYPE="HIDDEN" VALUE="<?php echo"$name"; ?>">
<INPUT NAME="version" TYPE="HIDDEN" VALUE="<?php echo"$version"; ?>">
<INPUT NAME="requestedbyemail" TYPE="HIDDEN" VALUE="<?php echo"$requestedbyemail"; ?>">
<PRE>
name <?php echo"$name\n"; ?>
author(s) <?php echo"$authors\n"; ?>
id <?php echo"$guid\n"; ?>
version <?php echo"$version\n"; ?>
supported apps:
<?php echo"$appname $minappver-$maxappver\n"; ?>
requested by: <?php echo"$requestedby\n"; ?>
requested on: <?php echo"$requestedon\n"; ?>
<A HREF="<?php echo"$uri"; ?>">Install Now</A> (<?php echo"$filesize"; ?>KB)
<A HREF="">Download</A>
Comments:
<TEXTAREA NAME="comments" ROWS=5 COLS=40></TEXTAREA>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Approve"> <INPUT NAME="submit" TYPE="SUBMIT" VALUE="Deny">
</PRE>
</FORM>
<A HREF="?function=approvalqueue">&#171;&#171; Return to Approval Queue</A>
</TD></TR>
</TABLE>
<?php
} else if ($function=="processapproval") {
if ($_POST["submit"]) {
$action = $_POST["submit"];
if ($action=="Approve") {
$approved = "YES";
$action = "Approval+";
} else if ($action=="Deny") {
$approved = "NO";
$action = "Approval-";
}
echo"<DIV style=\"border: 1px dotted #333; width: 750px; font-size: 14pt; font-weight: bold; text-align:center; margin: auto; margin-bottom: 10px\">";
//Firstly, log the comments and action taken..
$_POST["userid"] = $_SESSION["uid"];
$sql = "INSERT INTO `t_approvallog` (`ID`, `vID`, `UserID`, `action`, `date`, `comments`) VALUES ('$_POST[id]', '$_POST[vid]', '$_POST[userid]', '$action', NOW(NULL), '$_POST[comments]');";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//Secondly, let's move the file to it's new home in /ftp/ for staging...
$sql = "SELECT `Type`,`Name`,`Version`,`URI` from `t_main` TM INNER JOIN t_version TV ON TM.ID=TV.ID WHERE `vID`='$_POST[vid]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$uri = $row["URI"];
$filename = str_replace ("http://$sitehostname", "$websitepath", $uri);
if (file_exists($filename)) {
if ($row["Type"]=="T") {$type="themes";} else if ($row["Type"]=="E") {$type="extensions";}
$name = str_replace(" ","_",$row["Name"]);
$path = strtolower("$type/$name");
//http://mozupdates.psychoticwolf.net/files/approval/chatzilla-0.9.63c-ff.xpi
$destination = str_replace("/files/approval",strtolower("/files/ftp/$path"),$filename);
$dirpath = "$websitepath/files/ftp/$path";
if (!file_exists($dirpath)) {
mkdir($dirpath,0775);
}
if (!file_exists($destination)) {
rename("$filename", "$destination");
}
$newurl = "http://ftp.mozilla.org/pub/mozilla.org";
$uri = str_replace("$websitepath/files/ftp","$newurl","$destination");
}
//Thirdly, update version record...
$sql = "UPDATE `t_version` SET `URI`='$uri', `approved`='$approved' WHERE `ID`='$_POST[id]' AND `URI`='$row[URI]' LIMIT 5";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
@include"mail_approval.php";
echo"Processing Request...<br>\n";
echo"Approval Flag set to $action, for $_POST[name] $_POST[version]<br>\n";
echo"E-Mail sent to requestee informing them of the action taken along with your comments<br>\n";
echo"<A HREF=\"?function=approvalqueue\">&#171;&#171; Return to Approval Queue</A>";
echo"</DIV>";
}
?>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,189 @@
<?php
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html lang="EN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Style-Type" content="text/css">
<?php
require"../core/config.php";
//Define Breadcrumbs for Header Navigation
$breadcrumbs[]['name'] = "Manage Extension Categories";
$breadcrumbs[]['url'] = "/admin/extcategories.php";
?>
<link rel="stylesheet" type="text/css" href="/admin/core/mozupdates.css">
<title>Mozilla Update :: Category Manager</title>
</head>
<body>
<?php
include"$page_header";
?>
<?php
if (!$function) {
?>
<?php
if ($_POST["submit"]=="Create Category") {
if ($_POST[cattype]=="other") {$_POST["cattype"]=$_POST["othertype"];}
$sql = "INSERT INTO `t_categories` (`CatName`, `CatDesc`, `CatType`) VALUES ('$_POST[catname]', '$_POST[catdesc]', '$_POST[cattype]');";
$result = mysql_query($sql) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
}
?>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 95%" class="listing">
<TR><TD COLSPAN=4 STYLE="background-color: #FFFFFF; font-size:14pt; font-weight: bold;">Manage Category List:&nbsp;&nbsp;<SPAN style="font-size: 10pt">Show: <?php
$sql = "SELECT `CatType` FROM `t_categories` GROUP BY `CatType` ORDER BY `CatType`";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$type = ucwords($row["CatType"]);
echo"<a href=\"?function=&type=$type\">";
if ($types[$type]) {$type = $types[$type]; }
echo"$type";
echo"</A> / \n";
}
echo"<a href=\"?function=&type=%\">All</A>\n";
?></SPAN></TD></TR>
<tr>
<td class="hline" colspan="4"></td>
</tr>
<tr>
<th></th>
<th>Name</th>
<th>Description</th>
<th>Type</th>
</tr>
<?php
$type = $_GET["type"];
if (!$type) {$type="%"; }
$sql = "SELECT * FROM `t_categories` WHERE `CatType` LIKE '$type' ORDER BY `CatType`,`CatName`";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$categoryid = $row["CategoryID"];
$catname = $row["CatName"];
$catdesc = $row["CatDesc"];
$cattype = $row["CatType"];
$i++;
echo"<tr>\n";
echo"<td>$i</td>\n";
echo"<td><a href=\"?function=editcategory&categoryid=$categoryid\">$catname</a></td>\n";
echo"<td>$catdesc</a></td>\n";
echo"<td>$cattype</td>\n";
echo"</tr>\n";
}
?>
</table>
<div style="width: 640px; border: 1px dotted #AAA; margin-top: 2px; margin-left: 50px; font-size: 10pt; font-weight: bold">
<?php
if ($_POST["submit"]=="Create Category") {
//Disabled Here, See Above ^
// if ($_POST[cattype]=="other") {$_POST["cattype"]=$_POST["othertype"];}
// $sql = "INSERT INTO `t_categories` (`CatName`, `CatDesc`, `CatType`) VALUES ('$_POST[catname]', '$_POST[catdesc]', '$_POST[cattype]');";
// $result = mysql_query($sql) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">The category $_POST[catname] has been Successfully Added...</div>";
}
?>
<form name="addapplication" method="post" action="?function=&action=addnewcategory">
<SPAN style="color: #00F">New Category</SPAN>
Name: <input name="catname" type="text" value="" size="30" maxlength="100">
Description: <input name="catdesc" type="text" value="" size="30" maxlength="100"><BR>
<SPAN style="margin-left: 20px">Type: <select name="cattype">";
<?php
$sql = "SELECT `CatType` FROM `t_categories` GROUP BY `CatType` ORDER BY `CatType`";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$type = ucwords($row["CatType"]);
echo"<option value=\"$type\">$type</option>\n";
}
echo"<option value=\"other\">Other</option>\n";
?>
</select>
If other, Type: <INPUT NAME="othertype" TYPE="TEXT" SIZE=5 MAXLENGTH=1>
<input name="submit" type="submit" value="Create Category"></SPAN>
</form>
</div>
<?php
} else if ($function=="editcategory") {
$categoryid = $_GET["categoryid"];
//Post Functions
if ($_POST["submit"] == "Update") {
$sql = "UPDATE `t_categories` SET `CatName`='$_POST[catname]', `CatDesc`='$_POST[catdesc]', `CatType`='$_POST[cattype]' WHERE `CategoryID`='$_POST[categoryid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">Your update to $_POST[catname], has been submitted successfully...</div>";
} else if ($_POST["submit"] == "Delete Category") {
$sql = "DELETE FROM `t_categories` WHERE `CategoryID`='$_POST[categoryid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">You've successfully deleted the category '$_POST[catname]'...</div>";
}
if (!$categoryid) { $categoryid = $_POST["categoryid"]; }
// Show Edit Form
$sql = "SELECT * FROM `t_categories` WHERE `CategoryID` = '$categoryid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$categoryid = $row["CategoryID"];
$catname = $row["CatName"];
$catdesc = $row["CatDesc"];
$cattype = $row["CatType"];
?>
<div class="editbox">
<h3>Edit Category:</h3>
<form name="editcategory" method="post" action="?function=editcategory">
<?php
echo"Name: <input name=\"catname\" type=\"text\" value=\"$catname\" size=\"30\" maxlength=\"100\"><br />\n";
echo"Description: <input name=\"catdesc\" type=\"text\" value=\"$catdesc\" size=\"30\" maxlength=\"100\"><br />\n";
echo"Type: <input name=\"cattype\" type=\"text\" value=\"$cattype\" size=\"1\" maxlength=\"1\">\n";
echo"<input name=\"categoryid\" type=\"hidden\" value=\"$categoryid\"><br />\n";
?>
<input name="submit" type="submit" value="Update">
<input name="reset" type="reset" value="Reset Form">
<input name="submit" type="submit" value="Delete Category" onclick="return confirm('Are you sure?');">
</form>
<A HREF="?function=">&#171;&#171; Return to Category Manager</A>
</div>
<?php
//} else if ($function=="addcategory") {
//Add Category to MySQL Table
//if ($_POST["submit"]=="Create Category") {
// $sql = "INSERT INTO `t_categories` (`CatName`, `CatDesc`, `CatType`) VALUES ('$_POST[catname]', '$_POST[catdesc]', '$_POST[cattype]');";
// $result = mysql_query($sql) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
// echo"<div class=\"success\">The category $_POST[catname] has been Successfully Added...</div>";
//}
?>
<?php
//<div class="editbox">
//<h3>Add New Category:</h3>
//<form name="addcategory" method="post" action="?function=addcategory">
//Name: <input name="catname" type="text" value="" size="30" maxlength="100"><br />
//Description: <input name="catdesc" type="text" value="" size="30" maxlength="100"><br />
//Type: <input name="cattype" type="text" value="E" size="1" maxlength="1"><br />
//<input name="submit" type="submit" value="Create Category">
//<input name="reset" type="reset" value="Reset Form">
//</form>
?>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,174 @@
<?php
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html lang="EN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Style-Type" content="text/css">
<?php
require"../core/config.php";
//Define Breadcrumbs for Header Navigation
$breadcrumbs[]['name'] = "Manage Application Versions";
$breadcrumbs[]['url'] = "/admin/appmanager.php";
?>
<link rel="stylesheet" type="text/css" href="/admin/core/mozupdates.css">
<title>MozUpdates :: Manage Application Versions</title>
</head>
<body>
<?php
include"$page_header";
?>
<?php
if (!$function) {
?>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 95%" class="listing">
<TR><TD COLSPAN=5 STYLE="background-color: #FFFFFF; font-size:14pt; font-weight: bold;">Manage FAQs:</TD></TR>
<tr>
<td class="hline" colspan="5"></td>
</tr>
<TR>
<tr>
<th></th>
<th>FAQ Entry</th>
<th>Updated</th>
<th>Active</th>
</tr>
<?php
$sql = "SELECT * FROM `t_faq` ORDER BY `index` ASC, `title` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
//Create Customizeable Timestamp
$date = $row["lastupdated"];
$day=substr($date,6,2); //get the day
$month=substr($date,4,2); //get the month
$year=substr($date,0,4); //get the year
$hour=substr($date,8,2); //get the hour
$minute=substr($date,10,2); //get the minute
$second=substr($date,12,2); //get the sec
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
$lastupdated = gmdate("F d, Y g:i:sa", $timestamp);
$applications[] = $row["AppName"];
echo"<tr>\n";
echo"<td>".++$i."</td>\n";
echo"<td>&nbsp;<a href=\"?function=edit&id=".$row["id"]."\">".$row["title"]."</a></td>\n";
echo"<td>$lastupdated</td>\n";
echo"<td>$row[active]</td>\n";
echo"</tr>\n";
}
?>
</table>
<div style="width: 580px; border: 1px dotted #AAA; margin-top: 2px; margin-left: 50px; font-size: 10pt; font-weight: bold">
<form name="addapplication" method="post" action="?function=addentry">
<a href="?function=addentry">New FAQ Entry</A>
Title: <input name="title" type="text" size="20" maxlength="150" value="">
<input name="submit" type="submit" value="Add Entry"></SPAN>
</form>
</div>
<?php
} else if ($function=="edit") {
$id = $_GET["id"];
//Post Functions
if ($_POST["submit"] == "Update Entry") {
$sql = "UPDATE `t_faq` SET `title`='$_POST[title]', `index`='$_POST[index]', `alias`='$_POST[alias]', `text`='$_POST[text]', `active`='$_POST[active]' WHERE `id`='$_POST[id]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">Your update to $_POST[title], has been successful.</div>";
} else if ($_POST["submit"] == "Delete Entry") {
$sql = "DELETE FROM `t_faq` WHERE `id`='$_POST[id]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">You've successfully deleted the application '$_POST[AppName]'.</div>";
}
if (!$id) { $id = $_POST["id"]; }
// Show Edit Form
$sql = "SELECT * FROM `t_faq` WHERE `id` = '$id' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
?>
<div class="editbox">
<h3>Edit FAQ Entry:</h3>
<form name="editfaq" method="post" action="?function=edit">
<?php
echo"<input name=\"id\" type=\"hidden\" value=\"".$row["id"]."\" />\n";
echo"Title: <input name=\"title\" type=\"text\" size=\"40\" maxlength=\"150\" value=\"".$row["title"]."\"><br>\n";
echo"Index: <input name=\"index\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"".$row["index"]."\">&nbsp;&nbsp;";
echo"Alias: <input name=\"alias\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"".$row["alias"]."\"><br>";
echo"Entry Text:<BR><TEXTAREA NAME=\"text\" ROWS=10 COLS=60>$row[text]</TEXTAREA>";
$active = $row["active"];
if ($active=="YES") {
echo"Yes: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"YES\" CHECKED>/ No: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"NO\">";
} else if ($active=="NO") {
echo"Yes: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"YES\">/ No: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"NO\" CHECKED>";
} else {
echo"Yes: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"YES\">/ No: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"NO\">";
}
?>
<BR>
<input name="submit" type="submit" value="Update Entry" />
<input name="reset" type="reset" value="Reset Form" />
<input name="submit" type="submit" value="Delete Entry" onclick="return confirm('Are you sure?');" />
</form>
<A HREF="?function=">&#171;&#171; Return to FAQ Manager</A>
</div>
<?php
} else if ($function=="addentry") {
//Add Category to MySQL Table
if ($_POST["submit"]=="Add FAQ Entry") {
$sql = "INSERT INTO `t_faq` (`title`,`index`,`alias`, `text`, `active`) VALUES ('$_POST[title]','$_POST[index]','$_POST[alias]', '$_POST[text]', '$_POST[active]')";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">The entry $_POST[title] has been successfully added.</div>";
}
?>
<div class="editbox">
<h3>Add FAQ Entry:</h3>
<form name="addfaq" method="post" action="?function=addentry">
<?php
echo"Title: <input name=\"title\" type=\"text\" size=\"40\" maxlength=\"150\" value=\"$_POST[title]\"><br>\n";
echo"Index: <input name=\"index\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"\">&nbsp;&nbsp;";
echo"Alias: <input name=\"alias\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"\"><br>";
echo"Entry Text:<BR><TEXTAREA NAME=\"text\" ROWS=10 COLS=60></TEXTAREA>";
echo"Yes: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"YES\" CHECKED>/ No: <INPUT NAME=\"active\" TYPE=\"RADIO\" VALUE=\"NO\">";
?>
<BR>
<input name="submit" type="submit" value="Add FAQ Entry" />
<input name="reset" type="reset" value="Reset Form" />
</form>
<A HREF="?function=">&#171;&#171; Return to FAQ Manager</A>
</div>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</body>
</html>

View File

@@ -0,0 +1,31 @@
<div id="side">
<ul id="nav">
<li><A HREF="main.php">Overview</A></li>
<?php
if ($_SESSION["level"] == "user") {
?>
<li><A HREF="usermanager.php">Your Profile</A></li>
<?php
} else if ($_SESSION["level"] == "moderator") {
?>
<li><A HREF="usermanager.php">Your Profile</A></li>
<li><A HREF="listmanager.php?type=T">Themes list</A></li>
<li><A HREF="listmanager.php?type=E">Extensions list</A></li>
<?php
} else {
?>
<li><A HREF="usermanager.php?function=edituser&userid=<?php echo"$_SESSION[uid]"; ?>">Your Profile</A></li>
<li><A HREF="listmanager.php?type=T">Themes list</A></li>
<li><A HREF="listmanager.php?type=E">Extensions list</A></li>
<li><A HREF="usermanager.php">Users Manager</A></li>
<li><a href="appmanager.php">Application Manager</a></li>
<li><a href="categorymanager.php">Category Manager</A></li>
<li><a href="osmanager.php">OS Manager</a></li>
<li><a href="faqmanager.php">FAQ Manager</A></li>
<?php } ?>
<li><a href="logout.php">Logout</A></li>
</ul>
</DIV>
<hr class="hide">
<div id="mainContent">

View File

@@ -0,0 +1,56 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
//If already logged in, we don't need to show the prompt... redirect the user in.
if ($_SESSION["logoncheck"]=="YES") {
$return_path="developers/main.php?sid=$sid";
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/admin/core/mozupdates.css">
<TITLE>Mozilla Update :: Developer Control Panel</TITLE>
<?php
include"$page_header";
?>
<hr class="hide">
<div id="mBody">
<div id="mainContent" class="right">
<h3>About the Developer Control Panel</h3>
</div>
<div id="side" class="right">
<h3>Developers Login</h3>
<?php if ($_GET[login]=="failed") { ?>
<strong>You were not successfully logged in. Check your e-mail address and password and try again.</strong>
<?php } else if ($_GET[logout]=="true") { ?>
<strong>You've been successfully logged out.</strong>
<?php } else {} ?>
<TABLE CELLPADDING=1 CELLSPACING=1 ALIGN="CENTER">
<TR><TD STYLE="margin-top: 4px"></TD></TR>
<FORM NAME="login" METHOD="POST" ACTION="login.php">
<TR>
<TD><strong>E-Mail:</strong></TD><TD><INPUT NAME="email" TYPE="TEXT" SIZE=30 MAXLENGTH=200></TD>
</TR>
<TR>
<TD><strong>Password:</strong></TD><TD><INPUT NAME="password" TYPE="PASSWORD" SIZE=30 MAXLENGTH=100></TD>
</TR>
<TR>
<TD ALIGN=CENTER COLSPAN=2><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Login"> <input type="reset" value="Reset"></TD>
</TR>
</FORM>
</TABLE>
</div>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,159 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: Item Overview</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<?php
$id = $_GET["id"];
$sql = "SELECT TM.ID, TM.GUID, TM.Name, TM.Homepage, TM.Description, TM.downloadcount, TM.TotalDownloads, TM.Rating, TU.UserEmail FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
WHERE TM.ID = '$id' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
$row = mysql_fetch_array($sql_result);
$v++;
$id = $row["ID"];
$guid = $row["GUID"];
$name = $row["Name"];
$dateadded = $row["DateAdded"];
$dateupdated = $row["DateUpdated"];
$homepage = $row["Homepage"];
$description = nl2br($row["Description"]);
$downloadcount = $row["downloadcount"];
$totaldownloads = $row["TotalDownloads"];
$rating = $row["Rating"];
$i=""; $categories="";
$sql = "SELECT TC.CatName FROM `t_categoryxref` TCX
INNER JOIN t_categories TC ON TCX.CategoryID = TC.CategoryID
WHERE TCX.ID = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$catname = $row["CatName"];
$categories .="$catname";
if ($i<$numresults) {$categories .=", ";}
}
?>
<div id="mainContent" class="right">
<h2>Item Overview :: <?php echo"$name"; ?></h2>
<?php
echo"<a href=\"listmanager.php?function=editmain&id=$id\">Edit $name</a><br>\n";
echo"$description<br>\n";
if ($guid) {echo"GUID: $guid<br>\n"; }
if ($homepage) {echo"Homepage: <a href=\"$homepage\">$homepage</a><br>\n";}
echo"Categories: $categories<br>\n";
?>
<h3>Listed Versions</h3>
<?php
$approved_array = array("?"=>"Pending Approval", "YES"=>"Approved", "NO"=>"Disabled");
$sql = "SELECT vID, TV.Version, URI, OSName, approved FROM `t_version` TV
INNER JOIN t_os TOS ON TOS.OSID = TV.OSID
WHERE `ID`='$id' GROUP BY `URI` ORDER BY `Version`";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while($row = mysql_fetch_array($sql_result)) {
$vid = $row["vID"];
$version = $row["Version"];
$uri = $row["URI"];
$filename = basename($row["URI"]);
$os = $row["OSName"];
$approved = $row["approved"];
$approved = $approved_array["$approved"];
echo"<h4><a href=\"listmanager.php?function=editversion&id=$id&vid=$vid\">Version $version</a> - $approved</h4>\n";
echo"$filename - for $os<br>\n";
$sql2 = "SELECT TV.Version, AppName, MinAppVer, MaxAppVer FROM `t_version` TV
INNER JOIN t_applications TA ON TA.AppID = TV.AppID
WHERE `ID`='$id' AND `URI`='$uri' ORDER BY TV.Version, TA.AppName";
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while($row2 = mysql_fetch_array($sql_result2)) {
$app = $row2["AppName"];
$minappver = $row2["MinAppVer"];
$maxappver = $row2["MaxAppVer"];
echo"For $app:&nbsp;&nbsp;$minappver - $maxappver<BR>\n";
}
}
?>
</div>
<div id="side" class="right">
<h2>Statistics</h2>
<img src="/images/download.png" border=0 height=34 width=34 alt="" class="iconbar">Downloads this Week: <?php echo"$downloadcount"; ?><br>
Total Downloads: <?php echo"$totaldownloads"; ?><BR>
<BR>
<img src="/images/ratings.png" border=0 height=34 width=34 alt="" class="iconbar">Rated: <?php echo"$rating"; ?> of 5<BR>&nbsp;<br>
<BR>
<img src="/images/edit.png" border=0 height=34 width=34 alt="" class="iconbar">Comments: <?php echo"$num_comments"; ?><BR>&nbsp;<br>
<h2>Developer Comments</h2>
<?php
if ($_POST["submit"]=="Post Comments") {
$id = $_POST["id"];
$comments = $_POST["comments"];
$sql = "UPDATE `t_main` SET `devcomments`='$comments' WHERE `id`='$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($sql_result) { echo"Developer Comments Updated...<br>\n"; }
}
$sql = "SELECT `devcomments` FROM `t_main` WHERE `id`='$id' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$devcomments = $row["devcomments"];
?>
<form name="devcomments" method="post" action="itemoverview.php?id=<?php echo"$id"; ?>">
<input name="id" type="hidden" value="<?php echo"$id"; ?>">
<textarea name="comments" rows=10 cols=26><?php echo"$devcomments"; ?></textarea><br>
<input name="submit" type="submit" value="Post Comments">&nbsp;<input name="reset" type="reset" value="Reset">
</form>
<h2><a href="previews.php?id=<?php echo"$id"; ?>">Previews</a></h2>
<?php
$sql = "SELECT * FROM `t_previews` TP WHERE `ID`='$id' AND `preview`='YES' ORDER BY `PreviewID` LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$previewid = $row["PreviewID"];
$uri = $row["PreviewURI"];
$filename = basename($row["PreviewURI"]);
$filename_array[$i] = $filename;
$caption = $row["caption"];
$preview = $row["preview"];
list($src_width, $src_height, $type, $attr) = getimagesize("$websitepath/$uri");
echo"<a href=\"previews.php?id=$id\"><img src=\"$uri\" border=0 $attr alt=\"$caption\"></a><br>$caption\n";
}
if (mysql_num_rows($sql_result)=="0") {echo"<a href=\"previews.php?id=$id\">Add a Preview</a>...<br>\n"; }
?>
</div>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,579 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: List Manager</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<?php
if (!$function) {
$typearray = array("E"=>"Extensions","T"=>"Themes");
if (!$_GET["type"]) {$_GET["type"]="E";}
?>
<h1>Manage <?php $typename = $typearray[$_GET[type]]; echo"$typename"; ?>:</h1>
<SPAN style="font-size: 10pt"><a href="additem.php?function=additem&type=<?php echo"$_GET[type]"; ?>" style="font-weight: bold;">Add New Item</a> | Show: <?php
$count = count($typearray);
$i = 0;
foreach ($typearray as $type =>$typename) {
$i++;
echo"<a href=\"?type=$type\">$typename</a>";
if ($i !== $count) {echo" / "; }
}
unset($i);
?></SPAN>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 ALIGN=CENTER STYLE="border: solid 0px #000000; width: 95%" class="listing">
<TR>
<TH><!-- Counter --></TH>
<TH>Name</TH>
<TH>Description</TH>
<TH>Last Updated</TH>
</TR>
<?php
$sql = "SELECT TM.ID, TM.Name, TM.Description, TM.DateUpdated FROM `t_main` TM ";
if ($_SESSION[level]=="user") { $sql .= "LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID "; }
$sql .= "WHERE TM.Type = '$_GET[type]'";
if ($_SESSION[level]=="user") {$sql .=" AND TU.UserEmail = '$_SESSION[email]'"; }
$sql .=" ORDER BY `Type` , `Name` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["ID"];
$name = $row["Name"];
$description = substr($row["Description"],0,75);
$dateupdated = gmdate("F d, Y", strtotime($row["DateUpdated"]));
$i++;
echo"<tr>\n";
echo"<td align=\"center\" width=\"20\">$i</td>\n";
echo"<td><a href=\"itemoverview.php?id=$id\">$name</a></td>\n";
echo"<td>$description</td>\n";
echo"<td nowrap>$dateupdated</td>\n";
echo"</tr>\n";
}
?>
</table>
<div style="width: 580px; border: 1px dotted #AAA; margin-top: 2px; margin-left: 50px; padding: 5px; font-size: 10pt; font-weight: bold">
<form name="addapplication" method="post" ACTION="?function=additem2" enctype="multipart/form-data">
<a href="additem.php?function=additem">New <?php $typename = $typearray[$_GET[type]]; echo"$typename"; ?></A>
Input File: <input name="file" size=30 type="file">
<input name="type" type="hidden" value="<?php echo"$_GET[type]"; ?>">
<input name="submit" type="submit" value="Next &#187;"></SPAN>
</form>
</div>
<?php
} else if ($function=="editmain") {
//Process Submitted Values if this is a return with $_POST data for the parent objects...
if ($_POST["submit"]=="Update") {
unset($sql_result);
echo"<DIV style=\"width: 95%; text-align:left; margin: 0px; margin-bottom: 10px\">";
echo"<h2>Updating $name, please wait...</h2>";
if ($_POST["name"] && $_POST["authors"] && $_POST["categories"] && $_POST["description"]) {
//Everything We *must* have is present... Begin....
//Phase One, update t_main values...
$sql = "UPDATE `t_main` SET `Name`= '$_POST[name]', `Homepage`='$_POST[homepage]', `Description`='$_POST[description]', `DateUpdated`=NOW(NULL) WHERE `ID`='$_POST[id]' LIMIT 1";
//echo"$sql<br>\n"; //Debug
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
echo"Your update to $_POST[name] has been submitted successfully...<br>\n";
}
echo"<SPAN style=\"font-size 10pt;\">";
//Phase Two, Author List -- Autocomplete and Verify
$authors = $_POST["authors"];
$authors = explode(", ","$authors");
foreach ($authors as $author) {
if (strlen($author)<2) {continue;} //Kills all values that're too short..
$a++;
$sql = "SELECT `UserID`,`UserEmail` FROM `t_userprofiles` WHERE `UserEmail` LIKE '$author%' ORDER BY `UserMode`, `UserName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$userid = $row["UserID"];
$useremail = $row["UserEmail"];
if ($numresults>1) {
//Too many e-mails match, store individual data for error block.
$r++;
$emailerrors[$a]["foundemails"][$r] = $useremail;
}
$authorids[] = $userid;
}
if ($numresults !="1") {
//No Valid Entry Found for this E-Mail or too many, kill and store data for error block.
$emailerrors[$a]["author"] = "$author";
$updateauthors = "false"; // Just takes one of these to kill the author update.
}
}
unset($a,$r);
//Commit Updates to AuthorXref tables.. with the ID and UserID.
if ($updateauthors != "false") {
//Remove Current Authors
$sql = "DELETE FROM `t_authorxref` WHERE `ID` = '$_POST[id]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//Add New Authors based on $authorids
sort($authorids);
foreach ($authorids as $authorid) {
$sql = "INSERT INTO `t_authorxref` (`ID`, `UserID`) VALUES ('$_POST[id]', '$authorid');";
$result = mysql_query($sql) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
}
echo"Authors for $_POST[name]'s updated...<br>\n";
} else {
echo"ERROR: Could not update Authors list, please fix the errors printed below and try again...<br>\n";
}
unset($authors); //Clear from Post..
//Phase Three, Category List, update linkages.
//print_r($_POST["categories"]);
//Delete Current Category Linkages...
$sql = "DELETE FROM `t_categoryxref` WHERE `ID` = '$_POST[id]'";
//echo"$sql<br>\n"; //Debug
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//Add New Categories from $_POST["categories"]
foreach ($_POST["categories"] as $categoryid) {
$sql = "INSERT INTO `t_categoryxref` (`ID`, `CategoryID`) VALUES ('$_POST[id]', '$categoryid');";
//echo"$sql<br>\n"; //Debug
$result = mysql_query($sql) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
}
echo"Categories for $_POST[name]'s updated...<br>\n";
//End _POST if.
} else {
//Something Isnt Present.. Throw the main error and details...
echo"You're missing one or more required fields, please return to the previous page and correct the errors and try again...<br>\n";
if (!$_POST["name"]) {echo"Name is required<br>\n";}
if (!$_POST["authors"]) {echo"Authors is required<br>\n";}
if (!$_POST["categories"]) {echo"Categories is required<br>\n";}
if (!$_POST["description"]) {echo"Description is required<br>\n";}
}
echo"</SPAN></DIV>";
} else if ($_POST["submit"]=="Delete") {
$name = $_POST["name"];
$id = $_POST["id"];
echo"<h1>Deleting $name, please wait...</h1>\n";
$sql = "SELECT `Version`, `URI` FROM `t_version` WHERE `ID`='$id' GROUP BY `URI` ORDER BY `Version` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$version = $row["Version"];
$uri = $row["URI"];
//Delete File(s) from server
if (strpos("$uri","approvalfile.php/")) {
$file = str_replace("http://$sitehostname/developers/approvalfile.php/","$repositorypath/approval/",$uri);
} else if (strpos("$uri","ftp.mozilla.org")) {
$ftppath = $uri;
$file = str_replace("http://ftp.mozilla.org/pub/mozilla.org/","$repositorypath/ftp/",$uri);
}
if (file_exists($file)) {
$unlink = unlink($file);
} else {
$file_exists = "false";
}
if ($file_exists == "false" or !$unlink) {
echo"<strong>Error!</strong> Encountered a problem when trying to delete associated files, files were not deleted successfully<br>\n";
} else {
echo"Deleted $name $version (".basename($uri).") successfully...<br>\n";
}
}
if ($ftppath) {
$basename = basename($ftppath);
$ftppath = str_replace("/$basename","",$ftppath);
$ftppath = str_replace("http://ftp.mozilla.org/pub/mozilla.org","$repositorypath/ftp",$ftppath);
if (@rmdir($ftppath)) {
echo"Removed Directory for $name...<br>\n";
} else {
echo"<strong>Warning!</strong> Unable to remove directory for $name. Directory may not be empty.<br>\n";
}
}
$sql = "DELETE FROM `t_main` WHERE `ID`='$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
echo"$name has been deleted...<br>\n";
echo"<a href=\"./\">&#171;&#171; Back to Main Page...</a><br>\n";
include"$page_footer";
echo"</body>\n</html>\n";
exit;
}
}
//----------------------
// END
//----------------------
//Get Parent Item Information
$id = $_GET["id"];
if (!$id) {$id = $_POST["id"]; }
$sql = "SELECT TM.ID, TM.Type, TM.GUID, TM.Name, TM.Description, TM.DateAdded, TM.DateUpdated, TM.Homepage, TU.UserEmail FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
WHERE TM.ID = '$id'
ORDER BY `Type` , `Name` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$v++;
$id = $row["ID"];
$type = $row["Type"];
$guid = $row["GUID"];
$name = $row["Name"];
$dateadded = date("l, F, j Y g:i:s",strtotime($row["DateAdded"]));
$dateupdated = date("l, F, j Y g:i:s",strtotime($row["DateUpdated"]));
$homepage = $row["Homepage"];
$description = $row["Description"];
$downloadcount = $row["DownloadCount"];
$authors[$v] = $row["UserEmail"];
}
unset($v);
//Make Authors E-Mail Array into a Nice String
$num_authors = count($authors);
foreach($authors as $author) {
$v++;
$authorstring .= "$author";
if ($v != $num_authors) { $authorstring .=", "; }
}
$authors = $authorstring;
unset($v);
?>
<h1><?php echo"Edit $name"; ?></h1>
<TABLE CELLPADDING=1 CELLSPACING=1 STYLE="border: solid 0px #000000;">
<FORM NAME="editmain" METHOD="POST" ACTION="?function=editmain&<?php echo"id=$id"; ?>">
<INPUT NAME="id" TYPE="HIDDEN" VALUE="<?php echo"$id"; ?>">
<TR><TD>GUID:</TD><TD><?php echo"$guid"; ?></TD>
<?php
//Get Currently Set Categories for this Object...
$sql = "SELECT TCX.CategoryID, TC.CatName FROM `t_categoryxref` TCX
INNER JOIN t_categories TC ON TCX.CategoryID = TC.CategoryID
WHERE TCX.ID = '$id'
ORDER BY `CatName` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$n++;
$catid = $row["CategoryID"];
$categories[$n] = $catid;
}
unset($n);
//Get the Category Table Data for the Select Box
$sql = "SELECT `CategoryID`, `CatName` FROM `t_categories` WHERE `CatType` = '$type' ORDER BY `CatName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
// $sqlnum = mysql_num_rows($sql_result);
?>
<TD ROWSPAN=8 VALIGN=TOP><SPAN class="global">Categories:</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;<SELECT NAME="categories[]" MULTIPLE="YES" SIZE="10">
<?php
while ($row = mysql_fetch_array($sql_result)) {
$catid = $row["CategoryID"];
$catname = $row["CatName"];
echo"<OPTION value=\"$catid\"";
foreach ($categories as $validcat) {
if ($validcat==$catid) { echo" SELECTED"; }
}
echo">$catname</OPTION>\n";
}
?>
</SELECT></TD></TR>
<tr><td>Date Added:</td><td><?php echo"$dateadded"; ?></td></tr>
<tr><td>Last Updated:</td><td><?php echo"$dateupdated"; ?></td></tr>
<TR><TD><SPAN class="global">Name*</SPAN></TD> <TD><INPUT NAME="name" TYPE="TEXT" VALUE="<?php echo"$name"; ?>" SIZE=50 MAXLENGTH=100></TD></TR>
<?php
//Author Error Handling/Display Block for Form Post...
if ($emailerrors) {
echo"<TR><TD COLSPAN=2 STYLE=\"\">\n";
echo"<DIV style=\"margin-left 2px; border: 1px dotted #CCC; width: 550px; font-weight: bold\">";
echo"<FONT STYLE=\"color: #FF0000; font-weight: bolder\">Errors Found in Authors</FONT><BR>\n";
echo"<FONT STYLE=\"font-size: 10pt\">\n";
foreach ($emailerrors as $authorerror) {
$author = $authorerror["author"];
$count = count($authorerror["foundemails"]);
if ($count=="0") {
//Error for No Entry Found
echo"Entry '$author': No Matches Found, Please check your entry and try again.<BR>\n";
} else {
//Error for Too Many Entries Found
echo"Entry '$author': Too Many Matches, Please make your entry more specific.<BR>\n";
}
if ($count>0 AND $count<6) {
echo"&nbsp;&nbsp;&nbsp;&nbsp;Possible Addresses found: ";
foreach ($authorerror["foundemails"] as $foundemails) {
$a++;
echo"$foundemails";
if ($a != $count) {echo", "; } else {echo"<br>\n";}
}
}
}
echo"</font></DIV></TD></TR>\n";
$authors = $_POST["authors"];
}
?>
<TR><TD><SPAN class="global">Author(s):*</SPAN></TD><TD><INPUT NAME="authors" TYPE="TEXT" VALUE="<?php echo"$authors"; ?>" SIZE=50></TD></TR>
<TR><TD><SPAN class="global">Homepage</SPAN></TD> <TD><INPUT NAME="homepage" TYPE="TEXT" VALUE="<?php echo"$homepage"; ?>" SIZE=50 MAXLENGTH=200></TD></TR>
<TR><TD><SPAN class="global">Description*</SPAN></TD> <TD><TEXTAREA NAME="description" ROWS=4 COLS=45><?php echo"$description"; ?></TEXTAREA></TD></TR>
<TR><TD COLSPAN="2" ALIGN="CENTER"><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Update">&nbsp;&nbsp;<INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form">&nbsp;&nbsp;<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Delete" ONCLICK="return confirm('Warning! Are you sure you want to delete <?php echo"$name"; ?>? This action is not reversable and will remove all files and listed versions.');"></TD></TR>
</FORM>
</TABLE>
&nbsp;&nbsp;&nbsp;<a href="itemoverview.php?id=<?php echo"$id"; ?>">&#171;&#171; Back to Item Overview</a>
<?php
} else if ($function=="editversion") {
//Process Submitted Values if this is a return with $_POST data for the parent objects...
if ($_POST["submit"]=="Update") {
unset($sql_result);
echo"<DIV style=\"width: 100%; margin: auto; margin-bottom: 10px\">";
echo"<h2>Updating Version, please wait...</h2>\n";
//print_r($_POST);
//echo"<br><Br>\n";
echo"<SPAN style=\"font-size 10pt;\">";
//Phase One-Part 1 -- Version (per-file record update)
$notes = $_POST["notes"];
$id = $_POST["id"];
$uri = $_POST["uri"];
$osid = $_POST["osid"];
$sql = "UPDATE `t_version` SET `OSID`='$osid', `Notes`='$notes', `DateUpdated`=NOW(NULL) WHERE `ID`='$id' AND `URI`='$uri'";
//echo"$sql<br>\n";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"Version Notes and OS for $_POST[name] $_POST[version] updated...<br>\n";
//Phase Two -- Update Min/Max Versions
//Construct Internal App_Version Arrays
$i=0;
$sql = "SELECT `int_version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` ORDER BY `AppName`, `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$int_version = $row["int_version"];
$subver = $row["SubVer"];
$release = "$row[major].$row[minor]";
if ($row["release"]) {$release = "$release.$row[release]";}
if ($subver !=="final") {$release="$release$subver";}
$app_internal_array[$release] = $int_version;
}
//print_r($app_internal_array);
for ($i = 1; $i <= $_POST[maxval]; $i++) {
unset($minappver_int,$maxappver_int);
$minappver = $_POST["minappver_$i"];
$maxappver = $_POST["maxappver_$i"];
$vid = $_POST["appvid_$i"];
if ($app_internal_array["$minappver"]) {$minappver_int = $app_internal_array["$minappver"]; }
if ($app_internal_array["$maxappver"]) {$maxappver_int = $app_internal_array["$maxappver"]; }
if (!$minappver_int) {$minappver_int = $minappver;}
if (!$maxappver_int) {$maxappver_int = $maxappver;}
if ($minappver && $maxappver) {
$sql = "UPDATE `t_version` SET `MinAppVer`='$minappver', `MinAppVer_int`='$minappver_int', `MaxAppVer`='$maxappver', `MaxAppVer_int`='$maxappver_int' WHERE `vID`='$vid'";
//echo"$sql<br>\n";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"Updated Target Application Values for Application $i...<br>\n";
} else {
if (!$minappver) { echo"<SPAN class=\"error\">Error: Minimum Version is not specified or invalid</SPAN><BR>\n"; }
if (!$maxappver) { echo"<SPAN class=\"error\">Error: Maximum Version is not specified or invalid</SPAN><BR>\n"; }
}
}
echo"</SPAN></DIV>";
} else if ($_POST["submit"]=="Delete") {
$id = $_POST["id"];
$uri = $_POST["uri"];
$version = $_POST["version"];
echo"<h1>Deleting Version... Please wait...</h1>\n";
$sql = "SELECT `Name` FROM `t_main` WHERE `ID` = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$name = $row["Name"];
$sql = "DELETE FROM `t_version` WHERE `ID`='$id' AND `URI`='$uri'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
//Delete File from server
if (strpos("$uri","approvalfile.php/")) {
$file = str_replace("http://$sitehostname/developers/approvalfile.php/","$repositorypath/approval/",$uri);
} else if (strpos("$uri","ftp.mozilla.org")) {
$file = str_replace("http://ftp.mozilla.org/pub/mozilla.org/","$repositorypath/ftp/",$uri);
}
if (file_exists($file)) {
$unlink = unlink($file);
} else {
$file_exists = "false";
}
if ($file_exists == "false" or !$unlink) {
echo"<strong>Error!</strong> Encountered a problem when trying to delete associated files, files were not deleted successfully<br>\n";
}
echo"<DIV>$name $version has been deleted...<br>
<a href=\"itemoverview.php?id=$id\">&#171;&#171; Back to the $name overview page...</a></DIV>";
include"$page_footer";
echo"</BODY></HTML>";
exit;
}
}
//----------------------
// END
//----------------------
//Get Parent Item Information
$id = $_GET["id"];
if (!$id) {$id = $_POST["id"]; }
$sql = "SELECT TM.ID, TM.Name FROM `t_main` TM WHERE TM.ID = '$id' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$id = $row["ID"];
$name = $row["Name"];
//-----------------------
// Version Table
//-----------------------
$vid = $_GET["vid"];
if (!$vid) {$vid = $_POST["vid"]; }
//Get Data for Form Population
//INNER JOIN t_main TM ON TV.ID = TM.ID
$sql = "SELECT `Version`, TV.OSID, `OSName`,`URI`,`Notes`,`Size`,`DateAdded`, `DateUpdated` FROM `t_version` TV INNER JOIN `t_os` TOS ON TOS.OSID=TV.OSID WHERE `vID` = '$vid' ORDER BY `Version` ASC LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$v++;
$version=$row["Version"];
$osid=$row["OSID"];
$osname=$row["OSName"];
$minappver=$row["MinAppVer"];
$maxappver=$row["MaxAppVer"];
$uri=$row["URI"];
$filename=basename($row["URI"]);
$notes=$row["Notes"];
$size=$row["Size"];
?>
<h1><?php echo"Edit $name Version $version"; ?></h1>
<TABLE CELLPADDING=1 CELLSPACING=1 STYLE="border: solid 0px #000000;">
<FORM NAME="editversion" METHOD="POST" ACTION="?function=editversion&<?php echo"id=$id&vid=$vid"; ?>">
<?php
echo"<INPUT NAME=\"id\" TYPE=\"HIDDEN\" VALUE=\"$id\">\n";
echo"<INPUT NAME=\"uri\" TYPE=\"HIDDEN\" VALUE=\"$uri\">\n";
echo"<INPUT NAME=\"version\" TYPE=\"HIDDEN\" VALUE=\"$version\">\n";
echo"<TR><TD colspan=2>$filename ($size"."kb)</TD></TR>\n";
//Construct App_Versions Arrays
$i=0;
$sql = "SELECT `AppName`, `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` ORDER BY `AppName`, `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$application = strtolower($row["AppName"]);
$display_version = $row["Version"];
$subver = $row["SubVer"];
$release = "$row[major].$row[minor]";
if ($row["release"]) {$release = "$release.$row[release]";}
if ($subver !=="final") {$release="$release$subver";}
$app_ver_array[$application][] = $release;
$app_display_array[$application][$release] = $display_version;
}
$i=0;
echo"<TR><TD COLSPAN=2><SPAN class=\"file\">Target Application(s):</SPAN></TD></TR>\n";
$sql = "SELECT vID, TV.AppID,`AppName`,`MinAppVer`,`MaxAppVer` FROM `t_version` TV INNER JOIN `t_applications` TA ON TA.AppID=TV.AppID WHERE `ID` = '$id' && TV.URI = '$uri' ORDER BY `AppName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$appname = $row["AppName"];
$appid=$row["AppID"];
$minappver=$row["MinAppVer"];
$maxappver=$row["MaxAppVer"];
echo"<TR><TD></TD><TD>$appname ";
echo"<INPUT NAME=\"appvid_$i\" TYPE=\"hidden\" VALUE=\"$row[vID]\">";
echo"<SELECT name=\"minappver_$i\" TITLE=\"Minimum Version* (Required)\">\n";
foreach ($app_ver_array[strtolower($appname)] as $app_version) {
$display_version = $app_display_array[strtolower($appname)][$app_version];
echo"<OPTION value=\"$app_version\""; if ($app_version==$minappver) {echo" SELECTED";} echo">$display_version</OPTION>\n";
}
echo"</SELECT>\n";
echo"&nbsp;-&nbsp;";
echo"<SELECT name=\"maxappver_$i\" TITLE=\"Maximum Version* (Required)\">\n";
foreach ($app_ver_array[strtolower($appname)] as $app_version) {
$display_version = $app_display_array[strtolower($appname)][$app_version];
echo"<OPTION value=\"$app_version\""; if ($app_version==$maxappver) {echo" SELECTED";} echo">$display_version</OPTION>\n";
}
echo"</SELECT>\n";
echo"</TD></TR>\n";
}
echo"<INPUT type=\"hidden\" name=\"maxval\" value=\"$i\">";
echo"<TR><TD><SPAN class=\"file\">OS*</SPAN></TD><TD>";
echo"<SELECT name=\"osid\">";
$os = $osid;
$sql = "SELECT * FROM `t_os` ORDER BY `OSName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$osname = $row["OSName"];
$osid = $row["OSID"];
echo"<OPTION value=\"$osid\""; if ($osid == $os) {echo" SELECTED"; } echo">$osname</OPTION>\n";
}
echo"</SELECT>\n";
echo"</TD></TR>\n";
echo"<TR><TD style=\"vertical-align: top\"><SPAN class=\"file\">Version Notes:</SPAN></TD><TD COLSPAN=2><TEXTAREA NAME=\"notes\" ROWS=4 COLS=55>$notes</TEXTAREA></TD></TR>\n";
?>
<TR><TD COLSPAN="3" ALIGN="CENTER"><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Update">&nbsp;&nbsp;<INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form">&nbsp;&nbsp;<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Delete" ONCLICK="return confirm('Are you sure you want to delete <?php echo"$name $version"; ?>?');"></TD></TR>
</FORM>
</TABLE>
&nbsp;&nbsp;&nbsp;<a href="itemoverview.php?id=<?php echo"$id"; ?>">&#171;&#171; Back to Item Overview</a>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,44 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
$password = md5($_POST[password]);
$sql = "SELECT DISTINCT `UserID`, `UserEmail`,`UserName`,`UserMode`,`UserTrusted` FROM `t_userprofiles` WHERE `UserEmail` = '$_POST[email]' && `UserPass` = '$password' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
$num = mysql_num_rows($sql_result);
if ($num == 1) {
$row = mysql_fetch_array($sql_result);
$userid=$row["UserID"];
$useremail=$row["UserEmail"];
$username=$row["UserName"];
$usermode=$row["UserMode"];
$usertrusted=$row["UserTrusted"];
$logoncheck="YES";
//User Role to Session Level variable...
$rolearray = array("A"=>"admin", "E"=>"editor","U"=>"user");
$usermode = $rolearray[$usermode];
//Register Session Variables
$_SESSION["uid"] = "$userid";
$_SESSION["email"] = "$useremail";
$_SESSION["name"] = "$username";
$_SESSION["level"] = "$usermode";
$_SESSION["trusted"] = "$usertrusted";
$_SESSION["logoncheck"] = "$logoncheck";
$return_path="developers/main.php";
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
exit;
} else {
$return_path ="developers/index.php?login=failed";
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
exit;
}
?>

View File

@@ -0,0 +1,10 @@
<?php
require"core/sessionconfig.php";
session_unset();
session_destroy();
$return_path="developers/index.php?logout=true";
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
?>

View File

@@ -0,0 +1,110 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: Overview</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<h2>Welcome <?php echo"$_SESSION[name]";?>!</h2>
<P>
<?php
if ($_SESSION["level"] == "admin" or $_SESSION["level"] == "moderator") {
$sql ="SELECT TM.ID FROM `t_main` TM
INNER JOIN `t_version` TV ON TM.ID = TV.ID
WHERE `approved` = '?' ORDER BY TV.DateUpdated ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$num_result = mysql_num_rows($sql_result);
?>
<SPAN STYLE="font-weight:bold">Approval Queue Status: <A HREF="approval.php?function=approvalqueue"><?php echo"$num_result"; ?> Pending Approval</A></SPAN>
<?php } ?>
<h3>My Extensions</h3>
<?php
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.Description, TM.downloadcount, TM.TotalDownloads, TM.Rating, TU.UserEmail FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
WHERE TU.UserID = '$_SESSION[uid]' AND TM.Type ='E'
ORDER BY `Type` , `Name` ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$v++;
$id = $row["ID"];
$type = $row["Type"];
$name = $row["Name"];
$dateadded = $row["DateAdded"];
$dateupdated = $row["DateUpdated"];
$homepage = $row["Homepage"];
$description = nl2br($row["Description"]);
$authors = $row["UserEmail"];
$downloadcount = $row["downloadcount"];
$totaldownloads = $row["TotalDownloads"];
$rating = $row["Rating"];
echo"<h4><A HREF=\"itemoverview.php?id=$id\">$name</A></h4>\n";
echo"$description\n";
//Icon Bar
echo"<DIV style=\"margin-top: 10px; height: 34px\">";
echo"<DIV class=\"iconbar\"><A HREF=\"itemoverview.php?id=$id\"><IMG SRC=\"/images/edit.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">&nbsp;Edit Item</A></DIV>";
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Downloads: $downloadcount<BR>&nbsp;&nbsp;$totaldownloads total</DIV>";
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"/extensions/moreinfo.php?id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"</DIV>";
}
?>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="additem.php?type=E">Add New Extension...</a>
</P>
<P>
<h3>My Themes</h3>
<?php
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.DateAdded, TM.Description, TM.downloadcount, TM.TotalDownloads, TM.Rating, TU.UserEmail FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
WHERE TU.UserID = '$_SESSION[uid]' AND TM.Type ='T'
ORDER BY `Type` , `Name` ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["ID"];
$type = $row["Type"];
$name = $row["Name"];
$dateadded = $row["DateAdded"];
$dateupdated = $row["DateUpdated"];
$homepage = $row["Homepage"];
$description = substr($row["Description"],0,75);
$authors = $row["UserEmail"];
$downloadcount = $row["downloadcount"];
$totaldownloads = $row["TotalDownloads"];
$rating = $row["Rating"];
echo"<h4><A HREF=\"itemoverview.php?id=$id\">$name</A></h4>\n";
echo"$description\n";
//Icon Bar
echo"<DIV style=\"margin-top: 10px; height: 34px\">";
echo"<DIV class=\"iconbar\"><A HREF=\"itemoverview.php?id=$id\"><IMG SRC=\"/images/edit.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">&nbsp;Edit Item</A></DIV>";
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Downloads: $downloadcount<BR>&nbsp;&nbsp;$totaldownloads total</DIV>";
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"/themes/moreinfo.php?id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"</DIV>";
}
?>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="additem.php?type=T">Add New Theme...</a>
</P>
</DIV>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,153 @@
<?php
require"core/sessionconfig.php";
$function = $_GET["function"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html lang="EN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Style-Type" content="text/css">
<?php
require"../core/config.php";
//Define Breadcrumbs for Header Navigation
$breadcrumbs[]['name'] = "Manage Operating Systems";
$breadcrumbs[]['url'] = "/admin/oscategories.php";
?>
<link rel="stylesheet" type="text/css" href="/admin/core/mozupdates.css">
<title>MozUpdates :: Manage Operating Systems</title>
</head>
<body>
<?php
include"$page_header";
?>
<?php
if (!$function) {
?>
<?php
//Add Category to MySQL Table
if ($_POST["submit"]=="Create OS") {
$sql = "INSERT INTO `t_os` (`OSname`) VALUES ('$_POST[osname]')";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
}
?>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 95%" class="listing">
<TR><TD COLSPAN=2 STYLE="background-color: #FFFFFF; font-size:14pt; font-weight: bold;">Manage OS List:</TD></TR>
<tr>
<td class="hline" colspan="2"></td>
</tr>
<tr>
<th></th>
<th>Name</th>
</tr>
<?php
$sql = "SELECT * FROM `t_os` ORDER BY `OSName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
echo"<tr>\n";
echo"<td>".++$i."</td>\n";
echo"<td><a href=\"?function=editcategory&osid=".$row["OSID"]."\">".$row["OSName"]."</a></td>\n";
echo"</tr>\n";
}
?>
</table>
<div style="width: 580px; border: 1px dotted #AAA; margin-top: 2px; margin-left: 50px; font-size: 10pt; font-weight: bold">
<?php
//Add Category to MySQL Table
if ($_POST["submit"]=="Create OS") {
//Disabled Here, See Above...
// $sql = "INSERT INTO `t_os` (`OSname`) VALUES ('$_POST[osname]')";
// $sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">The OS $_POST[osname] has been successfully added.</div>";
}
?>
<form name="addcategory" method="post" action="?function=">
<SPAN style="color: #00F">Add New OS</SPAN>:
Name: <input name="osname" type="text" size="30" maxlength="100" value="">
<input name="submit" type="submit" value="Create OS">
</form>
</div>
<?php
} else if ($function=="editcategory") {
$osid = $_GET["osid"];
//Post Functions
if ($_POST["submit"] == "Update") {
$sql = "UPDATE `t_os` SET `OSName`='$_POST[osname]' WHERE `OSID`='$_POST[osid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">Your update to $_POST[osname], has been successful.</div>";
} else if ($_POST["submit"] == "Delete OS") {
$sql = "DELETE FROM `t_os` WHERE `OSID`='$_POST[osid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
echo"<div class=\"success\">You've successfully deleted the operating system '$_POST[osname]'.</div>";
}
if (!$osid) { $osid = $_POST["osid"]; }
// Show Edit Form
$sql = "SELECT * FROM `t_os` WHERE `OSID` = '$osid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
?>
<div class="editbox">
<h3>Edit OS:</h3>
<form name="editcategory" method="post" action="?function=editcategory">
<?php
echo"Name: <input name=\"osname\" type=\"text\" size=\"30\" maxlength=\"100\" value=\"".$row["OSName"]."\">\n";
echo"<input name=\"osid\" type=\"hidden\" value=\"".$row["OSID"]."\"><br />\n";
?>
<input name="submit" type="submit" value="Update" />
<input name="reset" type="reset" value="Reset Form" />
<input name="submit" type="submit" value="Delete OS" onclick="return confirm('Are you sure?');" />
</form>
<A HREF="?function=">&#171;&#171; Return to OS Manager</A>
</div>
<?php
//} else if ($function=="addcategory") {
//Add Category to MySQL Table
// if ($_POST["submit"]=="Create OS") {
// $sql = "INSERT INTO `t_os` (`OSname`) VALUES ('$_POST[osname]')";
// $sql_result = mysql_query($sql, $connection) or trigger_error("<div class=\"error\">MySQL Error ".mysql_errno().": ".mysql_error()."</div>", E_USER_NOTICE);
//
// echo"<div class=\"success\">The OS $_POST[osname] has been successfully added.</div>";
// }
?>
<?php
//<div class="editbox">
//<h3>Add New Operating System:</h3>
//<form name="addcategory" method="post" action="?function=addcategory">
//Name: <input name="osname" type="text" size="30" maxlength="100" value=""><br />
//<input name="submit" type="submit" value="Create OS" />
//<input name="reset" type="reset" value="Reset Form" />
//</form>
//</div>
?>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</body>
</html>

View File

@@ -0,0 +1,255 @@
<?php
require"../core/config.php";
require"core/sessionconfig.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: Item Previews</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<?php
$id = $_GET["id"];
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.Description, TM.downloadcount, TM.TotalDownloads, TM.Rating, TU.UserEmail FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
WHERE TM.ID = '$id' AND TM.Type ='E'
ORDER BY `Type` , `Name` ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$numresults = mysql_num_rows($sql_result);
$row = mysql_fetch_array($sql_result);
$v++;
$id = $row["ID"];
$type = $row["Type"];
$name = $row["Name"];
$dateadded = $row["DateAdded"];
$dateupdated = $row["DateUpdated"];
$homepage = $row["Homepage"];
$description = nl2br($row["Description"]);
$authors = $row["UserEmail"];
$downloadcount = $row["downloadcount"];
$totaldownloads = $row["TotalDownloads"];
$rating = $row["Rating"];
?>
<h2>Item Previews :: <?php echo"$name"; ?></h2>
<?php
if ($_POST["submit"]=="Update Previews") {
for ($i = 1; $i <= $_POST["maxid"]; $i++) {
$previewid = $_POST["previewid_$i"];
$caption = $_POST["caption_$i"];
$delete = $_POST["delete_$i"];
$sql = "SELECT `PreviewURI` from `t_previews` WHERE `PreviewID`='$previewid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$file = $row["PreviewURI"];
$file = "$websitepath/$file";
$imagesize = @getimagesize($file);
if ($_POST["preview"]==$previewid AND $imagesize[0]<="180" AND $imagesize[1]<="75") {$preview="YES"; } else {$preview="NO";}
if ($delete==$previewid) {
if (file_exists($file)) { unlink($file); }
$sql = "DELETE FROM `t_previews` WHERE `PreviewID`='$previewid'";
} else {
$sql = "UPDATE `t_previews` SET `caption`='$caption', `preview`='$preview' WHERE `PreviewID`='$previewid'";
}
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
}
echo"Previews successfully updated. The new values for the preview records should be shown below.<br>\n";
}
unset($i);
$sql = "SELECT * FROM `t_previews` TP WHERE `ID`='$id' ORDER BY `PreviewID`";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$num_results = mysql_num_rows($sql_result);
if ($num_results>"0") {
?>
<form name="updatepreviews" method="post" action="?id=<?php echo"$id"; ?>&function=updatepreviews">
<?php
}
while($row = mysql_fetch_array($sql_result)) {
$i++;
$previewid = $row["PreviewID"];
$uri = $row["PreviewURI"];
$filename = basename($row["PreviewURI"]);
$filename_array[$i] = $filename;
$caption = $row["caption"];
$preview = $row["preview"];
list($src_width, $src_height, $type, $attr) = getimagesize("$websitepath/$uri");
$filesize = round(filesize("$websitepath/$uri")/1024,1);
$popup_width = $src_width+25;
$popup_height = $src_height+25;
//Scale Image Dimensions
$dest_width="200"; // Destination Width /$tn_size_width
$dest_height_fixed="150"; // Destination Height / $tn_size_height (Fixed)
if ($src_width<=$dest_width AND $src_height<=$dest_width) {
$dest_width = $src_width;
$dest_height = $src_height;
$nopopup = true;
} else {
$dest_height= ($src_height * $dest_width) / $src_width; // (Aspect Ratio Variable Height
if ($dest_height>$dest_height_fixed) {
$dest_height = $dest_height_fixed;
$dest_width = ($src_width * $dest_height) / $src_height;
}
}
echo"<h3>Preview #$i - $caption </h3>\n";
echo"$filename ($src_width x $src_height) $filesize"."Kb"; if ($preview=="YES") {echo" (List Page Preview)";}echo"<br>\n";
if ($nopopup != "true") {echo"<a href=\"javascript:void(window.open('$uri', '', 'scrollbars=yes,resizable=yes,width=$popup_width,height=$popup_height,left=30,top=20'));\">";}
echo"<img src=\"$uri\" border=0 width=$dest_width height=$dest_height alt=\"$caption\" title=\"$caption\">";
if ($nopopup != "true") {echo"</a>";}
echo"<br>\n";
echo"<input name=\"previewid_$i\" type=\"hidden\" value=\"$previewid\">\n";
echo"Edit Caption: <input name=\"caption_$i\" type=\"text\" value=\"$caption\" size=30>";
if ($preview == "YES" OR ( $src_width<="175" AND $src_height <="80")) {
echo"&nbsp;&nbsp;List Page Preview? <input name=\"preview\" type=\"radio\" value=\"$previewid\""; if ($preview=="YES") {echo" checked"; } echo"><br>\n";
} else { echo"<br>\n"; }
echo"Delete File? <input name=\"delete_$i\" type=\"checkbox\" value=\"$previewid\"><br>\n";
}
?>
<?php if ($num_results>"0") { ?>
<input name="maxid" type="hidden" value="<?php echo"$i"; ?>">
<br><input name="submit" type="submit" value="Update Previews"><input name="reset" type="reset" value="Reset">
</form>
<?php } ?>
<h3>Add Preview</h3>
<?php
//Add Photo Function
if ($_POST["submit"]=="Add Preview") {
//Compute the maxval for the filename for the new file.
foreach ( $filename_array as $filename) {
$exploded_filename = explode("-", $filename);
$count = count($exploded_filename)-1;
$val = explode(".",$exploded_filename[$count]);
$val = $val[0];
if (!$maxval or $maxval<$val) {$maxval=$val;}
}
$maxval = $maxval+1;
$i=$maxval;
unset($count,$val,$exploded_filename,$filename,$maxval);
$width = $_POST["width"];
$height = $_POST["height"];
$preview = $_POST["preview"];
$caption = $_POST["caption"];
$name = str_replace(" ","_",$name);
$previewpath = strtolower("images/previews/$name-$i.jpg");
if ($preview=="YES") {
$width = "180";
$height = "75";
} else {
$preview="NO";
}
$filename=$_FILES['file']['name'];
$filetype=$_FILES['file']['type'];
$filesize=$_FILES['file']['size'];
$uploadedfile=$_FILES['file']['tmp_name'];
$status=$_FILES['file']['error'];
//Status
if ($status==0) {$statusresult="Success!";
} else if ($status==1) {$statusresult="Error: File Exceeds upload_max_filesize (PHP)";
} else if ($status==2) {$statusresult="Error: File Exceeds max_file_size (HTML)";
} else if ($status==3) {$statusresult="Error: File Incomplete, Partial File Received";
} else if ($status==4) {$statusresult="Error: No File Was Uploaded";
}
//Now to make the Image...
$sourcepath="$uploadedfile"; // Source Image Path -- Destination from FileUpload()
$srcimagehw = @GetImageSize($sourcepath); //GetImage Info -- Source Image
$src_width="$srcimagehw[0]"; // Source Image Width
$src_height="$srcimagehw[1]"; // Source Image Height
$type = $srcimagehw[2];
if (!$width) {$width=$src_width;}
if (!$height) {$height=$src_height;}
if ($type=="2" or $type=="3") {
//Destination Properties for the Display Image
//Output Image Dimensions
$dest_width="$width"; // Destination Width /$tn_size_width
$dest_height_fixed="$height"; // Destination Height / $tn_size_height (Fixed)
$dest_height= ($src_height * $dest_width) / $src_width; // (Aspect Ratio Variable Height
if ($dest_height>$dest_height_fixed) {
$dest_height = $dest_height_fixed;
$dest_width = ($src_width * $dest_height) / $src_height;
}
$quality="80"; // JPEG Image Quality
$outputpath="$websitepath/$previewpath"; //path of output image ;-)
if ($type=="2") {
$src_img = imagecreatefromjpeg("$sourcepath");
} else if ($type=="3") {
$src_img = imagecreatefrompng("$sourcepath");
$quality="95";
}
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width, $src_height);
imageinterlace($dst_img, 1);
$white = ImageColorAllocate($dst_img, 255, 255, 255);
//Make a couple of size corrections for the auto-border feature..
$dest_width = $dest_width-1;
$dest_height = $dest_height-1;
imagerectangle ($dst_img, 0, 0, $dest_width, $dest_height, $white);
$status = imagejpeg($dst_img, "$outputpath", $quality);
imagedestroy($src_img);
imagedestroy($dst_img);
if ($status=="1") {
//Lets attempt to add the record to the DB.
$sql = "INSERT INTO `t_previews` (`PreviewURI`,`ID`,`caption`,`preview`) VALUES ('/$previewpath','$id','$caption','$preview');";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($sql_result=="1") {
echo"Your File $filename ($filesize bytes) has been successfully uploaded and added to the database. <a href=\"?id=$id\">Click here</a> to refresh this page to show the added entry for editing.<BR><BR>";
}
}
} else {
echo"<span class=error>The image you uploaded has errors and could not be processed successfully. The image may be corrupt or not in the correct format. This tool only supports jpeg and png images. Please try your operation again.</span><br><br>\n";
}
}
?>
<form name="addpreview" method="post" action="?id=<?php echo"$id"; ?>&function=addpreview" enctype="multipart/form-data">
Only PNG or JPG images are supported for addition to the preview screenshots page for your item. Check the "List Page Preview" box
if you'd like the image to be featured on the list and the top of the item details pages. To just have it added to your screenshots
page, leave the box unchecked<br>
<input name="file" SIZE=30 type="file"> List Page Preview? <input name="preview" type="checkbox" value="YES"><br>
Image Width:<input name="width" type="text" value="0" size=5> x Height: <input name="height" type="text" value="0" size=5><br>
Leave Width and Height at 0 for full-size. This setting is ignored for preview images, which have strict size requirements.<br><br>
Image Caption: <input name="caption" type="text" size="30"><br>
<input name="submit" type="submit" value="Add Preview"><input name="reset" type="reset" value="Reset">
</form>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,396 @@
<?php
require"core/sessionconfig.php";
$function = $_GET["function"];
//Access Level: "user" code, to keep user from altering other profiles but their own.
if ($_SESSION["level"] !=="admin") {
//Kill access to add user.
if ($function=="adduser" or $function=="postnewuser") {unset($function);}
if (!$function) { $function="edituser"; }
$userid=$_SESSION["uid"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<?php
require"../core/config.php";
//Define Breadcrumbs for Header Navigation
$breadcrumbs[]['name'] = "Manage Users";
$breadcrumbs[]['url'] = "/admin/users.php";
if ($function=="edituser") {
$breadcrumbs[]['name'] = "Edit User";
$breadcrumbs[]['url'] = "/admin/users.php?function=edituser&userid=$_GET[userid]";
if ($_POST[submit]=="Update") { $breadcrumbs[]['name'] = "Update User";
} else if ($_POST[submit]=="Delete User") { $breadcrumbs[]['name'] = "Delete User"; }
} else if ($function=="adduser") {
$breadcrumbs[]['name'] = "Add User";
$breadcrumbs[]['url'] = "/admin/users.php?function=adduser";
} else if ($function=="changepassword") {
$breadcrumbs[]['name'] = "Change Password";
$breadcrumbs[]['url'] = "/admin/users.php?function=changepassword&userid=$_GET[userid]";
}
?>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/admin/core/mozupdates.css">
<TITLE>MozUpdates :: Manage Users</TITLE>
</HEAD>
<BODY>
<?php
include"$page_header";
?>
<?php
if (!$function) {
?>
<?php
if ($_POST["submit"] && $_GET["action"]=="update") {
?>
<div style="width: 80%; border: 1px dotted #AAA; margin: auto; margin-bottom: 10px; font-size: 10pt; font-weight: bold">
<?php
//Process Post Data, Make Changes to User Table.
//Begin General Updating
for ($i=1; $i<=$_POST[maxuserid]; $i++) {
$admin = $_POST["admin$i"];
$editor = $_POST["editor$i"];
$trusted = $_POST["trusted$i"];
$disabled = $_POST["disabled$i"];
//echo"$i - $admin - $editor - $trusted<br>\n";
if ($admin=="TRUE") { $mode="A";
} else if ($editor=="TRUE") { $mode="E";
} else if ($disabled=="TRUE") {$mode="D";
} else { $mode="U"; }
if ($trusted !=="TRUE") {$trusted="FALSE"; }
$sql = "UPDATE `t_userprofiles` SET `UserMode`= '$mode', `UserTrusted`= '$trusted' WHERE `UserID`='$i'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
}
unset($i);
echo"<SPAN STYLE=\"font-size:14pt\">Your changes to the User List have been succesfully completed</SPAN><BR>";
//Do Special Disable, Delete, Enable Account Operations
if ($_POST["selected"] AND $_POST["submit"] !=="Update") {
//$selected = $_POST["selected"];
if ($_POST["submit"]=="Disable Selected") {
$sql = "UPDATE `t_userprofiles` SET `UserMode`= 'D' WHERE `UserID`='$_POST[selected]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"User Account for User Number $_POST[selected] Disabled<br>\n";
} else if ($_POST["submit"]=="Delete Selected") {
$sql = "DELETE FROM `t_userprofiles` WHERE `UserID`='$_POST[selected]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"User Account for User Number $_POST[selected] Deleted<br>\n";
} else if ($_POST["submit"]=="Enable Selected") {
$sql = "UPDATE `t_userprofiles` SET `UserMode`= 'U' WHERE `UserID`='$_POST[selected]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"User Account for User Number $_POST[selected] Enabled, User Mode set to User<br>\n";
}
}
echo"</DIV>\n";
}
?>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 95%" class="listing">
<TR><TD COLSPAN=5 STYLE="background-color: #FFFFFF; font-size:14pt; font-weight: bold;">Manage User List:</TD></TR>
<tr>
<td class="hline" colspan="5"></td>
</tr>
<TR>
<TH></TH>
<TH><B>Name</B></TH>
<TH><B>E-Mail Address</B></TH>
<TH><B>S E A T</B></TH>
</TR>
<FORM NAME="updateusers" METHOD="POST" ACTION="?function=&action=update">
<?php
$sql = "SELECT * FROM `t_userprofiles` ORDER BY `UserMode`, `UserName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$userid = $row["UserID"];
$username = $row["UserName"];
$useremail = $row["UserEmail"];
$userwebsite = $row["UserWebsite"];
$usermode = $row["UserMode"];
$useremailhide = $row["UserEmailHide"];
$t = $row["UserTrusted"];
if ($userid>$maxuserid) {$maxuserid =$userid;}
if ($usermode=="A") {$a="TRUE"; $e="TRUE";
} else if ($usermode=="E") {$e="TRUE"; $a="FALSE";
} else if ($usermode=="U") {$e="FALSE"; $a="FALSE";
} else if ($usermode=="D") {$d="TRUE";}
$i++;
echo"<TR>";
echo"<TD CLASS=\"tablehighlight\" ALIGN=CENTER><B>$i</B></TD>\n";
echo"<TD CLASS=\"tablehighlight\"><B>&nbsp;&nbsp;<A HREF=\"?function=edituser&userid=$userid\">$username</A></B></TD>\n";
echo"<TD CLASS=\"tablehighlight\"><B>&nbsp;&nbsp;<A HREF=\"mailto:$useremail\">$useremail</A></B></TD>\n";
echo"<TD CLASS=\"tablehighlight\"><INPUT NAME=\"selected\" TYPE=\"RADIO\" VALUE=\"$userid\" TITLE=\"Selected User\">";
echo"<INPUT NAME=\"editor$userid\" TYPE=\"CHECKBOX\" VALUE=\"TRUE\" "; if ($e=="TRUE") {echo"CHECKED=\"CHECKED\""; } if ($a=="TRUE" or $d=="TRUE" ) {echo" DISABLED=\"DISABLED\"";} echo" TITLE=\"Editor\">";
echo"<INPUT NAME=\"admin$userid\" TYPE=\"CHECKBOX\" VALUE=\"TRUE\" "; if ($a=="TRUE") {echo"CHECKED=\"CHECKED\""; } if ($d=="TRUE" ) {echo" DISABLED=\"DISABLED\"";} echo" TITLE=\"Administrator\">";
echo"<INPUT NAME=\"trusted$userid\" TYPE=\"CHECKBOX\" VALUE=\"TRUE\" "; if ($t=="TRUE") {echo"CHECKED=\"CHECKED\""; } if ($d=="TRUE" ) {echo" DISABLED=\"DISABLED\"";}echo" TITLE=\"Trusted User\">";
if ($d=="TRUE") {echo"<INPUT NAME=\"disabled$userid\" TYPE=\"HIDDEN\" VALUE=\"TRUE\">\n"; }
echo"</TD>\n";
echo"</TR>\n";
unset($a,$e,$t);
}
echo"<INPUT NAME=\"maxuserid\" TYPE=\"HIDDEN\" VALUE=\"$maxuserid\">";
?>
<TR><TD COLSPAN=3 ALIGN=CENTER>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Disable Selected" ONCLICK="return confirm('Disabling this account will hide all their extensions and themes from view and prevent them from logging in. Do you want to procede and disable this account?');">
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Enable Selected">
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Delete Selected" ONCLICK="return confirm('Deleting this account will permanently remove all their extensions and account information from Mozilla Update. This cannot be undone. Do you want to procede and delete this account?');">
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Update">
</TD>
<TD><INPUT NAME="selected" TYPE="RADIO" VALUE="" CHECKED TITLE="Selected User"></TD>
</TR>
</FORM>
</TABLE>
<div style="width: 580px; border: 1px dotted #AAA; margin-top: 2px; margin-left: 50px; font-size: 10pt; font-weight: bold">
<form name="adduser" method="post" action="?function=adduser">
<a href="?function=adduser">New User</A>
E-Mail: <input name="email" type="text" size="20" maxlength="150" value="">
<input name="submit" type="submit" value="Add User"></SPAN>
</form>
</div>
<?php
} else if ($function=="edituser") {
if (!$userid) {$userid = $_GET["userid"];}
//Process Submitted Values if this is a return with $_POST data...
if ($_POST["submit"]=="Update") {
if ($_SESSION["level"] !=="admin" && $_SESSION["uid"] !== $_POST["userid"]) {$_POST["userid"]=$_SESSION["uid"];}
$_POST["username"] = htmlspecialchars($_POST["username"]);
$admin = $_POST["admin"];
$editor = $_POST["editor"];
$trusted = $_POST["trusted"];
$usermode = $_POST["usermode"];
if ($admin=="TRUE") { $mode="A";
} else if ($editor=="TRUE") { $mode="E";
} else if ($disabled=="TRUE") {$mode="D";
} else { $mode="U"; }
if (!$admin AND $usermode=="A") {$mode="A";} //Ensure possible mode change during session doesn't wipe out changes.
if ($usermode=="D") {$mode="D"; $trusted="FALSE";}
if ($trusted !=="TRUE") {$trusted="FALSE"; }
$sql = "UPDATE `t_userprofiles` SET `UserName`= '$_POST[username]', `UserEmail`='$_POST[useremail]', `UserWebsite`='$_POST[userwebsite]', `UserMode`='$mode', `UserTrusted`='$trusted', `UserEmailHide`='$_POST[useremailhide]' WHERE `UserID`='$_POST[userid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"<DIV style=\"width: 550px; font-size: 14pt; font-weight: bold; text-align:center; margin: auto\">Your update to $_POST[username], has been submitted successfully...</DIV>";
} else if ($_POST["submit"] == "Delete User") {
if ($_SESSION["level"] !=="admin" && $_SESSION["uid"] !== $_POST["userid"]) {$_POST["userid"]=$_SESSION["uid"];}
$sql = "DELETE FROM `t_userprofiles` WHERE `UserID`='$_POST[userid]'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"<DIV style=\"width: 550px; font-size: 14pt; font-weight: bold; text-align:center; margin: auto\">You've successfully deleted $_POST[username]...</DIV>";
}
if (!$userid) {$userid=$_POST["userid"];}
//Show Edit Form
$sql = "SELECT * FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$userid = $row["UserID"];
$username = $row["UserName"];
$useremail = $row["UserEmail"];
$userwebsite = $row["UserWebsite"];
$userpass = $row["UserPass"];
$usermode = $row["UserMode"];
$trusted = $row["UserTrusted"];
$useremailhide = $row["UserEmailHide"];
?>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 500px">
<TR><TD COLSPAN=2 STYLE="font-size:14pt; font-weight: bold; border-bottom: solid 1px #000000">Edit Profile for <?php echo"$username"; ?>:</TD></TR>
<FORM NAME="edituser" METHOD="POST" ACTION="?function=edituser">
<?php
echo"<INPUT NAME=\"userid\" TYPE=\"HIDDEN\" VALUE=\"$userid\">\n";
echo"<TR><TD STYLE=\"width: 130px\"><B>Name:</B></TD><TD><INPUT NAME=\"username\" TYPE=\"TEXT\" VALUE=\"$username\" SIZE=30 MAXLENGTH=100></TD></TR>\n";
echo"<TR><TD><B>E-Mail:</B></TD><TD><INPUT NAME=\"useremail\" TYPE=\"TEXT\" VALUE=\"$useremail\" SIZE=30 MAXLENGTH=100></TD></TR>\n";
echo"<TR><TD><B>Website:</B></TD><TD><INPUT NAME=\"userwebsite\" TYPE=\"TEXT\" VALUE=\"$userwebsite\" SIZE=30 MAXLENGTH=100></TD></TR>\n";
echo"<TR><TD><B>Password:</B></TD><TD><FONT STYLE=\"font-size:10pt; font-weight: bold\"><A HREF=\"?function=changepassword&userid=$userid\">Change Password</A></FONT></TD></TR>\n";
echo"<TR><TD><B>Permissions:</B></TD><TD>";
if ($_SESSION["level"]=="user" or $_SESSION[level]=="editor") {
if ($usermode=="U") {echo"User <INPUT NAME=\"user\" TYPE=\"HIDDEN\" VALUE=\"TRUE\">\n"; //To prevent being reset to null on submit.
} else if ($usermode=="E") {
echo"Editor <INPUT NAME=\"editor\" TYPE=\"HIDDEN\" VALUE=\"TRUE\">\n";
} else {
echo"Unknown <INPUT NAME=\"usermode\" TYPE=\"HIDDEN\" VALUE=\"$usermode\">\n";
}
if ($trusted=="TRUE") {
echo"Trusted <INPUT NAME=\"trusted\" TYPE=\"HIDDEN\" VALUE=\"TRUE\">\n";
}
} else if ($_SESSION["level"]=="admin") {
if ($usermode=="A") {$a="TRUE"; $e="TRUE";
} else if ($usermode=="E") {$e="TRUE"; $a="FALSE";
} else if ($usermode=="U") {$e="FALSE"; $a="FALSE";
}
echo"Editor: <INPUT NAME=\"editor\" TYPE=\"CHECKBOX\" VALUE=\"TRUE\" "; if ($e=="TRUE") {echo"CHECKED";} if ($a=="TRUE") {echo" DISABLED=\"DISABLED\"";} echo">\n ";
echo"Admin: <INPUT NAME=\"admin\" TYPE=\"CHECKBOX\" VALUE=\"TRUE\" "; if ($a=="TRUE") {echo"CHECKED";} echo">\n ";
echo"Trusted: <INPUT NAME=\"trusted\" TYPE=\"CHECKBOX\" VALUE=\"TRUE\" "; if ($trusted=="TRUE") {echo"CHECKED";} echo">\n";
}
echo"</TD></TR>\n";
echo"<TR><TD><B>E-Mail Public:<B></TD><TD>";
if ($useremailhide==="1") {
echo"Hidden: <INPUT NAME=\"useremailhide\" TYPE=\"RADIO\" VALUE=\"1\" CHECKED> Visible: <INPUT NAME=\"useremailhide\" TYPE=\"RADIO\" VALUE=\"0\">";
} else if ($useremailhide==="0") {
echo"Hidden: <INPUT NAME=\"useremailhide\" TYPE=\"RADIO\" VALUE=\"1\"> Visible: <INPUT NAME=\"useremailhide\" TYPE=\"RADIO\" VALUE=\"0\" CHECKED>";
} else {
echo"Hidden: <INPUT NAME=\"useremailhide\" TYPE=\"RADIO\" VALUE=\"1\"> Visible: <INPUT NAME=\"useremailhide\" TYPE=\"RADIO\" VALUE=\"0\">";
}
echo"</TD></TR>\n";
?>
<TR><TD COLSPAN="2" ALIGN="CENTER"><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Update">&nbsp;&nbsp;<INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form">&nbsp;&nbsp;<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Delete User" ONCLICK="return confirm('Are you sure?');"></TD></TR>
</FORM>
<?php if ($_SESSION["level"]=="user" or $_SESSION["level"]=="editor") {} else { ?>
<TR><TD COLSPAN="2"><A HREF="?function=">&#171;&#171; Return to User Manager</A></TD></TR>
<?php } ?>
</TABLE>
<?php
} else if ($function=="adduser") {
if ($_POST["submit"]=="Create User") {
//Verify Users Password and md5 encode it for storage...
if ($_POST[userpass]==$_POST[userpassconfirm]) {
$_POST[userpass]=md5($_POST[userpass]);
} else {
$errors="true";
echo"<B>Your two passwords did not match, go back and try again...</B>";
}
//Add User to MySQL Table
if ($errors !="true") {
$_POST["username"] = htmlspecialchars($_POST["username"]);
$admin = $_POST["admin"];
$editor = $_POST["editor"];
$trusted = $_POST["trusted"];
$disabled = $_POST["disabled"];
//echo"$i - $admin - $editor - $trusted<br>\n";
if ($admin=="TRUE") { $mode="A";
} else if ($editor=="TRUE") { $mode="E";
} else if ($disabled=="TRUE") {$mode="D";
} else { $mode="U"; }
if ($trusted !=="TRUE") {$trusted="FALSE"; }
$sql = "INSERT INTO `t_userprofiles` (`UserName`, `UserEmail`, `UserWebsite`, `UserPass`, `UserMode`, `UserTrusted`, `UserEmailHide`) VALUES ('$_POST[username]', '$_POST[useremail]', '$_POST[userwebsite]', '$_POST[userpass]', '$mode', '$trusted', '$_POST[useremailhide]');";
$result = mysql_query($sql) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
//include"mail_sendaccountdetails.php";
echo"<DIV style=\"width: 550px; font-size: 14pt; font-weight: bold; text-align:center; margin: auto\">The user $_POST[username] has been Successfully Added...</DIV>";
}
}
?>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 450px">
<TR><TD COLSPAN=2 STYLE="font-size:14pt; font-weight: bold; border-bottom: solid 1px #000000">Add New User:</TD></TR>
<FORM NAME="adduser" METHOD="POST" ACTION="?function=adduser">
<TR><TD><B>E-Mail:</B></TD><TD><INPUT NAME="useremail" TYPE="TEXT" VALUE="<?php echo"$_POST[email]"; ?>" SIZE=30 MAXLENGTH=100></TD></TR>
<TR><TD STYLE="width: 150px"><B>Name:</B></TD><TD><INPUT NAME="username" TYPE="TEXT" VALUE="" SIZE=30 MAXLENGTH=100></TD></TR>
<TR><TD><B>Website:</B></TD><TD><INPUT NAME="userwebsite" TYPE="TEXT" VALUE="" SIZE=30 MAXLENGTH=100></TD></TR>
<TR><TD><B>Password:</B></TD><TD><INPUT NAME="userpass" TYPE="PASSWORD" VALUE="" SIZE=30 MAXLENGTH=200></TD></TR>
<TR><TD ALIGN=RIGHT><FONT STYLE="font-size: 10pt"><B>Confirm:</B></FONT>&nbsp;&nbsp;</TD><TD><INPUT NAME="userpassconfirm" TYPE="PASSWORD" VALUE="" SIZE=30 MAXLENGTH=200></TD></TR>
<TR><TD><B>Permissions:</B></TD><TD>Editor: <INPUT NAME="editor" TYPE="CHECKBOX" VALUE="TRUE"> Admin: <INPUT NAME="admin" TYPE="CHECKBOX" VALUE="TRUE"> Trusted: <INPUT NAME="trusted" TYPE="CHECKBOX" VALUE="TRUE"></TD></TR>
<TR><TD><B>E-Mail Public:<B></TD><TD>Hidden: <INPUT NAME="useremailhide" TYPE="RADIO" VALUE="1" CHECKED> Visible: <INPUT NAME="useremailhide" TYPE="RADIO" VALUE="0"></TD></TR>
<TR><TD COLSPAN="2" ALIGN="CENTER"><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Create User">&nbsp;&nbsp;<INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form"></TD></TR>
</FORM>
<TR><TD COLSPAN="2"><A HREF="?function=">&#171;&#171; Return to User Manager</A></TD></TR>
</TABLE>
<?php
} else if ($function=="changepassword") {
if (!$userid) {$userid = $_GET["userid"]; }
//Set Password Change if this is a POST.
if ($_POST["submit"]=="Change Password") {
echo"<DIV style=\"width: 500px; font-size: 14pt; font-weight: bold; text-align:center; margin: auto\">";
$sql = "SELECT `UserPass` FROM `t_userprofiles` WHERE `UserID` = '$_POST[userid]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$userpass = $row["UserPass"];
$oldpass = md5($_POST[oldpass]);
if ($_SESSION["level"]=="admin") {$oldpass=$userpass; } //Bypass Old Password check for Admins only
if ($userpass==$oldpass) {
if ($_POST[newpass]==$_POST[newpass2]) {
$userpass = md5($_POST["newpass"]);
$sql = "UPDATE `t_userprofiles` SET `UserPass`='$userpass' WHERE `UserID`='$_POST[userid]'";
//echo"$sql\n<br>";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
echo"The password has been successfully reset.<br>";
} else {
echo"The two passwords did not match, please go back and try again.</FONT>";
}
} else {
echo"Your Old password did not match the password on file, please try again.</FONT>";
}
echo"</DIV>\n";
}
if (!$userid) { $userid = $_POST["userid"]; }
//Get Name of User for Form
$sql = "SELECT `UserName` FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$username = $row["UserName"];
?>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER STYLE="border: solid 1px #000000; width: 500px">
<TR><TD COLSPAN=2 STYLE="font-size:14pt; font-weight: bold; border-bottom: solid 1px #000000">Change password for <?php echo"$username"; ?>:</TD></TR>
<FORM NAME="adduser" METHOD="POST" ACTION="?function=changepassword">
<INPUT NAME="userid" TYPE="HIDDEN" VALUE="<?php echo"$userid"; ?>">
<?php if ($_SESSION["level"] !=="admin") { ?>
<TR><TD><B>Old Password:</B></TD><TD><INPUT NAME="oldpass" TYPE="PASSWORD" VALUE="" SIZE=30 MAXLENGTH=200></TD></TR>
<?php } ?>
<TR><TD><B>New Password:</B></TD><TD><INPUT NAME="newpass" TYPE="PASSWORD" VALUE="" SIZE=30 MAXLENGTH=200></TD></TR>
<TR><TD><B>Retype New Password:</B>&nbsp;&nbsp;&nbsp;</TD><TD><INPUT NAME="newpass2" TYPE="PASSWORD" VALUE="" SIZE=30 MAXLENGTH=200></TD></TR>
<TR><TD COLSPAN="2" ALIGN="CENTER"><INPUT NAME="submit" TYPE="SUBMIT" VALUE="Change Password">&nbsp;&nbsp;<INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form"></TD></TR>
</FORM>
<TR><TD COLSPAN="2"><A HREF="?function=">&#171;&#171; Return to User Manager</A></TD></TR>
</TABLE>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB